ABAP list display doubt

Hi ABAP guru's,
        I have a new requirement , in report i have Two internal tables populated with data . when iam executing program. data  in the first internal table should be displayed ( suppose 1st internal table  has 10 records). In the output list screen i kept one button in toolbar . buy pressing that i need second internal table should be displayed from next line. that is second internal table should be displayed from (suppose )11th line of same list output.
       2nd internal table should not displayed immediatley after executing program. once i press button in toolbar. 2nd internal table should be displayed below the first internal table.
              please reply soon.
Points guaranteed. 
Thanks®ards,
Hemanth.

Hi atish ,
            Thanks for quick reply, but my requirement is not that, I should not go to secondary list , i have to display the 2nd internal table in the same list. below the the 1st internal table but after i push the button in menu.
                  I hope someone reply's the my query. points are gauranteed.
Thanks&regards,
Hemanth

Similar Messages

  • Adding Button on application toolbar on ABAP List display screen....

    Hello Gurus,
    I copied SAP program 'RFBUEB00' into custom program. When I execute the custom report, I see the data lijne by line in ABAP list. I see a deafult 'Select' button on application toolbar.
    If I want to add additional custom button on application toolbar on ABAP list display screen, how can I do it ? Please help.
    Regards,
    Jainam.
    Edited by: Jainam Shah on Oct 27, 2009 5:44 PM

    >
    Jainam Shah wrote:
    > In my case it just rights the data in ABAP screen as follows. I can't use ALV grid and stuff because its on older version.
    >
    >
    FORM LISTE_SCHREIBEN.
    >
    >   check = '@T9@'.
    >
    >   FORMAT COLOR COL_KEY INTENSIFIED OFF.
    >   WRITE: / SY-VLINE,
    >            check,
    >            BKPF-BUKRS,
    >            BKPF-BELNR,
    >            BKPF-GJAHR.
    >   FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    >   WRITE:   BKPF-BLART,
    >        (8) BKPF-BLDAT DD/MM/YY,
    >        (8) BKPF-BUDAT DD/MM/YY,
    >            BKPF-WAERS,
    >            BKPF-XBLNR,
    >         80 SY-VLINE.
    >   XAUSGABE = 'X'.
    >   HIDE: BKPF-BUKRS, BKPF-BELNR, BKPF-GJAHR, BKPF-BSTAT, XAUSGABE.
    >   IF BKPF-BKTXT NE SPACE.
    >     FORMAT COLOR COL_KEY INTENSIFIED OFF.
    >     WRITE: / SY-VLINE, CHAR4 UNDER BKPF-GJAHR.
    >     FORMAT COLOR COL_NORMAL INTENSIFIED.
    >     WRITE:   BKPF-BKTXT UNDER BKPF-BLART,
    >              80 SY-VLINE.
    >     HIDE: BKPF-BUKRS, BKPF-BELNR, BKPF-GJAHR, BKPF-BSTAT, XAUSGABE.
    >   ENDIF.
    > ENDFORM.
    >
    >
    > I have to select multiple lines and proces them. For one line I know I can use AT-LINE-SELECTION but this is multiple lines...
    What is your SAP system version?
    It seems to be displayed only in ALV. Well, if you can make it to display in LIST ... you can go with set pf-status.
    good luck

  • How to get the material list displayed in CU50 transaction into ABAP report

    How to get the 'KMAT" type material list displayed in CU50 transaction into ABAP report?
    I am getting the entire BOM when i am using the FM CS_BOM_EXPL_MAT_V2 in to the table in the report.
    But I want only the material list displayed in CU50.

    Hi,
    Could you please tell us how you found a solution to your problem?
    Thanks & regards
    Hassan

  • Reuse alv hierseq list display pgm doubt

    can anyone tell me s my coding s write or not becos in the report output i cannot view the line item details but it s gettign populated in the itab
    REPORT ZTEST_1.
    TABLES: KNB1,BSID.
    TYPE-POOLS: SLIS.
    *TYPES:BEGIN OF TYP_OUTPUT.
    INCLUDE STRUCTURE ZRFPOSXEXT.
    *TYPES:END OF TYP_OUTPUT.
    TYPES:BEGIN OF TYP_BSEG,
    bukrs like bsid-bukrs,
    kunnr like bsid-kunnr,
    zuonr like bsid-zuonr,
    belnr like bsid-belnr,
    bldat like bsid-bldat,
    xblnr like bsid-xblnr,
    blart like bsid-blart,
    dmbtr like bsid-dmbtr,
    aufnr like bsid-aufnr,
    vbel2 like bsid-vbel2,
    posn2 like bsid-posn2,
    END OF TYP_BSEG.
    TYPES:BEGIN OF TYP_VBRP,
    VBELN LIKE VBRP-VBELN,
    AUBEL LIKE VBRP-AUBEL,
    AUPOS LIKE VBRP-AUPOS,
    VKGRP LIKE VBRP-VKGRP,
    TDNAME LIKE STXH-TDNAME,
    TDLINE LIKE TLINE-TDLINE,
    END OF TYP_VBRP.
    data: wa_vbrp type typ_vbrp.
    DATA:
    *GT_HEADER_TABLE TYPE TYP_OUTPUT OCCURS 0 WITH HEADER LINE,
    GT_ITEM_TABLE TYPE TYP_VBRP OCCURS 0 WITH HEADER LINE.
    DATA: IT_BSEG TYPE TYP_BSEG OCCURS 0 WITH HEADER LINE.
    Define fieldcatalog
    DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    Callback program
    DATA: G_REPID LIKE SY-REPID.
    List layout description
    DATA: GS_LAYOUT TYPE SLIS_LAYOUT_ALV.
    Group order criterium
    DATA: GS_KEYINFO TYPE SLIS_KEYINFO_ALV.
    Layout *
    Definition for field choice screen **
    GS_LAYOUT-HEADER_TEXT = 'HEADER'.
    GS_LAYOUT-ITEM_TEXT = 'ITEM'.
    GS_LAYOUT-DEFAULT_ITEM = 'X'.
    Initialization fieldcatalog ***
    G_REPID = SY-REPID.
    PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].
    Data selection ***
    PERFORM SELECT_DATA.
    Define keyinfo as sort group definition ***
    CLEAR GS_KEYINFO.
    GS_KEYINFO-HEADER01 = 'BELNR'. "idenify header and item
    GS_KEYINFO-ITEM01 = 'VBELN'.
    Call function to list display (hier-seq) ***
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = G_REPID
    IS_LAYOUT = GS_LAYOUT
    IT_FIELDCAT = GT_FIELDCAT[]
    I_TABNAME_HEADER = 'GT_HEADER_TABLE'
    I_TABNAME_HEADER = 'IT_BSEG'
    I_TABNAME_ITEM = 'GT_ITEM_TABLE'
    I_STRUCTURE_NAME_HEADER = <STRUCTURE_NAME_HEADER>
    I_STRUCTURE_NAME_ITEM = <STRUCTURE_NAME_ITEM>
    IS_KEYINFO = GS_KEYINFO
    TABLES
    T_OUTTAB_HEADER = GT_HEADER_TABLE
    T_OUTTAB_HEADER = IT_BSEG
    T_OUTTAB_ITEM = GT_ITEM_TABLE
    EXCEPTIONS
    PROGRAM_ERROR = 1.
    FORMS ***
    FORM FIELDCAT_INIT USING RT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    Deviations of group fields to be merged *
    Initialize group field(s) of header table **
    CLEAR LS_FIELDCAT.
    ls_fieldcat-col_pos = 1.
    LS_FIELDCAT-TABNAME = 'IT_BSEG'.
    LS_FIELDCAT-FIELDNAME = 'BLART'.
    LS_FIELDCAT-KEY = 'X'. " sets key field
    LS_FIELDCAT-SELTEXT_M = 'DOC TYPE'.
    LS_FIELDCAT-OUTPUTLEN = 2.
    APPEND LS_FIELDCAT TO gt_fieldcat.
    CLEAR LS_FIELDCAT.
    ls_fieldcat-col_pos = 2.
    LS_FIELDCAT-TABNAME = 'IT_BSEG'.
    LS_FIELDCAT-FIELDNAME = 'BLDAT'.
    LS_FIELDCAT-KEY = 'X'. " sets key field
    LS_FIELDCAT-SELTEXT_M = 'DOC DATE'.
    LS_FIELDCAT-OUTPUTLEN = 8.
    APPEND LS_FIELDCAT TO gt_fieldcat.
    CLEAR LS_FIELDCAT.
    ls_fieldcat-col_pos = 3.
    LS_FIELDCAT-TABNAME = 'IT_BSEG'.
    LS_FIELDCAT-FIELDNAME = 'BELNR'.
    LS_FIELDCAT-KEY = 'X'. " sets key field
    LS_FIELDCAT-SELTEXT_M = 'ACC DOC NO'.
    LS_FIELDCAT-OUTPUTLEN = 10.
    APPEND LS_FIELDCAT TO gt_fieldcat.
    CLEAR LS_FIELDCAT.
    ls_fieldcat-col_pos = 4.
    LS_FIELDCAT-TABNAME = 'IT_BSEG'.
    LS_FIELDCAT-FIELDNAME = 'XBLNR'.
    LS_FIELDCAT-KEY = 'X'. " sets key field
    LS_FIELDCAT-SELTEXT_M = 'REFERENCE'.
    LS_FIELDCAT-OUTPUTLEN = 16.
    APPEND LS_FIELDCAT TO gt_fieldcat.
    CLEAR LS_FIELDCAT.
    ls_fieldcat-col_pos = 5.
    LS_FIELDCAT-TABNAME = 'IT_BSEG'.
    LS_FIELDCAT-FIELDNAME = 'ZUONR'.
    LS_FIELDCAT-KEY = 'X'. " sets key field
    LS_FIELDCAT-SELTEXT_M = 'ASSGNMENT NO'.
    LS_FIELDCAT-OUTPUTLEN = 19.
    APPEND LS_FIELDCAT TO gt_fieldcat.
    CLEAR LS_FIELDCAT.
    ls_fieldcat-col_pos = 6.
    LS_FIELDCAT-TABNAME = 'IT_BSEG'.
    LS_FIELDCAT-FIELDNAME = 'DMBTR'.
    LS_FIELDCAT-KEY = 'X'. " sets key field
    LS_FIELDCAT-SELTEXT_M = 'AMT N LOC CURR'.
    LS_FIELDCAT-OUTPUTLEN = 13.
    APPEND LS_FIELDCAT TO gt_fieldcat.
    Initialize keyfield(s) of item table **
    CLEAR LS_FIELDCAT.
    ls_fieldcat-col_pos = 7.
    LS_FIELDCAT-TABNAME = 'GT_ITEM_TABLE'.
    LS_FIELDCAT-FIELDNAME = 'AUPOS'.
    LS_FIELDCAT-TECH = 'X'. " sets technical field
    LS_FIELDCAT-SELTEXT_M = 'LINE ITEM'.
    LS_FIELDCAT-OUTPUTLEN = 6.
    APPEND LS_FIELDCAT TO gt_fieldcat.
    CLEAR LS_FIELDCAT.
    ls_fieldcat-col_pos = 8.
    LS_FIELDCAT-TABNAME = 'GT_ITEM_TABLE'.
    LS_FIELDCAT-FIELDNAME = 'TDLINE'.
    LS_FIELDCAT-TECH = 'X'. " sets technical field
    LS_FIELDCAT-SELTEXT_M = 'OI NOTES'.
    LS_FIELDCAT-OUTPUTLEN = 132.
    APPEND LS_FIELDCAT TO gt_fieldcat.
    Hidden field(s) of tables (header and/or item) **
    CLEAR LS_FIELDCAT.
    ls_fieldcat-tabname = '<header/item_table_name>'.
    LS_FIELDCAT-FIELDNAME = '<GROUP_FIELD_NAME>'.
    LS_FIELDCAT-NO_OUT = 'X'. "sets hidden field
    APPEND LS_FIELDCAT TO RT_FIELDCAT.
    ENDFORM. "fieldcat_init
    FORM SELECT_DATA.
    data: begin of wa_olino,
    tdname like stxh-tdname,
    tdline like tline-tdline,
    end of wa_olino.
    data: it_olino like wa_olino occurs 0 with header line.
    data: begin of wa_stxh,
    tdname like stxh-tdname,
    end of wa_stxh.
    data: it_stxh like wa_stxh occurs 0 with header line.
    data: begin of wa_lines.
    include structure ztline.
    data: end of wa_lines.
    data: IT_LINES LIKE wa_lines OCCURS 0 WITH HEADER LINE.
    select bukrs kunnr zuonr belnr bldat xblnr blart dmbtr aufnr vbel2
    posn2
    from bsid
    into table it_bseg
    where kunnr in so_wlkun
    and bukrs in so_wlbuk.
    select vbeln aubel aupos vkgrp
    from vbrp
    into table gt_item_table
    for all entries in it_bseg
    where vbeln = it_bseg-belnr.
    sort gt_item_table by aubel aupos.
    loop at gt_item_table into wa_vbrp.
    concatenate wa_vbrp-aubel wa_vbrp-aupos into wa_olino-tdname.
    wa_vbrp-tdname = wa_olino-tdname.
    modify gt_item_table from wa_vbrp.
    append wa_olino to it_olino.
    endloop.
    select tdname from stxh into corresponding fields of table it_stxh
    for all entries in it_olino
    where tdobject = 'VBBP'
    and tdname = it_olino-tdname
    and tdid = '0002'
    and tdspras = 'EN'.
    data: j type i,k_lines type i..
    sort it_stxh by tdname.
    *sort it_output by tdname.
    describe table GT_ITEM_TABLE lines k_lines.
    *loop at it_output into wa_output. "where blart = '1Z'.
    loop at gt_item_table into wa_vbrp.
    loop at it_stxh where tdname = wa_vbrp-tdname.
    read table it_stxh.
    CALL FUNCTION 'ZREAD_TEXT_1'
    EXPORTING
    CLIENT = SY-MANDT
    ID = '0002'
    LANGUAGE = SY-LANGU
    NAME = IT_STXH-tdname
    OBJECT = 'VBBP'
    ARCHIVE_HANDLE = 0
    LOCAL_CAT = ' '
    IMPORTING
    HEADER =
    TABLES
    LINES = IT_LINES
    EXCEPTIONS
    ID = 1
    LANGUAGE = 2
    NAME = 3
    NOT_FOUND = 4
    OBJECT = 5
    REFERENCE_CHECK = 6
    WRONG_ACCESS_TO_ARCHIVE = 7
    OTHERS = 8
    *data: I type i.
    if sy-subrc = 0.
    loop at it_lines.
    it_lines-tdname = wa_vbrp-tdname.
    modify it_lines. "from wa_lines.
    endloop.
    loop at it_lines.
    *i = sy-tfill.
    wa_vbrp-tdline = it_lines.
    if sy-tabix = 1.
    modify gt_item_table from wa_vbrp.
    else.
    append wa_vbrp to gt_item_table.
    endif.
    clear it_lines-tdline.
    endloop.
    endif.
    endloop.
    if sy-tabix = k_lines.
    exit.
    endif.
    endloop.
    sort it_olino by tdname.
    ENDFORM. " select_data

    Hi,
    Go thru the following Example program. It can solve ur problem..
    *& Report         : ZASSG_ALV_JAYARAM3
    *& Title          : Hierarchical sequential ALV report
    *& Author         :
    *& Created on     : *& Request        :
    *& Desription     : Generates a Hierarchial sequental ALV report to list
                      out Billing details.
    *&                     Modification Log
    *& Mod #    Author               Date         Requested by
    *&       Reason for Change
    *& 00 #
    REPORT ZASSG_ALV_JAYARAM3 NO STANDARD PAGE HEADING
                                         LINE-SIZE 132
                                         LINE-COUNT 64
                                        MESSAGE-ID Z00.
    *..Type Definitions for ALV Report
    TYPE-POOLS SLIS.
    Table/Structure declarations.                                        *
    TABLES : VBRK,   " Billing: Header Data
             VBRP,   " Billing: Item Data
             T001,   " Comapny Codes
             TVKOT,  " Sales Organizations: Texts
             MAKT.   " Material Descriiptions
    *.. Internal Tables declaration                                        *
    *----- Internal table to store billing docs which are not cancelled
    DATA : BEGIN OF IT_VBRK OCCURS 0,
             VBELN LIKE VBRK-VBELN,    " Billing document
             WAERK LIKE VBRK-WAERK,    " SD document currency
             VKORG LIKE VBRK-VKORG,    " Sales organization
             VTEXT LIKE TVKOT-VTEXT,   " Sales organization text
             FKDAT LIKE VBRK-FKDAT,    " Billing date
             BUKRS LIKE VBRK-BUKRS,    " Company Code
             BUTXT LIKE T001-BUTXT,    " Company Code text
             NETWR LIKE VBRK-NETWR,    " Net value in document currency
           END OF IT_VBRK.
    *-----Internal table to stroe ITEM DETAILS
    DATA: BEGIN OF IT_VBRP OCCURS 0,
           VBELN2 LIKE VBRP-VBELN,     " Billing document
            POSNR LIKE VBRP-POSNR,     " Billing item
            FKIMG LIKE VBRP-FKIMG,     " Actual billed quantity
            VRKME LIKE VBRP-VRKME,     " Sales unit
            NETWR LIKE VBRP-NETWR,     " Net value of the billing item
            MATNR LIKE VBRP-MATNR,     " Material number
            ARKTX LIKE VBRP-ARKTX,     " Short text for sales order item
    END OF IT_VBRP.
                       Variable / Flag Declerations                      *
    DATA : FG_COLOR    VALUE ' ',  " FLAG TO CHANGE THE COLOR OF THE RECORD
           FG_NO_DATA  VALUE ' '.  " FLAG TO CHECK THE DATA
    DATA : V_REPID   TYPE SYREPID.
                         ALV Type declaration                            *
    DATA : IT_FIELDCAT TYPE STANDARD TABLE OF
                       SLIS_FIELDCAT_ALV  WITH HEADER LINE.
    DATA : IT_SORT TYPE SLIS_T_SORTINFO_ALV,
           WA_SORT TYPE SLIS_SORTINFO_ALV.
    DATA : IT_EVENT TYPE SLIS_T_EVENT,
           WA_EVENT LIKE LINE OF IT_EVENT.
    DATA : IT_HEADINGS TYPE STANDARD TABLE OF
                       SLIS_LISTHEADER WITH HEADER LINE.
    DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA : WA_KEYINFO TYPE SLIS_KEYINFO_ALV.
    Selection Screen.                                                    *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS :  S_VBELN FOR VBRK-VBELN,            " Billing doc no
                      S_FKDAT FOR VBRK-FKDAT OBLIGATORY, " Billing date
                      S_MATNR FOR VBRP-MATNR.            " Material no
    SELECTION-SCREEN END OF BLOCK B1.
    Event:Initialization                                                 *
    INITIALIZATION.
      V_REPID = SY-REPID.
      S_FKDAT-LOW  = SY-DATUM - 200.
      S_FKDAT-HIGH = SY-DATUM.
      APPEND S_FKDAT.
    AT Selection Screen.                                                 *
    AT SELECTION-SCREEN.
      PERFORM VALIDATE_VBELN.
      PERFORM VALIDATE_MATNR.
    Event: Start-of-Selection                                            *
    START-OF-SELECTION.
      PERFORM GET_VBRK_DATA.
      PERFORM GET_VBRP_DATA.
    Event: End-of-Selection                                            *
    END-OF-SELECTION.
      PERFORM GET_EVENTS.
      PERFORM FIELDCATALOG.
      PERFORM LIST_DISPLAY.
                             FORM DEFINITIONS                            *
    *&      Form  list_display
          text
    -->  p1        text
    <--  p2        text
    FORM LIST_DISPLAY.
      WA_LAYOUT-INFO_FIELDNAME = 'COLOR'.
      WA_LAYOUT-TOTALS_TEXT = 'GRAND TOTAL'.
      WA_LAYOUT-ZEBRA = 'X'.
      WA_LAYOUT-KEY_HOTSPOT = 'X'.
      WA_KEYINFO-HEADER01 = 'VBELN'.
      WA_KEYINFO-ITEM01 = 'VBELN2'.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
       I_INTERFACE_CHECK              = ' '
          I_CALLBACK_PROGRAM             = V_REPID
       I_CALLBACK_PF_STATUS_SET       = ' '
       I_CALLBACK_USER_COMMAND        = ' '
          IS_LAYOUT                      = WA_LAYOUT
          IT_FIELDCAT                    = IT_FIELDCAT[]
       IT_EXCLUDING                   =
       IT_SPECIAL_GROUPS              =
          IT_SORT                        = IT_SORT
       IT_FILTER                      =
       IS_SEL_HIDE                    =
       I_SCREEN_START_COLUMN          = 0
       I_SCREEN_START_LINE            = 0
       I_SCREEN_END_COLUMN            = 0
       I_SCREEN_END_LINE              = 0
       I_DEFAULT                      = 'X'
       I_SAVE                         = ' '
       IS_VARIANT                     =
       IT_EVENTS                      =
       IT_EVENT_EXIT                  =
          I_TABNAME_HEADER              = 'IT_VBRK'
          I_TABNAME_ITEM                = 'IT_VBRP'
       I_STRUCTURE_NAME_HEADER        =
       I_STRUCTURE_NAME_ITEM          =
          IS_KEYINFO                    = WA_KEYINFO
       IS_PRINT                       =
       IS_REPREP_ID                   =
       I_BUFFER_ACTIVE                =
       I_BYPASSING_BUFFER             =
    IMPORTING
       E_EXIT_CAUSED_BY_CALLER        =
       ES_EXIT_CAUSED_BY_USER         =
        TABLES
          T_OUTTAB_HEADER               = IT_VBRK
          T_OUTTAB_ITEM                 = IT_VBRP
    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.                    " list_display
    *&      Form  fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCATALOG.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
          I_PROGRAM_NAME             = V_REPID
          I_INTERNAL_TABNAME         = 'IT_VBRK'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
          I_INCLNAME                 = V_REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                = IT_FIELDCAT[]
       EXCEPTIONS
         INCONSISTENT_INTERFACE      = 1
         PROGRAM_ERROR               = 2
         OTHERS                      = 3
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *..Changing the fieldcatlog as required
      LOOP AT IT_FIELDCAT.
        CASE IT_FIELDCAT-FIELDNAME.
          WHEN 'VBELN'.
            IT_FIELDCAT-SELTEXT_L = 'Billing doc no'.
            IT_FIELDCAT-SELTEXT_M = 'Bill No'.
            IT_FIELDCAT-SELTEXT_S = 'Bill'.
            IT_FIELDCAT-OUTPUTLEN = '15'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                            OUTPUTLEN
                                      WHERE FIELDNAME = 'VBELN'.
          WHEN 'WAERK'.
            IT_FIELDCAT-SELTEXT_L = 'SD document Currency'.
            IT_FIELDCAT-SELTEXT_M = 'Document Currency'.
            IT_FIELDCAT-SELTEXT_S = 'Currency'.
            IT_FIELDCAT-OUTPUTLEN = '15'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                      WHERE FIELDNAME = 'WAERK'.
          WHEN 'VKORG'.
            IT_FIELDCAT-SELTEXT_L = 'Sales Organisation'.
            IT_FIELDCAT-SELTEXT_M = 'Sales Org'.
            IT_FIELDCAT-SELTEXT_S = 'S,Org'.
            IT_FIELDCAT-OUTPUTLEN = '15'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                      WHERE FIELDNAME = 'VKORG'.
          WHEN 'VTEXT'.
            IT_FIELDCAT-SELTEXT_L = 'Sales Organisation Name'.
            IT_FIELDCAT-SELTEXT_M = 'Sales Org Text'.
            IT_FIELDCAT-SELTEXT_S = 'S,Org'.
            IT_FIELDCAT-OUTPUTLEN = '30'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                      WHERE FIELDNAME = 'VTEXT'.
          WHEN 'FKDAT'.
            IT_FIELDCAT-SELTEXT_L = 'Billing Date'.
            IT_FIELDCAT-SELTEXT_M = 'Bill.Date'.
            IT_FIELDCAT-SELTEXT_S = 'BDate'.
            IT_FIELDCAT-OUTPUTLEN = '15'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                      WHERE FIELDNAME = 'FKDAT'.
          WHEN 'BUKRS'.
            IT_FIELDCAT-SELTEXT_L = 'Company Code'.
            IT_FIELDCAT-SELTEXT_M = 'Company'.
            IT_FIELDCAT-SELTEXT_S = 'Comp'.
            IT_FIELDCAT-OUTPUTLEN = '15'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                      WHERE FIELDNAME = 'BUKRS'.
          WHEN 'BUTXT'.
            IT_FIELDCAT-SELTEXT_L = 'Company Name'.
            IT_FIELDCAT-SELTEXT_M = 'Comp Text'.
            IT_FIELDCAT-SELTEXT_S = 'Comp'.
            IT_FIELDCAT-OUTPUTLEN = '25'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                      WHERE FIELDNAME = 'BUTXT'.
          WHEN 'NETWR'.
            IT_FIELDCAT-SELTEXT_L = 'Net value in docu currency'.
            IT_FIELDCAT-SELTEXT_M = 'Net value in currency'.
            IT_FIELDCAT-SELTEXT_S = 'Net Value'.
            IT_FIELDCAT-OUTPUTLEN = '20'.
            IT_FIELDCAT-DO_SUM    = 'X'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                            DO_SUM
                                      WHERE FIELDNAME = 'NETWR'.
        ENDCASE.
      ENDLOOP.
      PERFORM FIELDCAT_SECLIST.
    ENDFORM.                    " fieldcatalog
    *&      Form  sort_tab
          text
    -->  p1        text
    <--  p2        text
    FORM SORT_TAB.
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'VBELN'.
      WA_SORT-SPOS = '1'.
      WA_SORT-UP = 'X'.
      WA_SORT-SUBTOT = 'X'.
      APPEND WA_SORT TO IT_SORT.
    ENDFORM.                    " sort_tab
    *&      Form  get_events
          text
    -->  p1        text
    <--  p2        text
    FORM GET_EVENTS.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE     = 1
           IMPORTING
                ET_EVENTS       = IT_EVENT
           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.
      READ TABLE IT_EVENT INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      WA_EVENT-FORM = 'DISPLAY_HEADER'.
      MODIFY IT_EVENT FROM WA_EVENT INDEX SY-TABIX.
    ENDFORM.                    " get_events
    *&      Form  DISPLAY_HEADER
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_HEADER.
      WRITE : /3   'Date : ',
               10  SY-DATUM USING EDIT MASK '__/__/____',
               35  'Intelligroup Asia Pvt. Ltd',
               80  'Time : ',
               90  SY-UZEIT,
              /3   'User : ',
               10  SY-UNAME,
               30  SY-TITLE,
               80  'Page  : ',
               90 SY-PAGNO.
    ENDFORM.                    " DISPLAY_HEADER
    *&      Form  VALIDATE_VBELN
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE_VBELN.
    Validating Billing doc no
      SELECT VBELN
        INTO VBRK-VBELN
       UP TO 1 ROWS
        FROM VBRK
       WHERE VBELN IN S_VBELN.
      ENDSELECT.
      IF SY-SUBRC NE 0.
        MESSAGE E010. " Invalid billing doc no
      ENDIF.
    ENDFORM.                    " VALIDATE_VBELN
    *&      Form  VALIDATE_MATNR
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE_MATNR.
    Validating material no
      SELECT MATNR
        INTO VBRP-MATNR
       UP TO 1 ROWS
        FROM VBRP
       WHERE MATNR IN S_MATNR.
      ENDSELECT.
      IF SY-SUBRC NE 0.
        MESSAGE E018.    " Invalid material number
      ENDIF.
    ENDFORM.                    " VALIDATE_MATNR
    *&      Form  GET_VBRK_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_VBRK_DATA.
    To get Billing doc detials based on selections
      SELECT V~VBELN
             V~WAERK
             V~VKORG
             V~FKDAT
             V~BUKRS
             V~NETWR
             T~VTEXT
             C~BUTXT
        INTO CORRESPONDING FIELDS OF TABLE IT_VBRK
        FROM VBRK AS V
       INNER JOIN VBRP AS P
          ON VVBELN = PVBELN
       INNER JOIN TVKOT AS T
          ON VVKORG = TVKORG
       INNER JOIN T001 AS C
          ON VBUKRS = CBUKRS
       WHERE V~VBELN IN S_VBELN
         AND V~FKDAT IN S_FKDAT
         AND P~MATNR IN S_MATNR.
      SORT IT_VBRK.
      DELETE ADJACENT DUPLICATES FROM IT_VBRK COMPARING VBELN.
      IF SY-SUBRC NE 0.
        FG_NO_DATA = 'X'.
      ENDIF.
    ENDFORM.                    " GET_VBRK_DATA
    *&      Form  GENERATE_SECLIST
          text
    -->  p1        text
    <--  p2        text
    FORM GENERATE_SECLIST USING R_UCOMM     LIKE SY-UCOMM
                                RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'. "DOUBLE CLICK
          READ TABLE IT_VBRK INDEX RS_SELFIELD-TABINDEX.
      ENDCASE.
    ENDFORM.                    " GENERATE_SECLIST
    *&      Form  FIELDCAT_SECLIST
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCAT_SECLIST.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
         EXPORTING
            I_PROGRAM_NAME           = V_REPID
            I_INTERNAL_TABNAME       = 'IT_VBRP'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
            I_INCLNAME               = V_REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
          CHANGING
            CT_FIELDCAT              = IT_FIELDCAT[]
         EXCEPTIONS
           INCONSISTENT_INTERFACE    = 1
           PROGRAM_ERROR             = 2
           OTHERS                    = 3
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *..Changing the fieldcatlog as required
      LOOP AT IT_FIELDCAT.
        CASE IT_FIELDCAT-FIELDNAME.
          WHEN 'VBELN2'.
             IT_FIELDCAT-NO_OUT = 'X'.
             IT_FIELDCAT-KEY = SPACE.
             MODIFY IT_FIELDCAT TRANSPORTING NO_OUT
                                             KEY
                                      WHERE FIELDNAME = 'VBELN2'.
          WHEN 'POSNR'.
            IT_FIELDCAT-SELTEXT_L = 'Billing Iem no'.
            IT_FIELDCAT-SELTEXT_M = 'Bill Item No'.
            IT_FIELDCAT-SELTEXT_S = 'Item No'.
            IT_FIELDCAT-OUTPUTLEN = '15'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                            OUTPUTLEN
                                      WHERE FIELDNAME = 'POSNR'.
          WHEN 'FKIMG'.
            IT_FIELDCAT-SELTEXT_L = 'Actual billed quantity'.
            IT_FIELDCAT-SELTEXT_M = 'Billed Quantity'.
            IT_FIELDCAT-SELTEXT_S = 'Bill.Qty'.
            IT_FIELDCAT-OUTPUTLEN = '15'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                      WHERE FIELDNAME = 'FKIMG'.
          WHEN 'VRKME'.
            IT_FIELDCAT-SELTEXT_L = 'Sales Unit'.
            IT_FIELDCAT-SELTEXT_M = 'Sale unit'.
            IT_FIELDCAT-SELTEXT_S = 'S.Unit'.
            IT_FIELDCAT-OUTPUTLEN = '15'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                      WHERE FIELDNAME = 'VRKME'.
          WHEN 'NETWR'.
            IT_FIELDCAT-SELTEXT_L = 'Net value in docu currency'.
            IT_FIELDCAT-SELTEXT_M = 'Net value in currency'.
            IT_FIELDCAT-SELTEXT_S = 'Net Value'.
            IT_FIELDCAT-OUTPUTLEN = '20'.
            IT_FIELDCAT-DO_SUM    = 'X'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                            DO_SUM
                                     WHERE FIELDNAME = 'NETWR'.
          WHEN 'MATNR'.
            IT_FIELDCAT-SELTEXT_L = 'Material Number'.
            IT_FIELDCAT-SELTEXT_M = 'Mat. Number'.
            IT_FIELDCAT-SELTEXT_S = 'Mat. No'.
            IT_FIELDCAT-OUTPUTLEN = '30'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                      WHERE FIELDNAME = 'MATNR'.
          WHEN 'ARKTX'.
            IT_FIELDCAT-SELTEXT_L = 'Text for sales order item'.
            IT_FIELDCAT-SELTEXT_M = 'Sale Order Text'.
            IT_FIELDCAT-SELTEXT_S = 'SO Item text'.
            IT_FIELDCAT-OUTPUTLEN = '30'.
            MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
                                            SELTEXT_M
                                            SELTEXT_S
                                      WHERE FIELDNAME = 'ARKTX'.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " FIELDCAT_SECLIST
    *&      Form  GET_VBRP_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_VBRP_DATA.
      SELECT VBELN
             POSNR
             FKIMG
             VRKME
             NETWR
             MATNR
             ARKTX
        INTO TABLE IT_VBRP
        FROM VBRP
         FOR ALL ENTRIES IN IT_VBRK
       WHERE VBELN EQ IT_VBRK-VBELN.
    ENDFORM.                    " GET_VBRP_DATA

  • Display in Abap List

    Hi Experts,
    I am facing an issue in priniting. Print Preview of form is coming in ABAP list format and there is no option to change in OTF format.
    Rahul

    Hi,
    Pl follow the below steps,
    1. If you print via access methods U/S and use SAPlpd, replace SAPlpd with SAPSprint (note 894444).
    2. If you print via access methods 'F', switch to access method 'G'.
    3. Download device type THSWINU that is attached to this note.
    4. Import the device type using report RSTXSCRP and assign it to package SPOO.
    5. Assign the device type to your output devices that formerly used THSAPWIN.
    Hope this helps,
    Thanks,
    Naga

  • ABAP list in Thai lang. is display properly after Unicode Conversion

    Recently at a customer site we converted our SAP ERP ECC6 to unicode from non-unicode,  Whenever there is some vowel in thai font at the beginning of the line , position of the line will shift right.
    1.  |  ุทรปราการ | aa |   >> abap list result
    2.  |  ุทรปราการ  | aa |  >> print result
    We have done as what SAP Note 947514 recommend but the issue is still not fixed.
    Please share any information you are having in this matter.
    Regards,

    Hi,
    Pl follow the below steps,
    1. If you print via access methods U/S and use SAPlpd, replace SAPlpd with SAPSprint (note 894444).
    2. If you print via access methods 'F', switch to access method 'G'.
    3. Download device type THSWINU that is attached to this note.
    4. Import the device type using report RSTXSCRP and assign it to package SPOO.
    5. Assign the device type to your output devices that formerly used THSAPWIN.
    Hope this helps,
    Thanks,
    Naga

  • While Changing ABAP List from Spool to PDF Whole List is not displaying

    Hi,
    There is Z Program to convert Payslip ABAP List to PDF, when it is generating in PDF from Spool, I cannot view whole Payslip.
    Previously it is dislpaying fully in PDF file, But not Now.
    Please Help me...............
    With Regards,
    Gaurav.

    Hi,
    Thank you very much. My problem has been solved
    Thanks & Regards,
    Gaurav Mittal

  • Query regarding SAP ABAP ALV List display

    Hi All,
    Have a requirement where in, when a user double clicks on a particular field as shown below, the particular cell where he has clicked has to be changed to editable and input mode. I am using ALV LIST DISPLAY.
    Please reply me if someone has worked on similar requirement.

    Hi Priya,
    Check this link: http://www.saptechnicl.com/Tutorials/ALV/Edit/demo.htm. I think this is exactly what you require.
    Hope this helps! Do let me know if you need anything else!!
    (rename "technicl" as "technical", my apologies for the typo).
    Cheers,
    Shailesh.

  • What is the  difference between list display and grid display in alv report

    Hai genious
    i am a new of the abap, i dont know the alv report, i have a small doubt, can u please tell me  what is the main difference between list display and grid display in alv report
    thanks&regards
    chinnu

    Hi ,
    1. For all practical purposes, they are the same.
    2. Some differences:
    a) from abap coding point of view,
    alv list is done with Function modules,
    alv gris can also be done with FM,
    but can also be done using OO concepts.
    b) Alv grid (using oo concept) requires
    designing the screen layout .
    Hence, in one screen, we can show more
    then one alv grid
    (we cannot show more than
    one alv list on one screen)
    c) ALV grid uses ActiveX controls
    present on the Presentation Server.
    Hence, it consumes More Memory
    on the presentation server.
    d) ALV LIST is Display Only.
    Whereas
    ALV Grid Can Be made EDITABLE for entry purpose.
    e) In alv grid, these options are possible,
    but not in alv list.
    without horizontal lines
    without vertical lines
    without cell merging during sorts
    display total lines above the entries
    I hope it helps.
    Regards,
    Mamta
    Edited by: Mamta Verma on Nov 27, 2008 6:41 AM

  • Header is not coming in alv list display- urgent

    hi all,
    i am sending my code below....
    my requirement is in selection screen i have 4 radio buttons . if i click 1 radio button it will duiisplay data and and its header. report is working fine. my requirement id when i click r_mssng radio button(missing radio button) it is showing data correctsly. here i want to show header as 'Missing details report'.
    this is not coming in my report. anybody can suggest me.
    i am sending my code below....
    report zvra0001ftb13  message-id zv.
                            Confidential and Proprietary               
    *                          Celestica Corporation               
    *                           All Rights Reserved
    *ABAP Name:            ZVRA0001FTB13               
    *Created by:            Srinivasa Chakravarthi                    
    *Created on:            26/03/2003                    
    *SAP Version:        4.6 C
    *Description:       This report  displays details of foreign trades
                      and EHS based on the deliveries made to the outside
                      countries.
    *Input:              Selection Screen Criteria includes country of
                       origin,Company code, Sales Organisation,
                       Ship-to-party, Sold-to-paarty, Goods movement date,
                       Invoice number, Invoice type, Material , Material
                       Type, Exporter ID, Province of origin.
    *Output:             ALV output that contains Mode of Transport, Export
                       HS number, Commodity Description, Quantity, UOM,
                       Value, Country of Destination, Goods Origin
    *Dependency:         Nil
    *Modification Log:                              
    *CR#    Date       Coded     Transport     Description
    *====== ======== ========= ============= ===============================
    *5147  26/03/2003 Srinivas   ED1K922286     New Development     
    *8700  02/11/2004 H.Arular   ED1K938380     To check if entries of Comm
                                              Code(HS code)is less than 8
                                             digits and give a warning
                                              message.
    *18684 25/07/2007 MAHEEDHAR                 Merge the logic from report
                                              ZVRA0001FTB13_ERROR into
                                              report ZVRA0001FTB13 and
                                              added two radio buttons
                                              called missing data and non
                                              missing data, addedc logic
                                              accoriding to the radio
                                              buttons.
    *Declaring Tables.
    tables: likp,                         "Delivery document Header
            lips,                         "Delivery Document Item
            vbfa,                         "Sales document Flow
            bkpf,                         "Accounting Document Header
            eikp,                         "Foreign Trade:Export/Import Data
            eipo,                         "Foreign Trade:Export/ Import
                                          "Header data
            t618t,                        "Forein Trade:Mode of Transport
                                          "Description
            t604t,                        "Foreign Trade: Commodity Code/
                                          "Import Code number Description.
            mara,                         "Material master data.
            t005,                         "Countries
            t001,                         "Company Codes
            tvko,                         "Sales Organisations
            kna1,                         "Customer Master
            t003,                         "Document types
            t134,                         "Material types
            tvfk,
            konv,
            vbrk.
    constants : c_rep like vbrk-fkart value 'YGFB',
                c_for(10) value 'Foreign'.
    *Decalre Type pool for ALV
    type-pools: slis.
    *Type declaration for LIKP.
    types: begin of t_data1,
            vbeln  like  likp-vbeln,        "Delivery
            kunnr  like  likp-kunnr,
           end of t_data1.
    *Type declaration for  LIPS,VBFA.
    types: begin of t_data2,
            vbeln  like  lips-vbeln,      "Delivery
            posnr  like  lips-posnr,      "Delivery Item
            vbelv  like  vbfa-vbelv,      "Preceding SD document
            posnv  like  vbfa-posnv,        "Preceding item of SD document
            matnr  like  lips-matnr,        "Material Number
            meins  like  lips-meins,        "Base unit of measure
            lfimg  like  lips-lfimg,        "Actual Quantity Delivered
            mtart  like mara-mtart,
          end of t_data2.
    **Type declaration for  BKPF.
    *types: begin of t_data3,
           belnr  like  bkpf-belnr,        "Accounting Documnet number
           bukrs  like  bkpf-bukrs,        "Company Code
          end of t_data3.
    *Type declaration for  BKPF.
    types: begin of t_data3,
            vbeln like vbrk-belnr,        " Billing Doc
            fkart like vbrk-fkart,
            land1 like vbrk-land1,
           end of t_data3.
    *Type declaration for  EIPO.
    types: begin of t_data4,
           vbeln like lips-vbeln,         "Delivery
           posnr like lips-posnr,         "Delivery Item
           matnr like vbrp-matnr,
           fkimg like vbrp-fkimg,
           meins like vbrp-meins,
           verld like eipo-verld,         "Country of dispatch for Foreign
                                          "trade
           herkl like eipo-herkl,         "Country of origin of material
           grwrt like eipo-grwrt,         "Statistical value for Foreign
                                          " trade
           stawn like eipo-stawn,         "Commodity code for foreign trade
           expvz like eikp-expvz,         "Mode of transport for foreign
                                          "trade
          end of t_data4.
    *Type declaration for  T618T.
    types: begin of t_data5,
           land1 like  t618t-land1,       "Country key
           expvz like  t618t-expvz,       "Mode of Transport
           bezei like  t618t-bezei,       "Description
           end of t_data5.
    *Type declaration for  T604T.
    types: begin of t_data6,
           land1 like  t604t-land1,       "Country key
           stawn like  t604t-stawn,       "Commodity Code
           text1 like  t604t-text1,       "Description
           end of t_data6.
    *Type declaration for  T604T.
    types: begin of t_mara,
            matnr like mara-matnr,
           end of t_mara.
    types : begin of rep_val,
             vbelv like vbfa-vbelv,
             posnv like vbfa-posnv,
             vbeln like vbfa-vbeln,
             posnn like vbfa-posnn,
             uepos like vbap-uepos,
             posnr like vbap-posnr,
             netwr like vbap-netwr,
            end of rep_val.
    types : begin of t_price,
              vbeln like vbak-vbeln,
              posnr like vbap-posnr,
              knumv like konv-knumv,
              kposn like konv-kposn,
              kbetr like konv-kbetr,
              kpein like konv-kpein,
            end of t_price.
    data : t_sord type rep_val occurs 0 with header line.
    data : t_dord type rep_val occurs 0 with header line.
    data : t_rord type rep_val occurs 0 with header line.
    data : t_hord type rep_val occurs 0 with header line.
    data : t_ford type rep_val occurs 0 with header line.
    data : i_price type t_price occurs 0 with header line.
    data : i_price1 type t_price occurs 0 with header line.
    data : i_mara type t_mara occurs 0 with header line.
    data : i_sort     type slis_t_sortinfo_alv.
    DATA: t_layout     TYPE slis_layout_alv.
    *Declaring Selection screen.
    selection-screen begin of block b1 with frame title text-101.
    select-options:
       s_verld      for eipo-verld,                 "Country of Dest.
       s_bukrs      for bkpf-bukrs,                 "Company code
       s_vkorg      for likp-vkorg,                 "Sales Organisation
       s_kunnr     for likp-kunnr,                 "Ship-to-Party
       s_kunag     for likp-kunag,                 "Sold-to-party
       s_wadat     for likp-wadat_ist,             "Goods Movement date
       s_belnr     for vbrk-vbeln,                 "Invoice number
       s_blart     for vbrk-fkart.                 "Invoice type.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-101.
    select-options:
       s_matnr      for mara-matnr,                 "Material
       s_mtart      for mara-mtart.                 "Material Type
    selection-screen end of block b2.
    selection-screen begin of block b3 with frame title text-101.
    parameters:
      p_export(30) type c default '1366770724RM' obligatory , "Exporter ID
      p_provi(30) type  c default 'ONTARIO' obligatory   ,
      p_sumid(30) type c default 'SUM0704'.
    "Province of Origin
    selection-screen end of block b3.
    selection-screen begin of block b4 with frame title text-104.
    parameters:
    r_summ radiobutton group zsum,
    r_dets radiobutton group zsum,
    r_mssng radiobutton group zsum,  " maheedhar
    R_NMSNG RADIOBUTTON GROUP ZSUM.   " MAHEEDHAR
    selection-screen skip.
    parameter : p_sum as checkbox .
    selection-screen end of block b4.
    selection-screen begin of block b5 with frame title text-105.
    select-options : s_i_kun for likp-kunnr.
    selection-screen end of block b5.
    *Data Declaration
    data: i_fieldcat type slis_t_fieldcat_alv.
    data: l_fieldcat type slis_fieldcat_alv .
    data: v_lin type i.
    data: v_lfstk type c value 'C'.
    data: v_vbtyp type c value 'U'.
    data: i_data1 type t_data1 occurs 0 with header line.
    data : begin of t_T005t occurs 0.
            include structure t005t.
    data : end of t_t005t.
    data: i_data2 type t_data2 occurs 0 with header line.
    data: t_delv type t_data2 occurs 0 with header line.
    data: t_bild type t_data2 occurs 0 with header line.
    data: i_data3 type t_data3 occurs 0 with header line.
    data: i_data4 type t_data4 occurs 0 with header line.
    data: i_data5 type t_data5 occurs 0 with header line.
    data: i_data6 type t_data6 occurs 0 with header line.
    *Declare Internal table for ALV output.
    data:  begin of i_output occurs 0,
           belnr     like  vbrk-vbeln,
           posnr     like  vbrp-posnr,
           bezei     like  t618t-bezei,
           stawn     like  eipo-stawn,
           text1     like  t604t-text1,
           quantity  type  p decimals 2,
           meins     like  lips-meins,
           value     type  p decimals 2,
           verld     like  t_t005t-landx,
           herkl     like  t_t005t-landx,
           strlen,                                              "ED1K938380
          end of i_output.
    maheedhar-start.
    data : i_output1 like i_output occurs 0 with header line,
           i_output2 like i_output occurs 0 with header line.
    maheedhar-end
    data : buff_out like i_output occurs 0 with header line.
    data:  begin of t_outsum occurs 0,
           bezei     like  t618t-bezei,
           stawn     like  eipo-stawn,
           text1     like  t604t-text1,
           quantity  type  p decimals 2,
           meins     like  lips-meins,
           value     type  p decimals 2,
           verld     like  t_t005t-landx,
           herkl     like  t_t005t-landx,
          end of t_outsum.
    data : v_ans.
    data : variante LIKE disvariant.
    data : v_repid LIKE sy-repid.
    data : wa_listheader   TYPE slis_listheader.
    data : t_listheader    TYPE slis_t_listheader.
    data : b_text(250).
    data: evntS type slis_t_event        with header line.  " MAHEEDHAR
          EVENT  AT SELECTION-SCREEN
    at selection-screen.
    *For Autorisation check
      perform authorisation_check.
    Validation of Selection screen
      perform check_entry.
          EVENT  START-OF-SELECTION
    start-of-selection.
    *Get  data
      perform select_data.
    **For calling ALV function modules
    MAHEEDHAR - START
      if r_mssng eq 'X'.
        DELETE I_OUTPUT WHERE BEZEI NE SPACE AND
                             STAWN NE SPACE AND
                             HERKL NE SPACE AND
                             VERLD NE SPACE.
        DESCRIBE TABLE I_OUTPUT LINES V_LIN.
        IF V_LIN > 0.
          PERFORM DISPLAY_OUTPUT.
        ELSE.
          MESSAGE E000 WITH TEXT-130.
        ENDIF.
      elseif R_SUMM eq 'X' OR R_DETS EQ 'X'.   "ENDIF.  " MAHEEDHAR
    MAHEEDHAR-END
        describe table i_output lines v_lin.
        if v_lin > 0.
          buff_out[] = i_output[].
       Begin of ED1K938380
       delete buff_out where stawn ne space or  "ED1K938380
                             verld eq space or
                             herkl eq space.
          delete buff_out where strlen ne 'X' or
                                verld eq space or
                                herkl eq space.
       End of ED1K938380
          describe table buff_out lines v_lin.
    Lines with no commodity code exists.
          if v_lin gt 0.
         concatenate text-902 text-903 into b_text.
            concatenate text-906 text-907 into b_text.          "ED1K938380
            CALL FUNCTION 'POPUP_TO_CONFIRM'
                 EXPORTING
                      TITLEBAR       = Text-901
                      TEXT_QUESTION  = b_text
                      TEXT_BUTTON_1  = 'Yes'
                      TEXT_BUTTON_2  = 'No'
                      DEFAULT_BUTTON = '2'
                 IMPORTING
                      ANSWER         = v_ans.
            if v_ans eq '1'.
              perform display_output.
            endif.
          else.
            perform display_output.
          endif.
        else.  " MAHEEDHAR
          message e000 with text-130.
        endif.
    MAHEEDHAR-START
    *"-- If non missing details radiobutton is selected
      elseif r_nmsng = 'X'.
    *"-- move data from i_output to i_output1.
        i_output1[] = i_output[].
        sort i_output  by belnr.
        sort i_output1 by belnr.
    *"-- to get missing data
        delete i_output1 where bezei ne space and
                               stawn ne space and
                               herkl ne space and
                               verld ne space.
        loop at i_output.
    *"-- compare two int tables with respective document number
          read table i_output1 with key belnr = i_output-belnr.
          if sy-subrc ne 0.
            move-corresponding i_output to i_output2.
            append i_output2.
            clear i_output2.
          endif.
        endloop.
        describe table i_output2 lines v_lin.
        if v_lin gt 0.
          perform display_output.
        else.
          message e000 with text-130.
        endif.
    MAHEEDHAR-END.
      ENDIF.  " MAHEEDHAR
          FORM SELECT_DATA                                              *
    form select_data.
      Data:l_strlen type i.                                     "ED1K938380
    *Get details from  LIKP.
      if s_i_kun[] is initial.
        select  likpvbeln likpkunnr
            into corresponding fields of table i_data1
            from likp
            inner join vbuk on likpvbeln = vbukvbeln
            where
              likp~vkorg in s_vkorg and
                likp~kunnr in s_kunnr and
                likp~kunag in s_kunag and
                likp~wadat_ist in s_wadat and
                vbuk~wbstk = 'C' .
      else.
        select  likpvbeln likpkunnr
             into corresponding fields of table i_data1
             from likp
             inner join vbuk on likpvbeln = vbukvbeln
             where
              (  ( likp~vkorg in s_vkorg and
                 likp~kunnr in s_kunnr and
                 likp~kunag in s_kunag and
                 likp~wadat_ist in s_wadat and
                 vbuk~wbstk = 'C' )
                 or
                 likp~kunnr in s_i_kun and
                 likp~wadat_ist in s_wadat and
                 vbuk~wbstk = 'C' )  .
      endif.
    if sy-subrc ne 0.
       message e000 with text-200.
    endif.
    *Get details from table  LIPS
      select     lips~vbeln
                 lips~posnr
                 vbfa~vbeln
                 vbfa~posnn
                 lips~matnr
                 lips~meins
                 lips~lfimg
                 mara~mtart
                 from lips
                inner join vbfa on   vbfavbelv = lipsvbeln
                                and   vbfaposnv = lipsposnr
                  inner join mara on maramatnr = lipsmatnr
                  into  table i_data2
                  for all entries in  i_data1
                 where
                   lips~vbeln = i_data1-vbeln and
                   lips~matnr in s_matnr and
                   vbfa~vbeln in s_belnr and
                   mara~mtart in s_mtart and
                  vbfa~vbtyp_n = 'U'.
      if sy-subrc ne 0.
        message e000 with text-201.
      endif.
      t_delv[] = i_data2[].
      t_bild[] = i_data2[].
      sort t_delv by vbeln.
      delete adjacent duplicates from t_delv comparing vbeln.
      sort t_bild by vbeln ascending vbelv descending.
      delete adjacent duplicates from t_bild comparing vbeln.
    *Get details of Accounting document number
      select vbeln fkart land1 from vbrk
                 into table i_data3
                 for all entries in t_bild
                 where vbeln = t_bild-vbelv and
                        bukrs in s_bukrs     and
                        fkart in s_blart     and
                        vkorg in s_vkorg     and             " MAHEEDHAR
                        land1 in s_verld.                    " MAHEEDHAR
      sort i_data3.
    *Get details from EIPO.
      select  vbrp~vbeln
              vbrp~posnr
              vbrp~matnr
              vbrp~fkimg
              vbrp~meins
              eipo~verld
              eipo~herkl
              eipo~grwrt
              eipo~stawn
              eikp~expvz
              from eikp
              inner join vbrp on vbrp~vbeln  = eikp~refnr
                    inner join eipo on eikp~exnum = eipo~exnum
                                   and eipo~expos = vbrp~posnr
                      into table i_data4 for all entries in i_data3
                    where vbrp~vbeln = i_data3-vbeln.
                         eipo~verld in s_verld.
      if sy-subrc ne 0.
        message e000 with text-201.
      endif.
      IF R_MSSNG NE 'X' or r_nmsng = 'X'.  " MAHEEDHAR
        perform get_price.
      ENDIF.  " MAHEEDHAR
    Get details from  T618T.
      select land1
             expvz
             bezei
             from  t618t
             into  table i_data5
             for all entries in i_data4
             where
             land1 = 'CA' and                 " Getting for Canada only
             expvz = i_data4-expvz and
             spras = sy-langu.
      select matnr from mara into table i_mara where matnr in s_matnr
                                                  and mtart in s_mtart.
    Get details from  T604T.
      select land1
             stawn
             text1
             from t604t
             into table i_data6
             for all entries in i_data4
             where
             land1 = i_data4-VERLD and
             stawn = i_data4-stawn and
             spras = sy-langu.
      select * from T005t into table t_T005t where spras = sy-langu.
      loop at i_data3.
        loop at i_data4 where vbeln eq i_data3-vbeln.
          clear : i_data1, i_data2.
          read table i_data2 with key vbelv = i_data4-vbeln
                                posnv = i_data4-posnr.
          read table i_data1 with key vbeln = i_data2-vbeln.
          if not s_i_kun[] is initial.
            check  ( ( i_data1-kunnr in s_i_kun ) or
                     ( i_data3-land1 in s_verld ) ).
          else.
            check i_data3-land1 in s_verld .
          endif.
          read table i_mara with key matnr = i_data4-matnr.
          if sy-subrc eq 0.
            read table i_data5 with key expvz = i_data4-expvz .
                                         land1 = i_data3-land1.
            read table i_data6 with key stawn = i_data4-stawn
                                        land1 = i_data4-VERLD.
            move i_data4-vbeln to i_output-belnr.
            move i_data4-posnr to i_output-posnr.
            move i_data5-bezei to i_output-bezei.
            move i_data6-text1 to i_output-text1.
           Begin of ED1K938380.
            l_strlen = strlen( i_data4-stawn ).
            if l_strlen < 8.
              move 'X' to i_output-strlen.
            endif.
           End of ED1K938380.
            move i_data4-stawn to i_output-stawn.
            move i_data4-meins to i_output-meins.
            read table t_T005t with key land1 = i_data3-land1.
            move t_t005t-landx to i_output-verld.
            if p_sum eq space.
              if i_data4-herkl ne 'CA'.
                i_output-herkl = c_for.
              else.
                read table t_T005t with key land1 = i_data4-herkl.
                move t_t005t-landx to i_output-herkl.
              endif.
            else.
              read table t_T005t with key land1 = i_data4-herkl.
              move t_t005t-landx to i_output-herkl.
            endif.
            move i_data4-fkimg to i_output-quantity.
            if i_data3-fkart eq c_rep.
              read table t_dord with key vbeln = i_data4-vbeln
                                         posnn = i_data4-posnr.
              if sy-subrc eq 0.
                read table t_sord with key vbeln = t_dord-vbelv
                                           posnn = t_dord-posnv.
                if sy-subrc eq 0.
                  read table t_hord with key vbeln = t_sord-vbelv
                                             posnr = t_sord-posnv.
                  if sy-subrc eq 0.
                    read table t_ford with key vbeln = t_hord-vbeln
                                               posnr = t_hord-uepos.
                    if sy-subrc eq 0.
                      read table i_price with key vbeln = t_ford-vbeln
                                                  posnr = t_ford-posnr.
                      if sy-subrc eq 0.
                        read table i_price1 with key knumv = i_price-knumv
                                                     kposn = t_ford-posnr.
                        if sy-subrc eq 0.
                          if i_price1-kpein ne 0.
                            i_output-value =
                            ( i_price1-kbetr / i_price1-kpein ) *
                                                      i_data4-fkimg.
                          endif.
                        endif.
                      endif.
                    endif.
                  endif.
                endif.
              endif.
            else.
              move i_data4-grwrt to i_output-value.
            endif.
            append i_output.
            clear  i_output.
            clear : i_data5, i_data6.
          endif.
        endloop.
      endloop.
      sort i_output by verld herkl bezei stawn.
    endform.
          FORM DISPLAY_OUTPUT                                           *
          This form is to create the ALV output
    form display_output.
      data: xevents     type slis_t_event,
                ls_event    type slis_alv_event,
               slis_ev_top_of_page type slis_formname value 'TOP_OF_PAGE',
               slis_ev_end_of_list type slis_formname value 'END_OF_LIST'.
    *Call  Function  'REUSE_ALV_EVENTS' for top of page
      call function 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type     = 0
           IMPORTING
                et_events       = xevents
           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.
      read table xevents with key name = slis_ev_top_of_page
                               into ls_event.
      if sy-subrc = 0.
        move slis_ev_top_of_page to ls_event-form.
        append ls_event to xevents.
      endif.
      read table xevents with key name = slis_ev_end_of_list
                                 into ls_event.
      if sy-subrc = 0.
        move slis_ev_end_of_list to ls_event-form.
        append ls_event to xevents.
      endif.
      if r_dets ne space.
    *Call Function 'REUSE_ALV_FIELD_CATALOG_MERGE' for position fixing in
    *the output.
        call function 'REUSE_ALV_FIELDCATALOG_MERGE'
             exporting
                  i_program_name         = 'ZVRA0001FTB13'
                  i_internal_tabname     = 'I_OUTPUT'
                  i_inclname             = 'ZVRA0001FTB13'
              I_STRUCTURE_NAME       =
              I_CLIENT_NEVER_DISPLAY = 'X'
              I_INCLNAME             =
                 i_bypassing_buffer     = 'X'
                 i_buffer_active        = ' '
             changing
                  ct_fieldcat            = i_fieldcat
             exceptions
                  inconsistent_interface = 1
                  program_error          = 2
                  others                 = 3.
        if sy-subrc <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
        loop at i_fieldcat into l_fieldcat.
          l_fieldcat-key = ' '.
          case l_fieldcat-fieldname.
            when 'BELNR'.
              l_fieldcat-seltext_m = text-912.
              l_fieldcat-seltext_l = text-912.
              l_fieldcat-reptext_ddic = text-912.
              l_fieldcat-col_pos   = '1'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-outputlen = '12'..
            when 'POSNR'.
              l_fieldcat-seltext_m = text-913.
              l_fieldcat-seltext_l = text-913.
              l_fieldcat-reptext_ddic = text-913.
              l_fieldcat-col_pos   = '2'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-outputlen = '6'.
            when 'BEZEI'.
              l_fieldcat-seltext_m = text-911.
              l_fieldcat-seltext_l = text-911.
              l_fieldcat-reptext_ddic = text-911.
              l_fieldcat-col_pos   = '3'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-outputlen = '15'..
            when 'STAWN'.
              l_fieldcat-seltext_m = text-111.
              l_fieldcat-seltext_l = text-111.
              l_fieldcat-reptext_ddic = text-111.
              l_fieldcat-col_pos   = '4'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-outputlen = '30'.
            when 'TEXT1'.
              l_fieldcat-seltext_m = text-112.
              l_fieldcat-seltext_l = text-112.
              l_fieldcat-outputlen = '40'.
              l_fieldcat-col_pos   = '5'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-reptext_ddic = text-112.
            when 'QUANTITY'.
              l_fieldcat-outputlen = '18'.
              l_fieldcat-reptext_ddic = text-113.
              l_fieldcat-seltext_m = text-113.
              l_fieldcat-col_pos   = '6'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-seltext_l = text-113.
            when 'MEINS'.
              l_fieldcat-outputlen = '8'.
              l_fieldcat-reptext_ddic = text-114.
              l_fieldcat-seltext_m = text-114.
              l_fieldcat-col_pos   = '7'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-seltext_l = text-114.
            when 'VALUE'.
              l_fieldcat-outputlen = '20'.
              l_fieldcat-seltext_m = text-115.
              l_fieldcat-seltext_l = text-115.
              l_fieldcat-just      = 'C'.
              l_fieldcat-reptext_ddic = text-115.
            when 'VERLD'.
              l_fieldcat-outputlen = '20'.
              l_fieldcat-seltext_m = text-116.
              l_fieldcat-seltext_l = text-116.
              l_fieldcat-just      = 'C'.
              l_fieldcat-reptext_ddic = text-116.
            when 'HERKL'.
              l_fieldcat-seltext_m = text-117.
              l_fieldcat-seltext_l = text-117.
              l_fieldcat-outputlen = '30'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-reptext_ddic = text-117.
            when others.
              l_fieldcat-no_out = 'X'.
          endcase.
          modify i_fieldcat from l_fieldcat.
        endloop.
    Call Function  'REUSE_ALV_LIST_DISPLAY'  for  dispaly  of data in ALV.
        call function 'REUSE_ALV_LIST_DISPLAY'
             EXPORTING
                  i_callback_program = 'ZVRA0001FTB13'
                  it_fieldcat        = i_fieldcat
                  it_events          = xevents
                  is_layout          = t_layout
                  i_save             = 'A'
                  i_bypassing_buffer = 'X'
                  i_buffer_active    = ' '
             TABLES
                  t_outtab           = i_output
             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.
    else.  " MAHEEDHAR
      ELSEIF R_SUMM EQ 'X'.  " MAHEEDHAR
        sort i_output by verld herkl stawn bezei.
        loop at i_output.
          move-corresponding i_output to t_outsum.
          collect t_outsum.
        endloop.
    *Call Function 'REUSE_ALV_FIELD_CATALOG_MERGE' for position fixing in
    *the output.
        call function 'REUSE_ALV_FIELDCATALOG_MERGE'
             EXPORTING
                  i_program_name         = 'ZVRA0001FTB13'
                  i_internal_tabname     = 'T_OUTSUM'
                  i_inclname             = 'ZVRA0001FTB13'
                 i_bypassing_buffer     = 'X'
                 i_buffer_active        = ' '
             CHANGING
                  ct_fieldcat            = i_fieldcat
             EXCEPTIONS
                  inconsistent_interface = 1
                  program_error          = 2
                  others                 = 3.
        if sy-subrc <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
        loop at i_fieldcat into l_fieldcat.
          l_fieldcat-key = ' '.
          case l_fieldcat-fieldname.
            when 'BEZEI'.
              l_fieldcat-seltext_m = text-911.
              l_fieldcat-seltext_l = text-911.
              l_fieldcat-reptext_ddic = text-911.
              l_fieldcat-col_pos   = '1'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-outputlen = '15'..
            when 'STAWN'.
              l_fieldcat-seltext_m = text-111.
              l_fieldcat-seltext_l = text-111.
              l_fieldcat-reptext_ddic = text-111.
              l_fieldcat-col_pos   = '2'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-outputlen = '30'.
            when 'TEXT1'.
              l_fieldcat-seltext_m = text-112.
              l_fieldcat-seltext_l = text-112.
              l_fieldcat-outputlen = '40'.
              l_fieldcat-col_pos   = '3'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-reptext_ddic = text-112.
            when 'QUANTITY'.
              l_fieldcat-outputlen = '18'.
              l_fieldcat-reptext_ddic = text-113.
              l_fieldcat-seltext_m = text-113.
              l_fieldcat-col_pos   = '4'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-seltext_l = text-113.
            when 'MEINS'.
              l_fieldcat-outputlen = '8'.
              l_fieldcat-reptext_ddic = text-114.
              l_fieldcat-seltext_m = text-114.
              l_fieldcat-col_pos   = '5'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-seltext_l = text-114.
            when 'VALUE'.
              l_fieldcat-outputlen = '20'.
              l_fieldcat-seltext_m = text-115.
              l_fieldcat-seltext_l = text-115.
              l_fieldcat-col_pos   = '6'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-reptext_ddic = text-115.
            when 'VERLD'.
              l_fieldcat-outputlen = '20'.
              l_fieldcat-seltext_m = text-116.
              l_fieldcat-seltext_l = text-116.
              l_fieldcat-col_pos   = '7'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-reptext_ddic = text-116.
            when 'HERKL'.
              l_fieldcat-seltext_m = text-117.
              l_fieldcat-seltext_l = text-117.
              l_fieldcat-outputlen = '30'.
              l_fieldcat-col_pos   = '8'.
              l_fieldcat-just      = 'C'.
              l_fieldcat-reptext_ddic = text-117.
            when others.
              l_fieldcat-no_out = 'X'.
          endcase.
          modify i_fieldcat from l_fieldcat.
        endloop.
    Call Function  'REUSE_ALV_LIST_DISPLAY'  for  dispaly  of data in ALV.
        call function 'REUSE_ALV_LIST_DISPLAY'
             EXPORTING
                  i_callback_program = 'ZVRA0001FTB13'
                  it_fieldcat        = i_fieldcat
                  it_events          = xevents
                  i_save             = 'A'
                  is_layout          = t_layout
                  i_default          = 'X'
                  is_variant         = variante
                  i_bypassing_buffer = 'X'
                  i_buffer_active    = ' '
             TABLES
                  t_outtab           = t_outsum
             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.
    MAHEEDHAR-START.
    *"-- if detail summary checkbox is selected
      elseIF R_MSSNG = 'X'.
       PERFORM PREPARE_HEADER.
        call function 'REUSE_ALV_FIELDCATALOG_MERGE'
            exporting
                 i_program_name         = 'ZVRA0001FTB13'
                 i_internal_tabname     = 'I_OUTPUT'
                 i_inclname             = 'ZVRA0001FTB13'
              I_STRUCTURE_NAME       =
              I_CLIENT_NEVER_DISPLAY = 'X'
              I_INCLNAME             =
                i_bypassing_buffer     = 'X'
                i_buffer_active        = ' '
            changing
                 ct_fieldcat            = i_fieldcat
            exceptions
                 inconsistent_interface = 1
                 program_error          = 2
       

    hi,
    *& Report  ZALV_FIELD_GRID1
    REPORT  ZALV_FIELD_GRID1
            NO STANDARD PAGE HEADING.
    TABLES MARA.
    type-pools :slis.
    TYPES : BEGIN OF TMARA ,
            MATNR LIKE MARA-MATNR,
            MEINS LIKE MARA-MEINS,
            ERSDA LIKE MARA-ERSDA,
            color(4) type c,
            SEL type c,
            LIGHT TYPE C,
            END OF TMARA.
    TYPES: BEGIN OF TMAKT,
           MATNR LIKE MAKT-MATNR,
           MAKTX LIKE MAKT-MAKTX,
           MAKTG LIKE MAKT-MAKTG,
           SEL TYPE C,
           COLOR(4),
           END OF TMAKT.
    DATA:  ITAB TYPE TMARA OCCURS 0 WITH HEADER LINE,
           ITAB1 TYPE TMAKT OCCURS 0 WITH HEADER LINE,
           wa_fieldcat type slis_fieldcat_alv,
           fieldcat type slis_fieldcat_alv occurs 0,
           i_layout type slis_layout_alv,
           WA_LISTHEADER TYPE SLIS_LISTHEADER ,
           i_LISTHEADER TYPE SLIS_LISTHEADER OCCURS 0,
           V_EVENTS TYPE SLIS_T_EVENT ,
           WA_EVENT TYPE SLIS_ALV_EVENT,
           I_TITLE_MARA TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED',
           I_TITLE_MAKT TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED',
           SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE,
           PRINT_CONT type slis_print_alv.
    SELECTION SCREE
    selection-screen  begin of block screen1  with frame title TEXT-001.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN COMMENT /32(35) COMM1.
    SELECTION-SCREEN ULINE /27(35).
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS MATNR FOR MARA-MATNR.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN COMMENT /30(50) COMM2.
    SELECTION-SCREEN ULINE /27(40).
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS ERSDA FOR MARA-ERSDA.
    SELECTION-SCREEN SKIP.
    selection-screen  end of block screen1.
        INITIALIZATION
    INITIALIZATION.
      MATNR-low = '23'.
      MATNR-high = '1000'.
      MATNR-option = 'BT'.
      MATNR-sign = 'I'.
      APPEND MATNR.
      ERSDA-low = '20030124'.
      ERSDA-high = '20050302' .
      APPEND ERSDA.
      PERFORM FILLFIELD.
      PERFORM FILLLAYOUT.
      PERFORM build_print_params.
      PERFORM FILL_SORT.
      PERFORM EVENT_CALL.
      PERFORM POPULATE_EVENT.
            SELECTION-SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      comm1 ='SELECT MATERIAL NUMBER  RANGE'.
      comm2 ='SELECT MATERIAL CREATION DATE'.
               START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM READDATA.
      PERFORM POPDATA.
    *&      Form  READDATA
          text
    FORM READDATA .
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = MATNR-LOW
        IMPORTING
          OUTPUT = MATNR-LOW.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = MATNR-HIGH
        IMPORTING
          OUTPUT = MATNR-HIGH.
      SELECT MATNR
             ERSDA
             MEINS
             FROM MARA
             INTO CORRESPONDING FIELDS OF
            TABLE ITAB
            WHERE MATNR IN MATNR AND ERSDA IN ERSDA.
      LOOP AT ITAB.
        data id_color type i VALUE 1.
        data id_colors(2) type c.
        IF ITAB-MATNR < '000000000000000100'.
          ITAB-LIGHT = '1'.
        ELSEIF ITAB-MATNR < '000000000000000150' AND ITAB-MATNR >
       '000000000000000100' .
          ITAB-LIGHT = '2'.
        ELSE.
          ITAB-LIGHT = '3'.
        ENDIF.
        id_color = id_color + 1.
        if id_color > 7.
          id_color = 1.
        endif.
        id_colors = id_color.
        concatenate 'C' id_colors '10' into itab-color.
        modify itab.
        CLEAR ITAB.
      endloop.
    ENDFORM.                    " READDATA
         Form  FILLFIELD
    FORM FILLFIELD .
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-KEY = 'X'.
      WA_FIELDCAT-COL_POS = '1'.
      WA_FIELDCAT-outputlen   = 20.
      WA_FIELDCAT-HOTSPOT = 'X'.
      wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
    *WA_FIELDCAT-EMPHASIZE = 'C210'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'MEINS'.
      WA_FIELDCAT-COL_POS = '2'.
    *WA_FIELDCAT-EMPHASIZE = 'C510'.
      WA_FIELDCAT-outputlen   = 10.
      wa_fieldcat-seltext_m = 'UNIT'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'ERSDA'.
      WA_FIELDCAT-COL_POS = '3'.
      WA_FIELDCAT-outputlen   = 15.
    *WA_FIELDCAT-EDIT_MASK  = 'DD.MM.YYYY'.
    *WA_FIELDCAT-EMPHASIZE = 'C710'.
      wa_fieldcat-seltext_m = 'CREAT DATE'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
    ENDFORM.                    "FILLFIELD
          Setup print parameters
    form build_print_params.
      PRINT_CONT-reserve_lines = '3'.   "Lines reserved for footer
      PRINT_CONT-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
         Form  POPDATA
    FORM POPDATA .
      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            = 'USER-COMMAND'
         I_CALLBACK_TOP_OF_PAGE             = 'TOPPAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                       = I_TITLE_MARA
      I_GRID_SETTINGS                   =
         IS_LAYOUT                          = I_LAYOUT
         IT_FIELDCAT                        = fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
        IT_SORT                           =  SORT[]
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
         IT_EVENTS                          = V_EVENTS
      IT_EVENT_EXIT                     =
       IS_PRINT                          = PRINT_CONT
        TABLES
          T_OUTTAB                          = ITAB
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    ENDFORM.                    " POPDATA
         Form  TOPPAGE
    FORM TOPPAGE.
      REFRESH I_LISTHEADER.
      DATA: ld_lines type i,
            ld_linesc(10) type c,
            I_DATE(10) TYPE C,
            I_INFO LIKE WA_LISTHEADER-INFO.
      WA_LISTHEADER-TYP = 'H'.
      WA_LISTHEADER-INFO = 'MATERIAL DETAIL'.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      WA_LISTHEADER-TYP = 'S'.
      WA_LISTHEADER-KEY = 'DATE :'.
      CONCATENATE SY-DATUM+6(2) '.'
                           SY-DATUM+4(2) '.'
                           SY-DATUM(4) INTO I_DATE.
      WA_LISTHEADER-INFO = I_datE.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      describe table ITAB lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
                        into I_INFO separated by space.
      WA_LISTHEADER-TYP  = 'A'.
      WA_LISTHEADER-INFO = I_INFO.
      append WA_LISTHEADER to I_LISTHEADER.
      clear: WA_LISTHEADER , I_INFO.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = I_LISTHEADER
          I_LOGO             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "TOPPAGE
         Form  FILLLAYOUT
    FORM FILLLAYOUT .
      i_layout-zebra = 'X'.
      i_layout-info_fieldname = 'COLOR'.
      i_layout-box_fieldname = 'SEL'.
      I_LAYOUT-lights_fieldname = 'LIGHT'.
      I_LAYOUT-EDIT ='X'.
      I_LAYOUT-colwidth_optimize = 'X'.
      I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
      I_LAYOUT-no_totalline = 'X'.
    ENDFORM.                    "FILLLAYOUT
        Form  FILL_SORT
    FORM FILL_SORT .
      SORT-DOWN = 'X'.
      SORT-SPOS = 1.
      SORT-FIELDNAME = 'MATNR'.
      SORT-tabname = 'MARA'.
      APPEND SORT.
    ENDFORM.                    " FILL_SORT
         Form  EVENT_CALL
    FORM EVENT_CALL .
      DATA: I_EVENT LIKE V_EVENTS.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = V_EVENTS.
      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.                    " EVENT_CALL
        Form  POPULATE_EVENT
    FORM POPULATE_EVENT .
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'USER_COMMAND'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
        WA_EVENT-NAME.
    READ TABLE V_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
                                          INTO WA_EVENT.
    IF SY-SUBRC = 0.
       move 'END_OF_PAGE' to WA_EVENT-FORM.
       MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
       WA_EVENT-NAME.
      endif.
      ENDIF.
    ENDFORM.                    "POPULATE_EVENT
    FORM END_OF_PAGE.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    ENDFORM.
    *&      Form  USER_COMMAND
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          CASE RS_SELFIELD-FIELDNAME.
            when 'MATNR'.
              read table itab with key matnr = RS_SELFIELD-VALUE.
              if sy-subrc = 0.
                PERFORM DATA_RETRIEVAL_MAKT USING RS_SELFIELD-VALUE.
                PERFORM BUILD_FIELDCATLOG_MAKT.
                PERFORM FILLLAYOUT_MAKT.
                PERFORM DISPLAY_ALV_MAKT.
                CLEAR RS_SELFIELD.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDFORM.                    "user_command
         Form  DATA_RETRIEVAL_MAKT
    FORM DATA_RETRIEVAL_MAKT USING TMATNR .
      SELECT MATNR
             MAKTX
             MAKTG
             UP TO 100 ROWS
             FROM MAKT
             INTO TABLE ITAB1
             WHERE SPRAS = 'EN' AND MATNR = TMATNR.
      LOOP AT ITAB1.
        data id_color type i VALUE 1.
        data id_colors(2) type c.
        id_color = id_color + 1.
        if id_color > 7.
          id_color = 1.
        endif.
        id_colors = id_color.
        concatenate 'C' id_colors '10' into itab1-color.
        modify itab1.
        CLEAR ITAB1.
      ENDLOOP.
    ENDFORM.                    "DATA_RETRIEVAL_MAKT
         Form  FILLLAYOUT_MAKT
    FORM FILLLAYOUT_MAKT .
      CLEAR I_LAYOUT.
      i_layout-zebra = 'X'.
      i_layout-info_fieldname = 'COLOR'.
      i_layout-box_fieldname = 'SEL'.
      I_LAYOUT-EDIT ='X'.
      I_LAYOUT-colwidth_optimize = 'X'.
      I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
    ENDFORM.                    " LAYOUT_MAKT
        Form  BUILD_FIELDCATLOG_MAKT
    FORM BUILD_FIELDCATLOG_MAKT .
      REFRESH FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-KEY = 'X'.
      WA_FIELDCAT-COL_POS = '1'.
    *WA_FIELDCAT-EDIT_MASK  = 'DD.MM.YYYY'.
      WA_FIELDCAT-EMPHASIZE = 'C510'.
      wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'MAKTX'.
      WA_FIELDCAT-COL_POS = '2'.
      WA_FIELDCAT-EMPHASIZE = 'C710'.
      wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'MAKTG'.
      WA_FIELDCAT-COL_POS = '3'.
      WA_FIELDCAT-EMPHASIZE = 'C210'.
      wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
    ENDFORM.                    " BUILD_FIELDCATLOG_MAKT
         Form  DISPLAY_ALV_MAKT
    FORM TOP-OF-PAGE.
      REFRESH I_LISTHEADER.
      DATA: ld_lines type i,
            ld_linesc(10) type c,
            I_DATE(10) TYPE C,
            I_INFO LIKE WA_LISTHEADER-INFO.
      WA_LISTHEADER-TYP = 'H'.
      WA_LISTHEADER-INFO = 'MATERIAL DESCRIPTION FOR SELECTED NUMBER'.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      WA_LISTHEADER-TYP = 'S'.
      WA_LISTHEADER-KEY = 'DATE :'.
      CONCATENATE SY-DATUM+6(2) '.'
                           SY-DATUM+4(2) '.'
                           SY-DATUM(4) INTO I_DATE.
      WA_LISTHEADER-INFO = I_datE.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      describe table ITAB1 lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
                        into I_INFO separated by space.
      WA_LISTHEADER-TYP  = 'A'.
      WA_LISTHEADER-INFO = I_INFO.
      append WA_LISTHEADER to I_LISTHEADER.
      clear: WA_LISTHEADER , I_INFO.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = I_LISTHEADER
          I_LOGO             = 'ENJOYSAP_LOGO'.
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                    "TOP-OF-PAGE
    *&      Form  DISPLAY_ALV_MAKT
          text
    FORM DISPLAY_ALV_MAKT .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM     = SY-REPID
          I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
          I_GRID_TITLE           = I_TITLE_MAKT
          IS_LAYOUT              = I_LAYOUT
          IT_FIELDCAT                       = fieldcat
        TABLES
          T_OUTTAB               = ITAB1
        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_ALV_MAKT
    Regards
    Ashok kumar

  • ABAP list report, multiple selections - select-options

    I have written a very simple ABAP list report, that contains a single select-option.  On the selection screen, I have the option of entering multiple values, with each new value being displayed directly underneath the old, but I am only getting the first value entered on the screen displayed.  Does anyone have any sample code for me?

    Hi Daniel,
    Select_Options consists of 4 parameters, in with the range consists in eg...
    Select-options s_vbeln for vbak-vbeln.
    then s_vbeln-low, s_vbeln-high are the range values...
    So whne you write select query.
    write vbeln in s_vbeln
    instead of vbeln eq s_vbeln
    Hope this solves your problem.
    Thanks & Regards,
    Dileep .C

  • Total Page in ABAP List

    Hi Experts,
    I have a requirement to print: "Page XX of XX" in my ABAP List report (this report is meant to be printed).
    For Current Page, I know that the system field is SY-PAGNO.  But I can't find the field for Total Page. Is there anyway to print this (Total Page) since it means that we have to predict how long the report will be before we WRITE anything?
    Thanks a lot,
    Sam

    In the first statement of ur report u'll have to reserve some lines for footer as follows:
    REPORT <prg name> LINE-COUNT 25(2).
    here ur list will display 23 lines of data and then 2 lines are reserved for footer.
    This means that in each page u can display 23 lines of text.  Now depending on number of entries in your internal table which contains data to be displayed, we can calculate the number of pages required to print the total output.
    E.g: I have 62 records in my internal table, so to get the total number of pages use the following logic:
          (U can find out the number of recs in internal table dynamically using DESCRIBE stmt)
           62/23 = 2.69
           Round the result to the next integer using CEIL , so the next interger is 3.
           So ur total number of pages is 3.  And u now the current page number by sy-pagno.
    Hope this solves ur problem.

  • Print preview in abap list format (OMLV) - Need preview in graphical format

    Dear All
    I am facing a problem with the print preview. (transaction code OMLV)
    When i am clicking on print preview button the system is displaying the output in a ABAP list format.
    and also the printout shows only the ABAP content.
    Pl. advise on how to view the print preview in a graphical format and not in the ABAP list format and pl. let me know the setting to print the spool in the graphical format.
    Thanks,
    Maxx

    Hi,
    this problem is not only related to warehouse. even the print preview spool for GR/GI slip in t-code SP01 shows as ABAP list and not as graphical screen.
    my question is why does the system shows the print preview for spool as an ABAP list instead of graphical view.
    pl. advise
    Thanks,
    Maxx

  • PO Version not displayed in PO List Displays (ME2L, ME2K, etc)

    I have configured PO Version Management. My PO's are working as desired with proper output.
    However, the PO Version Number is not displayed in my PO List Display tcodes (ME2L, ME2K, etc) nor is it available to add to the layout.  I have configured the Scope of List for "BEST" (PO's) to include change documents. However, there is nothing when I go to ME2L for a PO that has 15 versions. I have verified that EKKO does contain the latest version number for this PO.
    Have I missed a config step??

    Dear,
    The data you are searching not available in EKKO table. We do it with
    CDHDR - Header Change
    CDPOS - Item Change
    EREV - Version Change
    Tables with help of ABAPer.
    Regards,
    Syed Hussain.

  • Print preview in abap list format

    Dear All
    I am facing a problem with the print preview.
    When i am clicking on print preview button the system is displaying the output in a abap list format.
    but when i m taking the print it is coming correctly.
    The out put format is different in the print preview where as when i am taking the output it is coming correctly.
    Pls help me out on this.

    Please check this answered link:
    Invoice print preview defaults to ABAP List View

Maybe you are looking for

  • I live in Sweden and Portugal, can I have two apple accounts one for each country?

    Hi, I need your help, at the present moment I devide my time between two countries Sweden and Portugal, my Apple acoount is based in sweden, my question is can I open an account in Portugal and keep the Swedish account or i am only allowd an account?

  • Showing column shop_from in quick sales order

    Dear all, I am trying to show one field name(ship_from) Warehous , when i go to show field it is not showing that field during creation of new folder, however this field is already shows for other saved folder , I have to show on quick sales order fo

  • Windows 7 64-bit  Itunes crashes

    For the last couple of months  when it seems that my itunes is done updating my iphone 3GS I get an error message saying itunes needs to close.   Any ideas on how to fix this would be appreciated.

  • How do I switch from external datasource to LS datasource and keep the same data entities? Need to edit design.

    Hi all, I have a LightSwitch desk top application that I wrote back in 2011 right after LightSwitch was available using VS2010 and the necessary extensions.  I am now in the process of trying to upgrade that application using Visual Studio 2013 Versi

  • Ned help on JSP parsing XML

    Hi all. Im having problems on how to parse an xml by JSP Can anyone teach me how to parse an the XML below by jsp, without using taglibs. Im using JDOM... <Customer>            <DetailsCustomer ID = 1>            <Name>                   John