Problem with Footer in ALV Report

Hi Experts,
What is coding for Footer In my ALV Report  how can I resolve it.
for example will come in footer like this....
'This Report is created by '
         Date is ',
          'Time is '
         Page No ' *
Please find below the piece of codes
REPORT  ZALV2      .
TABLES :   MAKT.                            " Material Description
TYPE-POOLS : SLIS.
TYPES : BEGIN OF TY_MAKT,
        MATNR TYPE MATNR,                   " Material No
        SPRAS TYPE SPRAS,                   " Language Key
        MAKTX TYPE MAKTX,                   " Material Description
        MAKTG TYPE MAKTG,                   " Material des in upper case
        END OF TY_MAKT.
DATA : T_MAKT TYPE STANDARD TABLE OF TY_MAKT INITIAL SIZE 0,
       T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
       T_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA : W_MAKT TYPE TY_MAKT,
       W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
       W_LISTHEADER TYPE SLIS_LISTHEADER,
       W_LAYOUT TYPE SLIS_LAYOUT_ALV.
CONSTANTS : C_MATNR TYPE SLIS_FIELDNAME VALUE 'MATNR',
            C_SPRAS TYPE SLIS_FIELDNAME VALUE 'SPRAS',
            C_MAKTX TYPE SLIS_FIELDNAME VALUE 'MAKTX',
            C_MAKTG TYPE SLIS_FIELDNAME VALUE 'MAKTG'.
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-000.
SELECT-OPTIONS : S_MATNR FOR MAKT-MATNR.
SELECTION-SCREEN END OF BLOCK BLK.
INITIALIZATION.
       PERFORM SUB_CLEAR_OBJ.
AT SELECTION-SCREEN.                     " it is used for validation
       PERFORM SUB_VALIDATE_DATA.
START-OF-SELECTION.
       PERFORM SUB_FETCH_DATA.
       PERFORM SUB_FIELDCAT USING :
                   C_MATNR TEXT-001  'X',
                   C_SPRAS TEXT-002  ' ',
                   C_MAKTX TEXT-003  ' ',
                   C_MAKTG TEXT-004  ' '.
       PERFORM SUB_LAYOUT.
       PERFORM SUB_DISPLAY.
END-OF-SELECTION.
TOP-OF-PAGE.
       PERFORM SUB_TOP_OF_PAGE.
       PERFORM SUB_WRITE_HEADER.
END-OF-PAGE.
   PERFORM  SUB_SET_PF_STATUS.
*&      Form  SUB_CLEAR_OBJ
      text
-->  p1        text
<--  p2        text
FORM SUB_CLEAR_OBJ .
REFRESH  : T_MAKT,
           T_FIELDCAT,
           T_LISTHEADER.
CLEAR    : W_MAKT,
           W_FIELDCAT,
           W_LISTHEADER.
ENDFORM.                    " SUB_CLEAR_OBJ
*&      Form  SUB_VALIDATE_DATA
      text
-->  p1        text
<--  p2        text
FORM SUB_VALIDATE_DATA .
DATA :  L_MATNR TYPE MATNR.
SELECT MATNR UP TO 1 ROWS FROM MAKT INTO L_MATNR.   " IN S_MATNR.
ENDSELECT.
IF SY-SUBRC <> 0.
MESSAGE E000(15) WITH 'IT IS AN INVALID NUMBER'.
ENDIF.
ENDFORM.                    " SUB_VALIDATE_DATA
*&      Form  SUB_FETCH_DATA
      text
-->  p1        text
<--  p2        text
FORM SUB_FETCH_DATA .
SELECT MATNR SPRAS MAKTX MAKTG FROM MAKT INTO TABLE T_MAKT WHERE MATNR
IN S_MATNR.
ENDFORM.                    " SUB_FETCH_DATA
*&      Form  SUB_FIELDCAT
      text
     -->P_C_MATNR  text
     -->P_TEXT_001  text
     -->P_0122   text
     -->P_0123   text
FORM SUB_FIELDCAT  USING :
                        FLD TYPE SLIS_FIELDNAME
                        TXT TYPE SCRTEXT_L
                       COL TYPE SLIS_FIELDCAT_ALV-OPTIMIZE
                        HPOT TYPE C.
W_FIELDCAT-TABNAME = 'ZSHEREE2'.
W_FIELDCAT-FIELDNAME = FLD.
W_FIELDCAT-SELTEXT_M = TXT.
*W_FIELDCAT-EMPHASIZE = COL.
W_FIELDCAT-HOTSPOT = HPOT.
APPEND W_FIELDCAT TO T_FIELDCAT.
ENDFORM.                    " SUB_FIELDCAT
*&      Form  SUB_LAYOUT
      text
-->  p1        text
<--  p2        text
FORM SUB_LAYOUT .
W_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
W_LAYOUT-ZEBRA = 'X'.
W_LAYOUT-F2CODE = '&ETA'.
ENDFORM.                    " SUB_LAYOUT
*&      Form  SUB_DISPLAY
      text
-->  p1        text
<--  p2        text
FORM SUB_DISPLAY .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
   I_CALLBACK_PROGRAM                = 'ZSHEREE2 '
   I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS_SET '
  I_CALLBACK_USER_COMMAND           = ' '
   I_CALLBACK_TOP_OF_PAGE            = 'SUB_TOP_OF_PAGE '
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
  I_BACKGROUND_ID                   = 'ALV_BACKGROUND '
   I_GRID_TITLE                      = 'Header Item / Data'
  I_GRID_SETTINGS                   = 5
   IS_LAYOUT                         = W_LAYOUT
   IT_FIELDCAT                       = T_FIELDCAT
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  IS_VARIANT                        =
  IT_EVENTS                         =
  IT_EVENT_EXIT                     =
  IS_PRINT                          =
  IS_REPREP_ID                      =
  I_SCREEN_START_COLUMN             =
  I_SCREEN_START_LINE               =
  I_SCREEN_END_COLUMN               = 0
  I_SCREEN_END_LINE                 = 0
  IT_ALV_GRAPHICS                   =
  IT_HYPERLINK                      =
  IT_ADD_FIELDCAT                   =
  IT_EXCEPT_QINFO                   =
  I_HTML_HEIGHT_TOP                 =
  I_HTML_HEIGHT_END                 =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
  TABLES
    T_OUTTAB                          = T_MAKT
EXCEPTIONS
   PROGRAM_ERROR                     = 1
   OTHERS                            = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.                    " SUB_DISPLAY
*&      Form  SUB_TOP_OF_PAGE
      text
-->  p1        text
<--  p2        text
FORM SUB_TOP_OF_PAGE .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
  EXPORTING
    IT_LIST_COMMENTARY       = T_LISTHEADER
  I_LOGO                   =
  I_END_OF_LIST_GRID       =
REFRESH T_LISTHEADER.
ENDFORM.                    " SUB_TOP_OF_PAGE
*&      Form  SUB_WRITE_HEADER
      text
-->  p1        text
<--  p2        text
FORM SUB_WRITE_HEADER .
W_LISTHEADER-TYP  = 'H'.
W_LISTHEADER-INFO = 'PLANT WISE DATA DISPLAYED'.
APPEND W_LISTHEADER TO T_LISTHEADER.
ENDFORM.                    " SUB_WRITE_HEADER
*&      Form  SUB_SET_PF_STATUS
      text
-->  p1        text
<--  p2        text
FORM PF_STATUS_SET USING
                        RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS  'ZSTATUS1'.
ENDFORM.                    " SUB_SET_PF_STATUS
If any mistake  where i am wrong sorry for that.

You create one subroutine for END-OF-PAGE. Call this in the FM,
REUSE_ALV_EVENTS_GET.
Example:
Data:       i_event       TYPE slis_t_event.
*&      Form  f_build_eventtab
      text
FORM f_build_eventtab  USING   ps_event TYPE slis_t_event.
  DATA: wa_event TYPE slis_alv_event.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type = 0
    IMPORTING
      et_events   = ps_event.
   READ TABLE ps_event WITH KEY name = slis_ev_end_of_page INTO wa_event.
  IF sy-subrc EQ c_0.
    MOVE slis_ev_end_of_page TO wa_event-form.
    APPEND wa_event TO ps_event.
  ENDIF.
ENDFORM.                    " f_build_eventtab
*&      Form  END OF PAGE                                             *
*& To display the footer details                                *
FORM end_of_page .      
Write the footer details
ENDFORM.                    "END_OF_PAGE
I hope this will be useful for you.
Regards,
Joan

Similar Messages

  • Display Currency symbol with value in ALV Report

    Hi Experts,
    I need to display currency symbol with value in ALV Report like if currency type is dollar then $200.
    Here I am using field catalog type slis_t_fieldcat_alv and suing field merge catalog FM: 'REUSE_ALV_FIELDCATALOG_MERGE'
    I tried like this
        IF <fs_fieldcat>-fieldname = 'STPRS'.
          <fs_fieldcat>-seltext_s = 'Std Cost '.
          <fs_fieldcat>-seltext_m = 'Std Cost'.
          <fs_fieldcat>-seltext_l = 'Std Cost '
           <fs_fieldcat>-tabname = 'MBEW'.
          <fs_fieldcat>-ctabname = 'T001'.
          <fs_fieldcat>-cfieldname ='WAERS'.
          <fs_fieldcat>-datatype = 'CURR'.
        ENDIF.
    Please any one can suggest the solution for this.
    Advance Thanks.
    Regards,
    Bala Achari

    Hİ,
    Check this link.
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=24379571
    Take care.
    Çağatay

  • Help me, I have a problem with font when export report to PDF?

    Hi everyone! Help me
    I have a problem with font when export report to PDF
    My report uses template .rtf with font Times New Roman (Unicode), language is VietNamese.
    when desige template no problem, error only happen when view report by PDF.
    Edited by: user10236405 on Oct 15, 2008 11:23 PM

    give it time to boot. the time depends on yr memory size n data. soon a process bar will appear indicating the boot process. if still this doesnt work. try formating the phone. but this ways u lose all data on the phone (unless u backed it). relax! the data on the memory card is safe.

  • Problem while downloading a ALV report to excel

    Hi experts,
    I have an ALV report which took long time to extract records from various table. So while there is some restriction the report can be executed well in foreground. And the report can be extracted well to excel sheet. But while there is hudge records, i have to execute the report in backgroung. And then from spool i generally prefers to download the report to excel.
    There is a field UOM where it contains value ' " ' for some records. And also there may be possiblity that other fields can also contain the same.
    Now my problem is: while download to excel... When ever there is a value ' " ' from this point to the next value ' " '. It is treating as one record. and keep that in a same position in the excel sheet.
    But i want to keep all the values in there respective fields. Can you please how can i do that? Please give me some solution...
    regards,
    charles.

    If anybody have any solution please send me....

  • Problem with Localization of Crystal Reports

    Post Author: raj20007
    CA Forum: Crystal Reports
    Hi everyone..I am having a problem with crystal Reports. I need Malayalam unicode( INDIAN Language) to be displayed in the reports, this data will be binded from database.And the problem is : After applying this unicode font to the labels of my reports, some labels in the reports are going invisible.Also, previously  if I increase the font size beyond 22, I used to get "A Generic error occured in GDI+".  But after changing the textformat property of the field to "crRtfText" from "crstandardText" , I could resolve this Generic Error.
    And, I could also observe that the last char of the fields in the "details" section is repeating.This is the code I am using to apply local font to the labels.
    Private Sub assignfont()
      Dim Mfont As New Font("kartika", 20, FontStyle.Regular,GraphicsUnit.Document)
      CType(Report.Section8.ReportObjects("Field45"), CrystalDecisions.CrystalReports.Engine.FieldObject).ApplyFont(Mfont)
       CType(Report.Section8.ReportObjects("Field48"), CrystalDecisions.CrystalReports.Engine.FieldObject).ApplyFont(Mfont)
      End SubAnd I am calling this function in the form load event of that report.Any suggestion on this is greatly appreciated........Thanks in advance..

    Thanks for replying.
    Yes I am trying to move the 15mb of template files which are located in the Users Profile to a different location. I have modified the key in the Registry which defines this location: HKEY_CURRENT_USER\Software
    Business Objects\Suite 12.0\Crystal Reports\ChartSupportPath=My Defined Location
    I have done this prior to installtion and prepulated the registry and the templates in my defined location, but the installation over looks this and writes over the reg key. Even after modifying the reg key post installation, the application writes over this key and ignores what's in there. Does this mean that the Install.EXE is hard coded to always over write that location, and therefore the crw32.exe is hard coded to look in the User's Profile for the templates, and if they are not there it will create a copy for the User specific??
    Thanks

  • Problem when dowloading the ALV report output to Excel Sheet.

    Hi ,
    I am dowloading the ALV report output to Excel Sheet.
    There is field Condition Unit(KOMP-KMEIN) in the output of the ALV, this has values PC and CSE , but when I download to Excel Sheet, CSE is appearing as CSE ,but PC is appearing as ******.
    Can you please help me in knowing the reson for this.
    Regards,
    Madhu.

    hi
    refer to following link
    http://www.****************/Tutorials/ALV/ColorSALV/Demo.htm
    http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm
    Cheers
    Snehi
    Edited by: snehi chouhan on Jul 11, 2008 12:42 PM

  • Problem with Inventory stock audit Report in other currency

    Hi I have a problem with Inventory stock audit, the SBO show me the report in local currency, and I have to obtain that report in other currency, I was working with OINM table, but I don't know how obtain the report

    Alberto,
    Other currency information is available at the document row level and in the Journal Entries.
    What you could do is join the OINM with the associated document and let the foriegn currency value.
    OINM.TransType = ObjType (marketing document)
    OINM.BASE_REF .......Document Ref
    OINM.DocLineNum ......LineNum
    Suda

  • Pdf problem with Preview - how to report to Apple?

    Hi,
    I have been having problems with certain PDFs and Preview. The PDFs in question are scientific papers obtained via JSTOR (they manage the supply of papers from a range of Journals). In Preview many JSTOR papers display very slowly - so slowly that scrolling through the document is not practical. In Acrobat they are displayed normally, so this seems to be a Preview problem. There seem to be no settings in Preview that seem relevant to the problem, so how can I report this problem to Apple?
    all the best,
    Jeremy Harbinson

    Hi,
    So far as I can tell, I cannot attach a file to a posting to one of these discussion groups. A file which causes the problem can be found at
    http://www.jstor.org/stable/3066865
    Baroli, I and Niyogi, KK (2000). Molecular genetics of xanthophyll-dependent photoprotection in green algae and plants. Philosophical Transactions: Biological Sciences, 355;1385-94
    Note that the problem only seems to occur with JSTOR files: the same pdf - this time in an easily readable form, and minus the JSTOR header page - can be downloaded from the Royal Society website:
    http://journals.royalsociety.org/content/qpjabmqk0kxar5vb/
    all the best,
    Jeremy

  • ORARRP Problem with Oracle Forms and Reports 10g

    hi,
    i have a problem with orarrp utility. the printeroutput is sometimes mirrored or only a blank sheet. is this a known problem? are there any workaraounds available? what can i do to fix the problem? please help me.
    thanks very much
    gunnar kieck

    Hi Rajesh,
    But i have not installed IAS at all. I have only Forms and Reports 10g and Oracle database installed. As you said it only save on IAS, but can we save it on local machine. Is there any other alternative.
    Again my second issues is --> I want to remove Mail option and rename Cache option to PDF from Destype combo box which appears at run time.
    Any idea how we can do this?

  • Problem with Footer

    Hi ABAP Gurus,
                              I am having a problem with the footer. One of the entry is triggering in the first page but it is displaying in the second page. . But in the footer total that entry is getting calculated . Can you please suggest me what to do.
    Fruitful Answers will be rewarded
    Thanks & Warm Regards
    Nagaraj S

    Hi,
    Nagraj
    if u want footer in every page don't make u r footer any conditional.
    then it will print automatically in every page.
    if u want print u r footer after end of the main window. then make it as condition only at end of the main window...
    but the hierarchy of windows should be after main window u r footer should call.
    Then it will print only completion of main window or at end of line items.
    i was not clear with u r question.
    with Regards,
    Kiran.G

  • Problem with Unix version of Reports

    When I run the report(filenam.rep) off of
    my P.C., it works fine. Then when I transfer
    it over to Unix and run the report, I get
    some of the values in my report copied into
    places they don't belong. For instance,
    I have a value for the last row and last column in my report that gets copied to the
    first value in the last column of every page
    except for the first page. The proper value
    doesn't appear and it gets replaced by this
    value instead. I am running Reports 2.5 on
    both my P.C. as well as Unix. My P.C. is
    an NT 4.0 workstation. My command line on Unix looks like this:
    r25runm report=${report} userid=reitprod/namrem batch=YES paramform=NO \
    buffers=1000 destype=file desname=${TEMP}.lis \
    ${PARAMETER_STRING}
    I also have Designer 6.0 installed on my P.C.
    I recently installed a patch to fix a problem
    with formatting in Reports 6.0. I am wondering whether the patch might have something to do with incompatibility between
    Reports 2.5 on my P.C. and Reports 2.5 on
    the Unix system.
    null

    Hello,
    We need more information in order to help. How are you requesting the report (command line, URL, ?). What file is it asking for?
    Regards,
    The Oracle Reports Team --skw
    null

  • Heading with parameter in ALV report

    hi
    i want to add heading to my ALV report which i created using factory method.
    in my code i wrote:
    data:gr_display type ref to cl_salv_display_settings.
    gr_display = gr_table->get_display_settings(  ).
    gr_display ->set_striped_pattern( cl_salv_display_settings=>true).
    gr_display->set_list_header( 'this alv report has' X <-- here i want to add variable)
    how can i add variable ( which is global variable ) insted of the X ??
    thanks

    hi,
    use this.
    DATA:
       gd_headr type char100.
    concatenate 'this alv report has' <variable>
      into gd_headr separated by space.
    gr_display->set_list_header( gd_headr ).
    regards,
    Peter

  • Problem with PF_STATUS in ALV

    Hi
    I have the following code written in my report to set PF_STATUS in ALV.But its not working
    call function 'REUSE_ALV_GRID_DISPLAY'
         exporting
              i_callback_program = g_repid
              i_callback_pf_status_set = 'PF_STATUS_SET'
             I_CALLBACK_USER_COMMAND =  ''
             i_structure_name = 'I_BOLACT'
             i_grid_title = 'BOL Action Report'(031)
             is_layout = gs_layout
              i_save             = 'A'
              it_fieldcat        = gt_fieldcat[]
    FORM PF_STATUS_SET USING rt_extab TYPE slis_t_extab.
    set PF-STATUS 'ZPF_STAT'.
    ENDFORM.
    Please help where am I going wrong.
    Regards
    Ishita

    If any of the above solution in not working, you can use EVENTS to handle it.
    using
    * TO Get all the ALV Events
      call function 'REUSE_ALV_EVENTS_GET'
        exporting
          i_list_type     = 0
        importing
          et_events       = it_events
        exceptions
          list_type_wrong = 1
          others          = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    * FOR THE PF-STATUS EVENT
      read table it_events into wa_event with key name = slis_ev_pf_status_set.
      if sy-subrc eq 0.
        wa_event-form = 'PF_STATUS_SET'.
        modify it_events from wa_event
                         transporting form
                         where name = wa_event-name.
      endif.
    and then set your PF Status in Form 'PF_STATUS_SET'
    hope this solves your problem.
    Jinson.

  • Problem with footer in table style not applying paragraph style... or just me?

    I'm having a niggling problem making a table style with cell/paragraph styles for the header, body, and footer respectively. I want to make it as simple as possible for other users but one thing keeps tripping me up. I'll try and describe with screenshots. I'm using InDesign CS5 on Windows 7.
    I have a table style set up with cell styles for the header, body, and footer, and paragraph styles for each as well. Say I'm converting a list of generic text to this table:
    i convert it to my table style. The body style is a numbered list:
    I convert the header to an, err, Header. The cell applies the header paragraph style as I should expect:
    I convert the footer likewise, but it maintains the Body text paragraph style as an override!
    So naturally I clear the override and it works fine. But of course, I'd rather it acted like the header row. I can't work out where the override on the footer comes from and why it operates differently in this respect to the header row. There is nothing different about how the styles are constructed. Have I made a mistake somewhere, or is this correct behaviour I'm misinterpreting, or something...?
    edit: Here is the file, if that will help:
    https://www.dropbox.com/s/4kzgui1itaskuvz/strip%20list%20test.indd

    Hi,
    I was able to reproduce the issue you are facing.
    I will be logging a bug for this and it would be investigated.
    Thanks a lot for reporting the problem!!
    Javed

  • Problem with sub totals ALV Grid

    Hi experts,
       I got one requirement, I am using ALV GRID function modules technique. My requirement is, I want to display one value at subtotal line(i.e. like header value). How to display the table values in the subtotal line.
    Please give any solution for this.
    Thanks in advance.
    Sandya.

    Hi Sandhya,
                       i will send a sample code for ur problem.And also i will send a entire program about subtotals.Check it once ok..Copy the below prog and execute it and debug it..
    *SubTotal on the Field NETWR
        wa_fieldcat-tabname       = 'IT_SALESORDER'. "Internal
      wa_fieldcat-fieldname     = 'NETWR'.         "Field Name
      wa_fieldcat-do_sum        = 'X'.             "Sum
       APPEND wa_fieldcat TO gt_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
        i_callback_program                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
        it_fieldcat                       = gt_fieldcat
    SAMPLE PROGRAM:
    *& Report  YSALESORDER_ALV_SUBTOTALS                                   *
    *& DEVELOPER  : KIRAN KUMAR.G                                          *
    *& PURPOSE    : DISPLAYING SUBTOTALS FOR A PARTICULAR SALES DOC NO     *
    *& CREATION DT: 26/11/2007                                             *
    *&  REQUEST   : ERPK900035                                             *
    REPORT  ysalesorder_alv_subtotals.
    Type Pools
    TYPE-POOLS:slis.
    Tables
    TABLES: vbak,  "Sales Document: Header Data
            vbap.  "Sales Document: Item Data
    Global Structures
    DATA:gt_fieldcat TYPE slis_t_fieldcat_alv,
         wa_fieldcat TYPE slis_fieldcat_alv,
         gt_sortcat TYPE slis_t_sortinfo_alv,
         wa_sortcat  LIKE LINE OF gt_sortcat.
    Internal Table
    DATA: BEGIN OF gt_salesorder OCCURS 0,
            vbeln LIKE vbak-vbeln,    " Sales Document Number
            posnr LIKE vbap-posnr,    " Sales Doc Item
            netwr LIKE vbap-netwr,    " Net Value
          END OF gt_salesorder.
    SELECT OPTIONS
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.   " Sales Document Number.
    SELECTION-SCREEN END OF BLOCK b1.
    Initialization
    INITIALIZATION.
      PERFORM initialization.
    Start Of Selection
    START-OF-SELECTION.
      PERFORM field_catalog.   "For Structure Creation
      PERFORM fetch_data.      "Get the Data From DB Table
      PERFORM sorting USING gt_sortcat.
    End Of Selection
    END-OF-SELECTION.
      PERFORM display_data.
    *&      Form  initialization
          text
    -->  p1        text
    <--  p2        text
    FORM initialization .
      s_vbeln-sign   = 'I'.
      s_vbeln-option = 'BT'.
      s_vbeln-low    = '4969'.
      s_vbeln-high   = '5000'.
      APPEND s_vbeln.
    ENDFORM.                    " initialization
    *&      Form  field_catalog
          text
    -->  p1        text
    <--  p2        text
    FORM field_catalog .
      REFRESH : gt_fieldcat.
      CLEAR   : wa_fieldcat.
      wa_fieldcat-col_pos       = '1'.             "Column Position
      wa_fieldcat-tabname       = 'IT_SALESORDER'. "Internal Table
      wa_fieldcat-fieldname     = 'VBELN'.         "Field Name
      wa_fieldcat-key           = 'X'.             "Blue Color
      wa_fieldcat-seltext_m     = 'Sales Doc No'.  "Display Text In Screen
      APPEND wa_fieldcat TO gt_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos       = '2'.             "Column Position
      wa_fieldcat-tabname       = 'IT_SALESORDER'. "Internal Table Name
      wa_fieldcat-fieldname     = 'POSNR'.         "Field Name
      wa_fieldcat-seltext_m     = 'Sales Doc Item'."Display Text In Screen
      APPEND wa_fieldcat TO gt_fieldcat.
      CLEAR wa_fieldcat.
    *SubTotal on the Field NETWR
      wa_fieldcat-col_pos       = '3'.             "Column Position
      wa_fieldcat-tabname       = 'IT_SALESORDER'. "Internal Table
      wa_fieldcat-fieldname     = 'NETWR'.         "Field Name
      wa_fieldcat-do_sum        = 'X'.             "Sum
      wa_fieldcat-seltext_m     = 'Net Value'.     "Display Text In Screen
      APPEND wa_fieldcat TO gt_fieldcat.
      CLEAR wa_fieldcat.
    ENDFORM.                    " field_catalog
    *&      Form  sorting
          text
         -->P_IT_SORTCAT  text
    FORM sorting USING p_it_sortcat TYPE slis_t_sortinfo_alv.
      CLEAR wa_sortcat.
      wa_sortcat-fieldname = 'VBELN'.
      wa_sortcat-up        ='X'.
      wa_sortcat-subtot    = 'X'.
      APPEND wa_sortcat TO p_it_sortcat.
    ENDFORM.                    " sorting
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
        i_callback_program                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
        it_fieldcat                       = gt_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
        it_sort                           = gt_sortcat
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
        t_outtab                          = gt_salesorder
       EXCEPTIONS
        program_error                     = 1
        OTHERS                            = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " display_data
    *&      Form  fetch_data
          text
    -->  p1        text
    <--  p2        text
    FORM fetch_data .
      REFRESH : gt_salesorder.
      CLEAR   : gt_salesorder.
      SELECT a~vbeln
             posnr
             b~netwr
        FROM vbak AS a
       INNER JOIN vbap AS b ON  avbeln = bvbeln
        INTO TABLE gt_salesorder
        WHERE a~vbeln IN s_vbeln.
    ENDFORM.                    " fetch_data
    Reward points if helpful.
    Kiran Kumar.G.A
            Have a Nice Day..

Maybe you are looking for

  • How to send a picture in pdf file when it is in jpeg file

    how do I send an attachment in PDF file when it is now in jpeg file. I want to send this attachment in an email.

  • HT1329 How do I convert an AAC music file to mp3?

    Hi: I have several albums on my new computer (G5 desktop running OS10.58) iTunes 9--that are in AAC format. When I try to burn these albums, the prompt tells me I can't burn them in mp3 unless they come to the burning in the mp3. I didn't realize the

  • Apple ID is not working in mac app store

    When I try to sign in and/or buy at the Mac App Store on my Mac desktop, I get an "An Unknown Error Has Occured" every time (after restarts, password reset, etc).  My Apple ID works on my iPhone, iPad, iTunes, here on Apple Communities, and I can see

  • HP Envy 4500 printing issue

    I am unable to print to my HP ENVY 4500 with a wireless connection. I have had it set up and working since Christmas, it says it is connected to my home network with excellent signal strenght and both laptop and desktop recognize it. Jobs go to the p

  • My New Mac 3.0 Quad Seems Kind Of Slow

    Hi Everyone, I've just upgraded from my Mac G5 Dual 2.7 (which I loved) to a new MacPro 3.0 Quad. I'm not finding that the newer machine is any faster (although I have not tested it yet). In fact, Ive even gotten an Audio Engine Dropout error when ru