List ALV - ML85

Hi everyone,
Is possible to assign ALV for tcode ML85?
I've tried along the way (IMG > Materials Management > Purchasing > Reporting > Maintain Purchasing Lists > Scope of List), but can not.
Thank you,
Madi

I don't know if ML85 is ALV enabled, but you can at least test this, I know it works for ML84
Enter ME_USE_GRID   with value 'X'  to your user parameters in SU3

Similar Messages

  • COPA line item report, Number format  -output type - object list(ALV).

    Hi,
    I am preparing COPA line item report. I want to change number format (two decimal place). I did the changes in form level then I did the changes in drill down report as well and saved as save definition.
    But changes are not reflecting in- output type - object list(ALV).
    Please provide help in this.
    Regards

    HI
    What t-code you are using to write this line item report ?

  • Is it possible to display list alv and grid alv in the same screen

    Hi
    There are methods to display more than 1 alv grid in the same screen by using block append grid . In the same manner its available for more than 1 list alv report display by REUSE_ALV_BLOCK_LIST_APPEND.
    My question is I want to display 1 alv list and 1 alv grid report in the same output screen .
    Please let me know how to do it ?  I will definetly appreciate the answers.
    Thanks!!

    Hi Anindita,
                                      Previously i ad told v cant display two lists together in same screen. But u can use Block ALV for this. Use FM "REUSE_ALV_BLOCK_LIST_APPEND.
    In OO u can use Cl_GUI_EAST_SPLITTER_CONTAINER for displayin more than two lists in same screen.
    If useful giv points
    Regards
    Vanitha P

  • Download Hierarchial List ALV  to excel

    Hi all,
    Please provide me the solution on using download button in Hierarchial List ALV to download to excel.The output of excel need to be exacted as the output of ALV (All header and items details).
    Please suggest the solution and sample code ASAP.
    Thanks and Regards.

    Hello,
    Find the code where method set_table_for_first_display of tree object (CL_GUI_ALV_TREE) used in your program,
    and learn  table of tree from there :
    CALL METHOD g_tree->set_table_for_first_display
    EXPORTING
      i_structure_name    = g_structname
      is_hierarchy_header = g_hierarchy_header
    CHANGING
      it_fieldcatalog     = g_fieldcat
      it_outtab           = it_result .   "<-- this table contains hierarchical data
    And than download this table using class CL_GUI_FRONTEND_SERVICES
    and methods FILE_SAVE_DIALOG and GUI_DOWNLOAD or function GUI_DOWNLOAD
    you can find too many of examples in forum.

  • Possible to mark and unmark every line of the list (ALV

    Hi Experts,
    I would like to develop stock compensation report for a client my requirement as below.
    It must be possible to mark and unmark every line of the list (ALV). On top of the list a button (Create Sales Document) is needed. Pressing this button starts the creation of the sales documents for every line of the list which is marked. The button is only active when the simulation flag is initial!
    Since this is a working list it must be possible to double-click on each line and see the line item details. The line item details should be shown as a ALV list as well. The list contains the following fields:
    u2022     Sold-to (VBPA-KUNNR u2013 VBPA-PARVW = u2018AGu2019)
    u2022     Name of sold-to (VBPA- ADRNR u2013 VBPA-PARVW = u2018AGu2019  ADRC-NAME1)
    u2022     Ship-to (VBPA-KUNNR u2013 VBPA-PARVW = u2018WEu2019)
    u2022     Name of ship-to (VBPA- ADRNR u2013 VBPA-PARVW = u2018WEu2019  ADRC-NAME1)
    u2022     Material number (VBRP-MATNR)
    u2022     Material description (VBRP-ARKTX)
    u2022     Old Price List (determination see above)
    u2022     New Price List (determination see above)
    u2022     Compensation Value List (determination see above)
    u2022     Compensation Quantity List (determination see above)
    u2022     New Compensation Quantity List (determination see above)
    After pressing the creation button a sales document for every marked line is created. When this is finished a log is issued for every line. The log shows the following information:
    u2022     Sold-to (VBPA-KUNNR u2013 VBPA-PARVW = u2018AGu2019)
    u2022     Name of sold-to (VBPA- ADRNR u2013 VBPA-PARVW = u2018AGu2019  ADRC-NAME1)
    u2022     Ship-to (VBPA-KUNNR u2013 VBPA-PARVW = u2018WEu2019)
    u2022     Name of ship-to (VBPA- ADRNR u2013 VBPA-PARVW = u2018WEu2019  ADRC-NAME1)
    u2022     Sales document number or error message if no document is created
    How to create check boxes for eachline in the ALV output for mark or unmark purpsoe and how to create create sales document button in the output and how to create the sales order process . please help me out.
    Moderator message: more "spec dumping", please work yourself first on your requirement.
    Edited by: Thomas Zloch on Mar 29, 2011 4:32 PM

    hi
    i have a code for drop down list use this
    this code is for selection-screen deop-down list yu can add this same code in ALV
    REPORT  ZCHETANA_PRAC10                         .
    Type-pools: VRM.
    data: name type vrm_id,
          list_month type vrm_values,
          list_year type vrm_values,
          value type vrm_value.
    selection-screen: begin of block b with frame.
    parameter: p_year(10) type c as listbox visible length 10,
               p_month(10) type c as listbox visible length 10.
    selection-screen: end of block b.
    at selection-screen output.
    value-key = 'JAN'.
    value-text = 'JAN'.
    append value to list_month.
    value-key = 'FEB'.
    value-text = 'FEB'.
    append value to list_month.
    value-key = 'MAR'.
    value-text = 'MAR'.
    append value to list_month.
    value-key = 'APR'.
    value-text = 'APR'.
    append value to list_month.
    value-key = '1998'.
    value-text = '1998'.
    append value to list_year.
    value-key = '1999'.
    value-text = '1999'.
    append value to list_year.
    value-key = '2000'.
    value-text = '2000'.
    append value to list_year.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        ID                    = 'P_MONTH'
        VALUES                = list_month
    EXCEPTIONS
      ID_ILLEGAL_NAME       = 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.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        ID                    = 'P_YEAR'
        VALUES                = list_year
    EXCEPTIONS
      ID_ILLEGAL_NAME       = 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.
    start-of-selection.
    write:/ p_year,
           p_month.

  • COPA Report Layout with Object List (ALV)

    Hi,
    I have question about the COPA report layout with object list (ALV). Everytime I executed the report with ALV format, the amount for quantity column always shows with 3 decimal number, menwhile for amount column always follow by 2 decimal number.
    Can anyone help me regarding this matter? I do not know how to turn off the decimal number to be 0 in this type of layout, although in the form itself I already put 0 decimal number.
    Thanks.

    Hi,
    Better to raise this issue in CO Forum. You can expect some solution.
    regards

  • Top of page in Block list ALV

    HI,
    I have a Requirement where i have a Block list ALV . I have 4 blocks to be Displayed in the output and the output has to be transfered to the PDF.
    I am able to get the 4 blocks in the output and the Top of Page for the Report in each page.
    But the Problem is when i download the output containing the top of page of output with 4 blocks into a PDF.
    I want the Top of page of Report to be the Top of Page of the PDf also.
    In PDF the Top of page of Report is coming in the center of the PDF also in some other places also.
    How to make sure the Top of page of Report comes in the top of the PDf
    Can you kinldy help me in this.
    Thanks,
    Gokul

    Duplicate post.
    Reported.

  • Regarding Excel Download in Block list ALV

    Hi Abaper's,
    I am facing with one problem during downloading of the BlockList ALV.
    <b>If I click on the standart toolbar  'local file button '( ctrl + shift + F9) it is downloading the ALV data into the excel file but the ALV header information starts from column 1 and ALV data information starts from the 2nd column.</b>
    Please suggest me is it the expected functionality of the Block List ALV or I have written wrong code. Please suggest me.

    I think there is something wrong with the output...maybe you should check your fieldcatalog wheter it matches to the structure of your internal table of data you want to show.
    Normally you should get an output per column with the fieldnames in the first line starting with 1st column and the data starting in 2nd line starting with 1st col.
    hope that helps you off, please award if useful!
    Clemens

  • How to create a part selection and a part list ALV in the same screen

    Hello,
    I will want to realize in a screen a part lists ALV and a part selection for the list.
    I have created a container with  a splitter , but I do not know how to carry out the selection part.
    Thank you for your assistance.
    Regards

    Hello
    If you want to have the selections and the ALV list displayed on the same dynrpo then create a dynpro that contains in the upper part the selection/input fields and in the lower part place a custom container for the ALV grid.
    If you want to be more flexible then you could use a subscreen for the selection/input fields.
    There is no point in using a splitter container because we cannot place normal input fields into a container but only controls.
    Regards
      Uwe

  • Scope of list ALV not defined (please correct) in rm06bkps program

    hi experts,
    i have to add some fields in me5j t-code, for this i have copied the standard program as z prog. But at time of execution it gives an error
    "Scope of list ALV not defined (please correct)
    Message no. ME287"
    At the time of debugging i found gf_factory object is not filled, but im unable to trace that variable
    even i have searhed the same on SDN but the quetion is not answerd.
    please help me out ASAP.
    waiting for ur valuable replies..
    thanks in advance
    Neha

    i got the problem
    in fm
    ME_REP_GET_TABLE_MANAGER  -->   l_factory(object) -->im_service(variable)
    l_active = l_factory->is_active( im_service = l_service  im_scope = im_scope ).
    im_service  variable has programe name, im_scope has "ALV" . then it execution goes in case statement where it checks the im_service with standard prog name.
    as in case im_service has zprog, so it doesnt go to any when case and hence the prob.
    any sugesstion..?????
    Neha

  • Scope of list ALV not defined

    Hi,
    I copy program RM06BA00 (transaction ME5A) to Z program.
    when i run the z program and change the parameter  scope of list to ALV i get the message
    Scope of list ALV not defined .
    any idea way and how solve the problem ?
    thanks
    Itzik

    i got the problem
    in fm
    ME_REP_GET_TABLE_MANAGER  -->   l_factory(object) -->im_service(variable)
    l_active = l_factory->is_active( im_service = l_service  im_scope = im_scope ).
    im_service  variable has programe name, im_scope has "ALV" . then it execution goes in case statement where it checks the im_service with standard prog name.
    as in case im_service has zprog, so it doesnt go to any when case and hence the prob.
    any sugesstion..?????
    Neha

  • Call function 'REUSE_ALV_GRID_DISPLAY' display like list alv

    Hi experts,
    I checked a standard tcode-IDCP.
    It will be displayed like grid alv if I run it directly. However, it will be displayed like list alv if I call the tcode using BDC in a z-report even it call function 'REUSE_ALV_GRID_DISPLAY'.
    Does anyone know why?
    Kindly help.

    Hi Franklin,
    I think when alv grid is running in background, it will be switched to basic list.
    Here I list a part of code in FM 'REUSE_ALV_GRID_DISPLAY' (From Line 106 in ECC6EHP5):
    if ( is_layout-allow_switch_to_list ne space
       and boolean eq if_salv_c_bool_sap=>true )
       or ( sy-binpt eq abap_true ).
         perform globals_push.
         call function 'REUSE_ALV_LIST_DISPLAY'
    endif.
    Thanks,
    Sam

  • Issue in Block list ALV

    Hi All,
    I want output in below format
    ***************************Page Heading****************
    List heading 1********************
                     LIST 1
    List Footer 1**********************
    List heading 2********************
                     LIST 2
    List Footer 2**********************
    List heading 3********************
                     LIST 3
    List Footer 3**********************
    I am trying with below code for two list but the order of Page heading and List heading 1 is interchanged. Please tell me whats the problem or please correct the part of code cuz of with the order is not coming correct.
    <b>code :</b>
    *& Report  ZTEST_IZHAR
    REPORT  ZTEST_IZHAR.
    Declarations for BLOCK ALV DISPLAY
    *--type pools
    TYPE-POOLS:slis.
    DATA:x_layout TYPE slis_layout_alv,
    t_field TYPE slis_t_fieldcat_alv,
    *--field catalog
    x_fldcat LIKE LINE OF t_field,
    *--to hold all the events
    t_events TYPE slis_t_event,
    x_events TYPE slis_alv_event,
    t_sort TYPE slis_t_sortinfo_alv,
    x_sort LIKE LINE OF t_sort ,
    *--Print Layout
    x_print_layout TYPE slis_print_alv.
    *----Macro to add field catalog.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    DEFINE add_catalog.
      clear x_fldcat.
      x_fldcat-fieldname = &1.
      x_fldcat-seltext_m = &2.
      x_fldcat-outputlen = &3.
      x_fldcat-tech = &4.
      x_fldcat-col_pos = &5.
      x_fldcat-no_zero = 'X'.
      x_fldcat-ddictxt = 'M'.
      x_fldcat-datatype = &6.
      x_fldcat-ddic_outputlen = &7.
      if &6 = 'N'.
        x_fldcat-lzero = 'X'.
      endif.
    *--build field catalog
      append x_fldcat to t_field.
    END-OF-DEFINITION.
    *----- data declerations.
    data: v_repid like sy-repid.
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    ernam like mara-ernam,
    meins like mara-meins,
    end of itab.
    data: begin of jtab occurs 0,
    matnr like makt-matnr,
    maktx like makt-maktx,
    end of jtab.
    select matnr ernam meins
    up to 20 rows
    from mara
    into table itab.
    select matnr maktx
    up to 20 rows
    from makt
    into table jtab.
    v_repid = sy-repid.
    *DISPLAY alv
    Initialize Block
    call function 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program = v_repid.
    *Block 1:
    *INITIALIZE
    refresh t_field. clear t_field.
    refresh t_events.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    add_catalog:
    'MATNR' 'Material' '18' '' '1' 'C' '18',
    'ERNAM' 'Created By' '12' '' '2' 'C' '12',
    'MEINS' 'Unit' '5' '' '3' 'C' '3'.
    *--build table for events TOP OF PAGE.
    x_events-form = 'TOP_OF_PAGE'.
    x_events-name = slis_ev_top_of_page.
    append x_events to t_events.
    *--build table for events TOP OF LIST1.
    x_events-form = 'TOP_OF_LIST1'.
    x_events-name = slis_ev_top_of_list.
    append x_events to t_events.
    *--build table for events END OF LIST1.
    x_events-form = 'END_OF_LIST1'.
    x_events-name = slis_ev_end_of_list.
    append x_events to t_events.
    call function 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                  = x_layout
        it_fieldcat                = t_field
        i_tabname                  = 'ITAB'
        it_events                  = t_events
        it_sort                    = t_sort
      TABLES
        t_outtab                   = itab
      EXCEPTIONS
        program_error              = 1
        maximum_of_appends_reached = 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.
    *--BLOCK 2(SUMMARY REPORT)
    *INITIALIZE
    refresh t_field. clear t_field.
    refresh t_events.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    add_catalog:
    'MATNR' 'Material' '20' '' '1' 'C' '18',
    'MAKTX' 'Description' '40' '' '2' 'C' '40'.
    *--build table for events TOP OF LIST2.
    x_events-form = 'TOP_OF_LIST2'.
    x_events-name = slis_ev_top_of_list.
    append x_events to t_events.
    *--build table for events END OF LIST2.
    x_events-form = 'END_OF_LIST2'.
    x_events-name = slis_ev_end_of_list.
    append x_events to t_events.
    Append table block.
    call function 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                  = x_layout
        it_fieldcat                = t_field
        i_tabname                  = 'JTAB'
        it_events                  = t_events
      TABLES
        t_outtab                   = jtab
      EXCEPTIONS
        program_error              = 1
        maximum_of_appends_reached = 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.
    *--CALL FM TO DISPLAY THE BLOCK REPORT.
    call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    exporting
    is_print = x_print_layout
    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.
    *&      Form  top_of_PAGE
          text
    form top_of_page.
    skip 1.
      WRITE: / '*******************************************'.
      WRITE : /10 'TOP OF PAGE'.
      WRITE: / '*******************************************'.
      skip 1.
      perform sub_display_heading.
      format reset.
    endform.                    "top_of_list2
    *&      Form  top_of_list1
          text
    form top_of_list1.
    skip 3.
      write: /5 'TOP OF LIST 1'.
      skip 1.
      format reset.
    endform.                    "top_of_list1
    *&      Form  end_of_list2
          text
    form end_of_list1.
      skip 1.
      write: /5 'END OF LIST 1'.
      skip 1.
      format reset.
    endform.                    "top_of_list2
    *&      Form  top_of_list2
          text
    form top_of_list2.
      skip 1.
      write: /5 'TOP OF LIST 2'.
      skip 1.
      format reset.
    endform.                    "top_of_list2
    *&      Form  end_of_list2
          text
    form end_of_list2.
      skip 1.
      WRITE:  /5 'END OF LIST 2'.
      skip 1.
      format reset.
    endform.                    "top_of_list2
    *&      Form  sub_display_heading
          text
    FORM sub_display_heading .
    ENDFORM.                    " sub_display_heading

    Hi ABAP related,
    Why dont you debug and see the scene yourself?
    Do not accumulate with this record.
    Total Questions:  77 (37 unresolved) 
    Cheers

  • How to include a Header in Hierarchy List (ALV)?

    Hi Gurus,
    If we need to include any header in ALV Grid, then we generate an event and pass that header to TOP_OF_PAGE event. We do have I_CALLBACK_TOP_OF_PAGE parameter for the REUSE_ALV_GRID_DISPLAY function module.
    But how do I generate a Header for a Hierarchy List? I do not find any parameter for TOP_OF_PAGE event. Please help with inputs.
    Regards,
    Kiran

    Hi Kiran,
                The  following codes are very useful to you...
    If any problem let me know...
    REPORT  zxxxxxxxxxxxxxx    LINE-SIZE 220
                               LINE-COUNT 50(5).
    *&                       DATA DECLARATION                              *
    TABLES: MARA,                      "GENERAL MASTER DATA
            MARC,                      "PLANT DATA FOR MATERIAL
            MARD,                      "STORAGE LOCATION DATA FOR MATERIAL
            MBEW,                      "MATERIAL VALUATION
            MVKE,                      "SALES DATA FOR MATERIAL
            MAKT,                      "MATERIAL DESCRIPTION
            EKKO,                      "PURCHASING DOCUMENT HEADER
            EKPO,                      "PURCHASING DOCUMENT ITEM
            VBAK,                      "SALES DOCUMENT HEADER DATA
            VBAP.                      "SALES DOCUMENT ITEM DATA
    TYPE-POOLS : SLIS.
    DATA: VT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
          V_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          V_LAYOUT TYPE SLIS_LAYOUT_ALV,
          BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
          BEGIN OF I_MARA OCCURS 0,
             MATNR LIKE MARA-MATNR,  "MATERIAL NUMBER
             MBRSH LIKE MARA-MBRSH,  "INDUSTRY SECTOR
             MEINS LIKE MARA-MEINS,  "BASE UNIT OF MEASURE
             MATKL LIKE MARA-MATKL,  "MATERIAL GROUP
          END OF I_MARA,
          BEGIN OF I_MARC OCCURS 0,
             MATNR LIKE MARC-MATNR,  "MATERIAL NUMBER
             WERKS LIKE MARC-WERKS,  "PLANT
             LVORM LIKE MARC-LVORM,  "FLAG MATERIAL FOR DELETION AT PLANT
                                      "LEVEL
             DISPO LIKE MARC-DISPO,  "MRP CONTROLLER
          END OF I_MARC,
          BEGIN OF I_MAKT OCCURS 0,
             MATNR LIKE MAKT-MATNR,  "MATERIAL NUMBER
             MAKTX LIKE MAKT-MAKTX,  "MATERIAL DESCRIPTION
             SPRAS LIKE MAKT-SPRAS,  "LANGUAGE KEY
          END OF I_MAKT,
          BEGIN OF I_MVKE OCCURS 0,
             MATNR LIKE MVKE-MATNR,  "MATERIAL NUMBER
             VKORG LIKE MVKE-VKORG,  "SALES ORGANIZATION
             VTWEG LIKE MVKE-VTWEG,  "DISTRIBUTION CHANNEL
          END OF I_MVKE,
          BEGIN OF I_MARD OCCURS 0,
            MATNR LIKE MARD-MATNR,  "MATERIAL NUMBER
            LGORT LIKE MARD-LGORT,  "STORAGE LOCATION
            LABST LIKE MARD-LABST,  "VALUATED STOCK WITH UNRESTRICTED USE
          END OF I_MARD,
          BEGIN OF I_EKPO OCCURS 0,
            EBELN LIKE EKPO-EBELN,  "PURCHASING DOCUMENT NUMBER
            EBELP LIKE EKPO-EBELP,  "ITEM NUMBER OF PURCHASING DOCUMENT
            MATNR LIKE EKPO-MATNR,  "MATERIAL NUMBER
          END OF I_EKPO,
          BEGIN OF I_VBAP OCCURS 0,
            VBELN LIKE VBAP-VBELN,  "SALES DOCUMENT
            POSNR LIKE VBAP-POSNR,  "SALES DOCUMENT ITEM
            MATNR LIKE VBAP-MATNR,  "MATERIAL NUMBER
          END OF I_VBAP,
          BEGIN OF I_OUT OCCURS 0,
            MATNR LIKE MARC-MATNR,
            WERKS LIKE MARC-WERKS,
            LVORM LIKE MARC-LVORM,
            DISPO LIKE MARC-DISPO,
            MBRSH LIKE MARA-MBRSH,
            MEINS LIKE MARA-MEINS,
            MATKL LIKE MARA-MATKL,
            VKORG LIKE MVKE-VKORG,
            VTWEG LIKE MVKE-VTWEG,
            SPRAS LIKE MAKT-SPRAS,
            MAKTX LIKE MAKT-MAKTX,
            LGORT LIKE MARD-LGORT,
            LABST LIKE MARD-LABST,
            EBELN LIKE EKPO-EBELN,
            EBELP LIKE EKPO-EBELP,
            VBELN LIKE VBAP-VBELN,
            POSNR LIKE VBAP-POSNR,
          END OF I_OUT,
          BEGIN OF I_HEADING OCCURS 0,
            TEXT1(20),
            TEXT2(20),
            TEXT3(20),
            TEXT4(20),
            TEXT5(20),
            TEXT6(20),
            TEXT7(20),
            TEXT8(20),
            TEXT9(20),
            TEXT10(20),
            TEXT11(40),
            TEXT12(20),
            TEXT13(20),
            TEXT14(20),
            TEXT15(20),
            TEXT16(20),
            TEXT17(20),
          END OF I_HEADING.
    *&                   S E L E C T I O N - S C R E E N                   *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-100.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR. "OBLIGATORY.
    PARAMETERS: P_WERKS LIKE MARC-WERKS. "OBLIGATORY.
    SELECT-OPTIONS: S_LGORT FOR MARD-LGORT,
                    S_DISPO FOR MARC-DISPO,
                    S_EBELN FOR EKPO-EBELN .
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-101.
    PARAMETERS : RB1 RADIOBUTTON GROUP G1,
                 RB2 RADIOBUTTON GROUP G1,
                 RB3 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK B2.
    *&             S T A R T - O F - S E L E C T I O N                     *
    START-OF-SELECTION.
      SELECT MATNR WERKS LVORM DISPO FROM MARC
      INTO CORRESPONDING FIELDS OF TABLE I_MARC
                          WHERE MATNR IN S_MATNR
                          AND DISPO IN S_DISPO
                          AND WERKS = P_WERKS.
      IF I_MARC[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARC'.
        EXIT.
      ENDIF.
      PERFORM PURCHASEDATA_VALIDATION.
      PERFORM SALESDATA_VALIDATION.
      SELECT MATNR LGORT LABST FROM MARD INTO TABLE  I_MARD
                          FOR ALL ENTRIES IN I_MARC
                          WHERE MATNR = I_MARC-MATNR
                          AND WERKS EQ P_WERKS
                          AND LGORT IN S_LGORT.
      IF I_MARD[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARD'.
        EXIT.
      ENDIF.
      SELECT MATNR VKORG VTWEG FROM MVKE INTO TABLE I_MVKE
                          FOR ALL ENTRIES IN I_MARC
                          WHERE MATNR = I_MARC-MATNR.
      IF I_MVKE[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MVKE'.
        EXIT.
      ENDIF.
      LOOP AT I_MARC.
        MOVE-CORRESPONDING I_MARC TO I_OUT.
        CLEAR MARC.
        SELECT SINGLE MATNR MBRSH MEINS MATKL FROM MARA
                          INTO CORRESPONDING FIELDS OF MARA
                          WHERE MATNR = I_OUT-MATNR.
        IF SY-SUBRC = 0.
          MOVE: MARA-MBRSH TO I_OUT-MBRSH,
                MARA-MEINS TO I_OUT-MEINS,
                MARA-MATKL TO I_OUT-MATKL.
        ELSE.
          CONTINUE.
        ENDIF.
        SELECT SINGLE MATNR MAKTX SPRAS FROM MAKT
                        INTO  CORRESPONDING FIELDS OF MAKT
                        WHERE  MATNR = I_OUT-MATNR.
        IF SY-SUBRC = 0.
          MOVE: MAKT-MAKTX TO I_OUT-MAKTX,
                MAKT-SPRAS TO I_OUT-SPRAS.
        ELSE.
          CONTINUE.
        ENDIF.
        LOOP AT I_EKPO WHERE MATNR =  I_MARC-MATNR.
          MOVE: I_EKPO-EBELN TO I_OUT-EBELN,
                I_EKPO-EBELP TO I_OUT-EBELP.
        ENDLOOP.
        LOOP AT I_VBAP WHERE MATNR =  I_MARC-MATNR.
          MOVE: I_VBAP-VBELN TO I_OUT-VBELN,
                I_VBAP-POSNR TO I_OUT-POSNR.
        ENDLOOP.
        LOOP AT I_MARD WHERE MATNR = I_MARC-MATNR.
          MOVE: I_MARD-LABST TO I_OUT-LABST,
                I_MARD-LGORT TO I_OUT-LGORT.
        ENDLOOP.
        LOOP AT I_MVKE WHERE MATNR = I_MARC-MATNR.
          MOVE: I_MVKE-VKORG TO I_OUT-VKORG,
                I_MVKE-VTWEG TO I_OUT-VTWEG.
          APPEND I_OUT.
        ENDLOOP.
        CLEAR I_OUT.
      ENDLOOP.
      PERFORM OPTIONS.
                         FORM  OPTIONS                                *
    FORM OPTIONS.
      IF RB2 = 'X'.
        PERFORM FIELDCAT.
        PERFORM OUTPUT.
      ELSE.
        IF RB1 = 'X'.
          PERFORM HEADINGS.
          PERFORM DLOAD.
        ELSE.
          IF RB3 = 'X'.
            PERFORM HEADINGS.
            PERFORM DLOAD.
            PERFORM FIELDCAT.
            PERFORM OUTPUT.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "OPTIONS
                         FORM  HEADINGS                               *
    FORM HEADINGS.
      I_HEADING-TEXT1 = 'MATNR'.
      I_HEADING-TEXT2 = 'WERKS'.
      I_HEADING-TEXT3 = 'LVORM'.
      I_HEADING-TEXT4 = 'DISPO'.
      I_HEADING-TEXT5 = 'MBRSH'.
      I_HEADING-TEXT6 = 'MEINS'.
      I_HEADING-TEXT7 = 'MATKL'.
      I_HEADING-TEXT8 = 'VKORG'.
      I_HEADING-TEXT9 = 'VTWEG'.
      I_HEADING-TEXT10 = 'SPRAS'.
      I_HEADING-TEXT11 = 'MAKTX'.
      I_HEADING-TEXT12 = 'LGORT'.
      I_HEADING-TEXT13 = 'LABST'.
      I_HEADING-TEXT14 = 'EBELN'.
      I_HEADING-TEXT15 = 'EBELP'.
      I_HEADING-TEXT16 = 'VBELN'.
      I_HEADING-TEXT17 = 'POSNR'.
      APPEND I_HEADING.
    ENDFORM.                    "HEADINGS
                         FORM  DLOAD                                  *
    FORM DLOAD.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME              = 'C:\MATSTK.XLS'
          FILETYPE              = 'DAT'
          WRITE_FIELD_SEPARATOR = 'X'
        TABLES
          DATA_TAB              = I_HEADING
        EXCEPTIONS
          FILE_WRITE_ERROR      = 1.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME              = 'C:\MATSTK.XLS'
          FILETYPE              = 'DAT'
          APPEND                = 'X'
          WRITE_FIELD_SEPARATOR = 'X'
        TABLES
          DATA_TAB              = I_OUT.
    ENDFORM.                    "DLOAD
                              FORM  FIELDCAT                          *
    FORM FIELDCAT.
      V_FIELDCAT-COL_POS = '1'.
      V_FIELDCAT-FIELDNAME     = 'MATNR'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-HOTSPOT = 'X'.
      V_FIELDCAT-REF_FIELDNAME = 'MATNR'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '2'.
      V_FIELDCAT-FIELDNAME     = 'WERKS'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'WERKS'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '3'.
      V_FIELDCAT-FIELDNAME     = 'LVORM'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'LVORM'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '4'.
      V_FIELDCAT-FIELDNAME     = 'DISPO'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'DISPO'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '5'.
      V_FIELDCAT-FIELDNAME     = 'MBRSH'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MBRSH'.
      V_FIELDCAT-REF_TABNAME   = 'MARA'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '6'.
      V_FIELDCAT-FIELDNAME     = 'MEINS'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MEINS'.
      V_FIELDCAT-REF_TABNAME   = 'MARA'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '7'.
      V_FIELDCAT-FIELDNAME     = 'MATKL'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MATKL'.
      V_FIELDCAT-REF_TABNAME   = 'MARA'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '8'.
      V_FIELDCAT-FIELDNAME     = 'VKORG'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'VKORG'.
      V_FIELDCAT-REF_TABNAME   = 'MVKE'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '9'.
      V_FIELDCAT-FIELDNAME     = 'VTWEG'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'VTWEG'.
      V_FIELDCAT-REF_TABNAME   = 'MVKE'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '10'.
      V_FIELDCAT-FIELDNAME     = 'SPRAS'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'SPRAS'.
      V_FIELDCAT-REF_TABNAME   = 'MAKT'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '11'.
      V_FIELDCAT-FIELDNAME     = 'MAKTX'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MAKTX'.
      V_FIELDCAT-REF_TABNAME   = 'MAKT'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '12'.
      V_FIELDCAT-FIELDNAME     = 'LGORT'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'LGORT'.
    V_FIELDCAT-REF_TABNAME   = 'MARD'.
      V_FIELDCAT-SELTEXT_L = 'STRG LOCT'.
      V_FIELDCAT-OUTPUTLEN = 10.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '13'.
      V_FIELDCAT-FIELDNAME     = 'LABST'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-SELTEXT_M = 'STOCK'.
      V_FIELDCAT-OUTPUTLEN = 15.
    V_FIELDCAT-REF_FIELDNAME = 'LABST'.
    V_FIELDCAT-REF_TABNAME   = 'MARD'.
      V_FIELDCAT-DO_SUM = 'X'.
      V_LAYOUT-TOTALS_TEXT = 'TOTAL STOCK:'.
      V_FIELDCAT-HOTSPOT = 'X'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '14'.
      V_FIELDCAT-FIELDNAME     = 'EBELN'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-HOTSPOT = 'X'.
      V_FIELDCAT-REF_FIELDNAME = 'EBELN'.
      V_FIELDCAT-REF_TABNAME   = 'EKPO'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '15'.
      V_FIELDCAT-FIELDNAME     = 'EBELP'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'EBELP'.
      V_FIELDCAT-REF_TABNAME   = 'EKPO'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '16'.
      V_FIELDCAT-FIELDNAME     = 'VBELN'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-HOTSPOT = 'X'.
      V_FIELDCAT-REF_FIELDNAME = 'VBELN'.
      V_FIELDCAT-REF_TABNAME   = 'VBAP'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '17'.
      V_FIELDCAT-FIELDNAME     = 'POSNR'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'POSNR'.
      V_FIELDCAT-REF_TABNAME   = 'VBAP'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
    ENDFORM.                      "FIELDCAT
                              FORM  OUTPUT                            *
    FORM OUTPUT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM      = SY-REPID
          I_CALLBACK_TOP_OF_PAGE  = 'TOP-OF-PAGE'
          I_GRID_TITLE = 'CLICK ON MATERIAL/PURDOC/SALESDOC FOR DETAILS'
          I_CALLBACK_USER_COMMAND = 'DISPLAYDETAILS'
          IS_LAYOUT               = V_LAYOUT
          IT_FIELDCAT             = VT_FIELDCAT1
        TABLES
          T_OUTTAB                = I_OUT.
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    "OUTPUT
                            FORM  TOP-OF-PAGE                         *
    FORM TOP-OF-PAGE.
      DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
            WA_HEADER TYPE SLIS_LISTHEADER.
      WA_HEADER-TYP = 'H'.
      WA_HEADER-INFO = 'REPORT FOR : '.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP = 'S'.
      WA_HEADER-INFO = 'MATERIAL DETAILS'.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP = 'S'.
      WA_HEADER-INFO = 'PURCHASE ORDER DETAILS'.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP = 'S'.
      WA_HEADER-INFO = 'SALES ORDER DETAILS'.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          I_LOGO             = 'GEAR'
          IT_LIST_COMMENTARY = T_HEADER.
    ENDFORM.                    "TOP-OF-PAGE
    *&                       FORM  DISPLAYDETAILS                          *
    FORM DISPLAYDETAILS USING UCOMM LIKE SY-UCOMM
          SELFIELD TYPE SLIS_SELFIELD.
      IF SELFIELD-FIELDNAME = 'EBELN'.
        IF UCOMM = '&IC1'.
          READ TABLE I_OUT INDEX SELFIELD-TABINDEX.
          PERFORM PORECDNG.
          CLEAR BDCDATA[].
        ENDIF.
      ELSE.
        IF SELFIELD-FIELDNAME = 'MATNR'.
          IF UCOMM = '&IC1'.
            READ TABLE I_OUT INDEX SELFIELD-TABINDEX.
            PERFORM MMRECDNG.
            CLEAR BDCDATA[].
          ENDIF.
        ELSE.
          IF SELFIELD-FIELDNAME = 'VBELN'.
            IF UCOMM = '&IC1'.
              READ TABLE I_OUT INDEX SELFIELD-TABINDEX.
              PERFORM SALESRECDNG.
              CLEAR BDCDATA[].
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "DISPLAYDETAILS
                        FORM PORECDNG                                   *
    FORM PORECDNG.
    perform bdc_dynpro      using 'SAPMM06E' '0105'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RM06E-BSTNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RM06E-BSTNR'
                                  I_OUT-EBELN.
    perform bdc_dynpro      using 'SAPMM06E' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RM06E-BSTPO(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=AH'.
    perform bdc_field       using 'RM06E-EBELP'
                                  I_OUT-EBELP.
    perform bdc_field       using 'RM06E-TCSELFLAG(01)'
                                  'X'.
    perform bdc_transaction using 'ME23'.
    ENDFORM.                    "PORECDNG
                        FORM MMRECDNG                                   *
    FORM MMRECDNG.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0060'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'RMMG1-MATNR'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'RMMG1-MATNR'
                                    I_OUT-MATNR.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0070'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'MSICHTAUSW-DYTXT(01)'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '=ENTR'.
      PERFORM BDC_FIELD       USING 'MSICHTAUSW-KZSEL(01)'
                                    'X'.
      PERFORM BDC_TRANSACTION USING 'MM03'.
    ENDFORM.                    "MMRECDNG
                        FORM SALESRECDNG                                *
    FORM SALESRECDNG.
      PERFORM BDC_DYNPRO      USING 'SAPMV45A' '0102'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'VBAK-VBELN'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'VBAK-VBELN'
                                    I_OUT-VBELN.
      PERFORM BDC_TRANSACTION USING 'VA03'.
    ENDFORM.                    "SALESRECDNG
                     FORM BDC_TRANSACTION                               *
    FORM BDC_TRANSACTION USING TCODE.
      CALL TRANSACTION TCODE USING BDCDATA MODE 'E'.
    ENDFORM.                    "BDC_TRANSACTION
                           FORM BDC_DYNPRO                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM = PROGRAM.
      BDCDATA-DYNPRO = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_DYNPRO
                           INSERT FIELD                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      CLEAR BDCDATA.
      BDCDATA-FNAM = FNAM.
      BDCDATA-FVAL = FVAL.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_FIELD
    *&                  FORM  PURCHASEDATA_VALIDATION                      *
    FORM PURCHASEDATA_VALIDATION.
      SELECT EBELN EBELP MATNR
                 FROM EKPO
                 INTO TABLE I_EKPO
                 FOR ALL ENTRIES IN I_MARC
                 WHERE MATNR = I_MARC-MATNR
                 AND EBELN IN S_EBELN
                 AND WERKS EQ P_WERKS.
      IF I_EKPO[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA IS SELECTED FROM TABLE EKPO'.
        EXIT.
      ENDIF.
      DATA: T_EKPO LIKE I_EKPO OCCURS 0 WITH HEADER LINE.
      T_EKPO[] = I_EKPO[].
      REFRESH I_EKPO.
      FREE I_EKPO.
      LOOP AT T_EKPO.
        SELECT SINGLE EBELN FROM EKKO INTO EKPO-EBELN
        WHERE EBELN = T_EKPO-EBELN.
        IF SY-SUBRC = 0.
          MOVE-CORRESPONDING T_EKPO TO I_EKPO.
          APPEND I_EKPO.
          CLEAR I_EKPO.
        ELSE.
          CONTINUE.
        ENDIF.
      ENDLOOP.
      SORT I_EKPO.
    ENDFORM.                    "PURCHASEDATA_VALIDATION
    *&                  FORM  SALESDATA_VALIDATION                         *
    FORM SALESDATA_VALIDATION.
      SELECT VBELN POSNR MATNR
              FROM VBAP
              INTO CORRESPONDING FIELDS OF TABLE
              I_VBAP FOR ALL ENTRIES IN I_MARC
              WHERE MATNR = I_MARC-MATNR.
      DATA: T_VBAP LIKE I_VBAP OCCURS 0 WITH HEADER LINE.
      T_VBAP[] = I_VBAP[].
      REFRESH I_VBAP.
      FREE I_VBAP.
      LOOP AT T_VBAP.
        SELECT SINGLE VBELN FROM VBAK INTO VBAK-VBELN
        WHERE VBELN = T_VBAP-VBELN.
        IF SY-SUBRC = 0.
          MOVE-CORRESPONDING T_VBAP TO I_VBAP.
          APPEND I_VBAP.
          CLEAR I_VBAP.
        ELSE.
          CONTINUE.
        ENDIF.
      ENDLOOP.
      SORT I_VBAP.
    ENDFORM.                    "SALESDATA_VALIDATION
    ..........................FOr Hierarchy List...................
    REPORT  Zxxxxxxxxxx NO STANDARD PAGE HEADING.
    **********DECLARING TABLES********************************************
    TYPE-POOLS: slis.
    TABLES: EKKO, "PO HEADER
            EKPO. "PO ITEM
    **********DECLARING DATA**********************************************
    DATA: ET_EKKO TYPE EKKO OCCURS 0 WITH HEADER LINE,
          ET_EKPO TYPE EKPO OCCURS 0 WITH HEADER LINE,
          ET_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
          ET_LAYOUT TYPE SLIS_LAYOUT_ALV,
          ET_KEYINFO TYPE SLIS_KEYINFO_ALV,
          ET_REPID LIKE SY-REPID.
    DATA: ET_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    DATA: ET_EVENTS TYPE SLIS_T_EVENT.
    **********SELECTION CRITERIA****************************************
    SELECTION-SCREEN BEGIN OF BLOCK RAD1 WITH FRAME TITLE TEXT-003.
    SELECT-OPTIONS: S_EBELN FOR ET_EKPO-EBELN OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK RAD1.
    INITIALIZATION.
      ET_KEYINFO-HEADER01 = 'EBELN'.
      ET_KEYINFO-ITEM01   = 'EBELN'.
      ET_SORT-FIELDNAME = 'EBELN'.
      ET_SORT-TABNAME     = '2'.
      ET_SORT-SPOS        = 1.
      ET_SORT-UP         = 'X'.
      ET_SORT-SUBTOT     = 'X'.
      APPEND ET_SORT.
      ET_SORT-FIELDNAME = 'EBELP'.
      ET_SORT-TABNAME     = '2'.
      ET_SORT-SPOS        = 1.
    APPEND ET_SORT.
      ET_FIELDCAT-FIELDNAME   = 'NETWR'.
      ET_FIELDCAT-TABNAME       = '2'.
      ET_FIELDCAT-OUTPUTLEN = 8.
      ET_FIELDCAT-DO_SUM       = 'X'.
      ET_FIELDCAT-HOTSPOT       = 'X'.
      APPEND ET_FIELDCAT.
    START-OF-SELECTION.
      SELECT EBELN BUKRS AEDAT ERNAM FROM EKKO INTO CORRESPONDING
             FIELDS OF TABLE ET_EKKO
             WHERE EBELN IN S_EBELN.
      SELECT * FROM EKPO INTO CORRESPONDING FIELDS
               OF TABLE ET_EKPO FOR ALL ENTRIES IN
               ET_EKKO WHERE EBELN = ET_EKKO-EBELN.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
          I_STRUCTURE_NAME_HEADER = 'EKKO'
          I_STRUCTURE_NAME_ITEM   = 'EKPO'
          IS_KEYINFO              = ET_KEYINFO " The structure contains the
                                               " header and item table
                                               " field names which links the
                                               " the two tables(shared key)
          IS_LAYOUT               = ET_LAYOUT
          IT_FIELDCAT             = ET_FIELDCAT[]
          I_TABNAME_HEADER        = '1' " Name of the internal table in the
                                        " program containing the output data
                                        " of the highest hierarchy level
          I_TABNAME_ITEM          = '2' " Name of the internal table in the
                                        " program containing the output data
                                        " of the highest hierarchy level
          IT_EVENTS               = ET_EVENTS[]
          IT_SORT                 = ET_SORT[]
        TABLES
          T_OUTTAB_HEADER         = ET_EKKO " Header table with data to be
                                             " output
          T_OUTTAB_ITEM           = ET_EKPO. " Name of the internal table in
                                             " the program containing the
                                             " output data of the lowest
                                             "hierarchy level.
    Regards,,
    Satya Kumar..

  • Regarding list alv display

    Hi All,
    I am catching double click event in user command for alv list display,where we get one structure filled on runtime called slis_selfield upon double clicking on alv rows. in this structure i am not getting the field 'sel_tab_field' filled. and i am in need of that field value.
    can you help me out in this regard.
    Thanks in advance.
    Regards
    Ashutosh

    Hi ,
    FORM user_command USING p_ucomm LIKE sy-ucomm
    f_selfield TYPE slis_selfield.
    capture double click event on document number created.
    CASE p_ucomm.
    WHEN '&IC1'.
    IF f_selfield-tabname EQ 'I_DOC_CREATED'.
    CHECK NOT f_selfield-value IS INITIAL.
    SET PARAMETER ID 'BLN' FIELD f_selfield-value.
    SET PARAMETER ID 'BUK' FIELD so_bukrs-low.
    SET PARAMETER ID 'GJR' FIELD w_gjahr.
    CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
    ELSEIF f_selfield-tabname EQ 'I_ELOG'.
    CHECK NOT f_selfield-value IS INITIAL.
    SET PARAMETER ID 'BLN' FIELD f_selfield-value.
    SET PARAMETER ID 'BUK' FIELD so_bukrs-low.
    SET PARAMETER ID 'GJR' FIELD w_gjahr.
    CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDCASE.
    I am not getting fieldname field of slis_selfield populated upon double clicking

Maybe you are looking for