ALV Concept

Hi Experts
can anyone give me a good documentation on ALV grid controls.
Thanks

hi sai,
TYPE BALV IN SE38 AND CHECK OUT THE DEMO PROGRAMS
check these links...
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/22/a3f601d2fe11d2b467006094192fe3/frameset.htm
http://www.sapdevelopment.co.uk/reporting/alvhome.htm
http://www.sappoint.com/ppt/alv.ppt
http://www.sap-img.com/abap/sample-alv-heading-in-alv.htm
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://www.geocities.com/mpioud/Abap_programs.html
hope this helps,
do reward if it helps,
priya.

Similar Messages

  • Oop's alv concept

    dear expert ,
        i am not getting output in oops Alv. i m in learning state  .Please help me
        my code : -
    REPORT  ZTEST12_O2.
    TYPE-POOLS: ICON.
    TYPE-POOLS:SYM.
    TABLES : VBRK.
    data itab TYPE TABLE OF vbrk WITH HEADER LINE .
    DATA : IT_FCAT TYPE STANDARD TABLE OF LVC_S_FCAT WITH HEADER LINE,
            O_DOCKING TYPE REF TO CL_GUI_DOCKING_CONTAINER,"Docking Container
            o_container TYPE REF TO cl_gui_custom_container,
            O_GRID TYPE REF TO CL_GUI_ALV_GRID.
    data G_CONTAINER TYPE SCRFNAME VALUE 'BCALV_GRID_DEMO_0100_CONT1'.
    SELECT * FROM VBRK INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE FKDAT => '20090401' AND FKDAT =< '20090404' .
    CALL SCREEN 9000.
    *&      Module  STATUS_9000  OUTPUT
          text
    MODULE STATUS_9000 OUTPUT.
      SET PF-STATUS 'ZSTATUS'.
      SET TITLEBAR 'ASH01'.
    Creating Docking Container and grid
      PERFORM CREATE_OBJECT.
    Filling the fieldcatalog table
      PERFORM CREATE_FIELDCAT.
    Modifying the fieldcatalog table
      PERFORM MODIFY_FIELDCAT.
    Displaying the output
      PERFORM DISPLAY_OUTPUT.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9000  INPUT
          text
    MODULE USER_COMMAND_9000 INPUT.
    CASE SY-UCOMM.
      WHEN 'UP'.
        LEAVE PROGRAM.
      WHEN 'CANCLE'.
        LEAVE PROGRAM.
      WHEN OTHERS.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Form  CREATE_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM CREATE_FIELDCAT .
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
      I_BUFFER_ACTIVE              =
         I_STRUCTURE_NAME             = 'VBRK'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_BYPASSING_BUFFER           =
      I_INTERNAL_TABNAME           =
        CHANGING
          CT_FIELDCAT                  = IT_FCAT[]
    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.
    ENDFORM.                    " CREATE_FIELDCAT
    *&      Form  CREATE_OBJECT
          text
    -->  p1        text
    <--  p2        text
    FORM CREATE_OBJECT .
    CREATE OBJECT O_DOCKING EXPORTING
                               RATIO = '90'.
      CREATE OBJECT o_container EXPORTING
                                CONTAINER_NAME = G_CONTAINER.
    CREATE OBJECT O_GRID EXPORTING
             I_PARENT = O_DOCKING.
        CREATE OBJECT O_GRID EXPORTING
              I_PARENT = o_container.
    ENDFORM.                    " CREATE_OBJECT
    *&      Form  DISPLAY_OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_OUTPUT .
      CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
         is_variant                    = w_variant
         i_save                        = ' '
        CHANGING
          IT_OUTTAB                     = ITAB[]
          IT_FIELDCATALOG               = IT_FCAT[]
        EXCEPTIONS
          INVALID_PARAMETER_COMBINATION = 1
          PROGRAM_ERROR                 = 2
          TOO_MANY_LINES                = 3
          OTHERS                        = 4.
      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_OUTPUT
    Thanks ,
    ashish
    Moderator message:  these forums cannot replace proper training, please search for available documentation or attend classes, remote debugging of entire programs is not supported.
    Edited by: Thomas Zloch on Oct 27, 2010 2:27 PM

    Hi naren,
       Thanks for coming to my rescue once again. I have actually just made the changes and its working fine. Its the same problem which you have analyzed. I already got the requried output. Anyway thanks again.
    regards,
    rajasekhar.

  • Displaying Custom Error Message in ALV

    Hello Experts,
    Usually, when an error occurs in editable ALV, the standard WD ALV functionality marks the particular error cell in red and displays the error message.
    I want the same functionality for custom error messages in event ON_DATA_CHECK. I'm able to display the message, but looking for a way to mark cells as well.
    Please help....

    Hello friend,
    I think this link will help you much more clear on the coloring of the ALV concepts.
    http://help.sap.com/saphelp_smehp1/helpdata/en/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393?QuickLink=index&overridelayout=true
    Thanks,
    Sri Hari

  • Logic For Subtracting A Given Output In ALV Report

    Hi,
    I am working on a report in which i am using ALV Concept and there a problem arise i.e. in ALV Report output which always subtotals having values in addition only and i want to know is there any way through which subtraction can also be performed within the output of a ALV Report.
    Please provide some guidelines for it.
    Regards,
    Rickky NV

    Hi,
    Thanks to both of you for your value able response. Actually, i am working on customer aging analysis report in which there are 2 columns i.e. debit and credit in which these both values are stored in 2 separate lines  and i have to display the difference of them in the 3rd column and facing the problem.
    Is it possible to display the required data of it in 3rd column  of it? 
    Regards,
    Ricky

  • How to make a row as selected in output internal table in oops ALV

    Hi All,
    I have ALV grid output using oops ALV concept, in my output i have a checkbox as first column when i select this checkbox and press a push button 'Print' which is there above ALV grid that particular line in output table should get selected and i need to code some logic for printing selected row.
    how to make the particluar row in the output internal table to be selected and where to write the logic for print once it is pressed?
    Thanks in advance
    Srilakshmi.

    but the checkbox is not getting set in internal table when i select some checkboxes.
    can anybody explain y the checkbox in internal table not set?
    Hi Srilakshmi,
    As explained by Uwe, when we change a field ( say check box ) in ALV grid, the view (frontend) changes (showing the tick mark) but the changed data ( normally ) is not transfered to the backend.
    We can initiate this data transfer by just registering the cl_gui_alv_grid=>mc_evt_modified  edit event
      go_grid->set_table_for_first_display( CHANGING  it_fieldcatalog      = pt_fieldcat
                                                      it_outtab            = pt_outtab ).
      go_grid->set_ready_for_input( 1 ).
      go_grid->register_edit_event( EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified ). " This does the trick
    Now as soon as we check a checkbox, the data_changed event is triggered.
    This initiates data transfer to the backend and the checkbox field in internal table is updated.
    check the below code for example.
    DATA: go_cont            TYPE REF TO cl_gui_custom_container,
          go_grid            TYPE REF TO cl_gui_alv_grid,
          gt_fieldcat        TYPE lvc_t_fcat,
          gv_language        TYPE spras VALUE 'E',
          gt_outtab          TYPE TABLE OF bus_loca_demo WITH HEADER LINE.
    START-OF-SELECTION.
      CALL SCREEN 100.
    *       MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'BASIC'.
      SET TITLEBAR  '001'.
      PERFORM create_and_init_alv CHANGING gt_outtab[]
                                           gt_fieldcat.
    ENDMODULE.                    "pbo OUTPUT
    *       MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'PRINT'.
          BREAK-POINT.
      ENDCASE.
    ENDMODULE.                    "pai INPUT
    FORM create_and_init_alv CHANGING pt_outtab LIKE gt_outtab[]
                                      pt_fieldcat TYPE lvc_t_fcat.
      CHECK go_cont IS NOT BOUND.
      CREATE OBJECT go_cont
        EXPORTING
          container_name = 'CUSTOM'.
      CREATE OBJECT go_grid
        EXPORTING
          i_parent = go_cont.
      PERFORM build_display_table.
      PERFORM build_fieldcat CHANGING pt_fieldcat.
      go_grid->set_table_for_first_display( CHANGING  it_fieldcatalog      = pt_fieldcat
                                                      it_outtab            = pt_outtab ).
      go_grid->set_ready_for_input( 1 ).
      go_grid->register_edit_event( EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified ). " This does the trick
    ENDFORM.                               "CREATE_AND_INIT_ALV
    FORM build_display_table.
      FREE gt_outtab.
      DO 10 TIMES.
        gt_outtab-creation_partner = sy-index.
        gt_outtab-date_field       = sy-datum.
        APPEND gt_outtab.
      ENDDO.
    ENDFORM.                               "build_display_table
    FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'BUS_LOCA_DEMO'
        CHANGING
          ct_fieldcat      = pt_fieldcat.
      LOOP AT pt_fieldcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN 'CHECKBOX'.
            ls_fcat-checkbox = 'X'.
            ls_fcat-edit     = abap_true.
            MODIFY pt_fieldcat FROM ls_fcat.
          WHEN 'ENTER_FIELD' OR 'DBLCLICK_FIELD'.
            ls_fcat-no_out  = abap_true.
            MODIFY pt_fieldcat FROM ls_fcat.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                               "build_fieldcat
    Cheers,
    Jose.

  • ALV Print Options

    Hi,
    I have a report program, made using oops ALV concept. The requirement is such that if the report output displays 10 rows, and if you select 5 rows and say PRINT then only those selected 5 rows should be printed.
    In the standard print functionality this is not possible. Could you please suggest an appropriate work-around for this issue?
    Thanks in Advance,
    Shivali

    Hi Shivali,
    As an alternative you may define a USER COMMAND event .
    Create a button on toolbar, which perform the print operation for those selected rows.
    Something like this -
    FORM user_command USING u_ucomm TYPE syucomm
    us_selfield TYPE slis_selfield. "#EC CALLED
    CASE u_ucomm.
    WHEN 'PRINT'.
    *Call the print operation
    ENDCASE.
    ENDFORM.
    Regards,
    Amit

  • Problem in OOP ALV-ALV not displaying.

    Hi Gurus,
    Can we use OOP alv concept in normal executable program or we need to do it in module pool ?
    I did an example alv program..but it is not exectuing .
    Can anybody tell me the answer ?
    Thanks.

    Hello,
    To use OO ALV you need to create a container in module pool. But you can still call it from an executable program. Just create an executable program and use call screen 0100. Now double click on 0100 and create a screen which has a container on it then in the PBO module just caal the methods for the custom container and alv. Upon execution of the program, the alv will be displayed.
    Regards,
    Sachin

  • End-of-page in OOABAP Reports

    Hi,
    I'm displaying a list in a grid using OOABAP Global classes.
    1)Could anyone post how to handle the end-of-page events in this case.
    2) Also in this case I've to code for Interactive Reporting, So also please say how to handle this parallelly for the upcoming basic lists of the same report.
    <<don't post stupid questions>>
    Edited by: Vijay Babu Dudla on Nov 18, 2008 9:16 PM

    Why are opening separates thread on all issues which all are related to BASIC ALV concepts?
    At-New using ALV  Function Modules
    New-page  issue in OOABAP Report
    At New in OOABAP Report
    Continue with one thread and search in SCN there are many examples are there with code.

  • How to create more than 21 lists in interactive reports

    hello everyone,
    I am new to ABAP as well as this site. Kindly help, I want to know how to create more than 21 lists in interactive reports.
    Also, how can i create them without using WHEN 1, wHEN 2 and so on...
    Kindly help.
    thank you

    Hello,
    Using Intracive Reports its not possible to cretate more than 21 lists.
    But its possible to create more than 21 using ALV concept.
    for sample ALV u can serch in SDN.
    Regards,
    Anil.

  • Custom Report of MD04 with the summarized section

    Hello..
    Im using the FM MD_STOCK_REQUIREMENTS_LIST_API  to get the MD04 data (detailed)
    But now I have the request to show the summarized data of the MD04. Summarized by days, weeks and months...
    do you know what FM I can use to get that information?

    Hello,
    We did the same development to display the Stock Requirement list in Months /Days/Weeks with summerizatin of Different MRP Elements stock into report using Hierrarchical ALV concept.
    Function Module :MD_STOCK_REQUIREMENTS_LIST_API  will give you the data as it is avaialble in MD04 thereafter we need to summerize quantity based on MDPSX-DAT00 and MDPSX-DELKZ field
    (MDPSX is the result table after executing the function module.)
    Please let me know if you are not clear ...
    Regards
    Edited by: shishupalreddy ramreddy on Jun 11, 2009 11:31 PM

  • Double click from OOALV Display to call relevant field transaction

    Hi,
    In program used the below code to dispaly ALV grid.
         CALL METHOD OBJ_GRID_DETAIL->SET_TABLE_FOR_FIRST_DISPLAY
            EXPORTING
              IS_LAYOUT       = X_LAYOUT
              IS_VARIANT      = X_VARIANT
              I_SAVE          = 'A'
            CHANGING
              IT_FIELDCATALOG = IT_FLDCAT_DETAILS
              IT_OUTTAB       = IT_ORDERS[]
    The display contains Sales order number, material etc.
    If double click on sales order number, should call the transaction VA03 etc.
    I am new to OOPS, please suggest me.
    Thanks
    Hema

    Please try this,
    FORM handle_double_click
         USING i_row TYPE lvc_s_row
               i_column TYPE lvc_s_col
                  is_row_no TYPE lvc_s_roid.
    READ TABLE IT_ORDERS[] INDEX is_row_no-row_id .
    IF sy-subrc = 0 AND i_column-fieldname = 'VBELN' .
    * Set the Parameter Id for the Sales Order Number
    SET PARAMETER ID 'AUN' FIELD IT_ORDERS-vbeln.
    CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
    ENDIF .
    ENDFORM .
    The below document explains all the event handling and OO ALV concepts,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    Regards
    Kathirvel

  • Generic table updation

    Hi All,
        I have a requirement as follows.
    when a user enters any table on selection screen (standard , custom table etc) the tabel contenets shud be displayed in an ALV grid... it also has to be editable and the changes shud be updated in the table.
    I have figured out the dynamic alv concept using field smbols is to be used..
    but i need detailed steps.. can anybody help me?
    Points will definitely be rewarded.

    Hello,
    I hope you are asking in ABAP, if so then why you want to post in Webdynpro java forum.
    Please change.
    REgards
    Nizamudeen SM

  • F4 HELP IN OUTPUT LIST

    i m geting report list in output. i want to f4 help in list its possible der frnds

    Hi Basavaraju,
    SCN means SAP Community network,
    going with your issue,
    you want a f4 help in the output list right?
    You can do it with the ALV concept
    http://help.sap.com/saphelp_nw70/helpdata/EN/bf/3bd1369f2d280ee10000009b38f889/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/EN/8d/e994374c9cd355e10000009b38f8cf/frameset.htm
    Revert for code snippet if you wish so
    Thanks and Regards
    Srikanth.P

  • Plz tell this ans

    in reports i have 75 records if i want to display 10 records in each page so top-or-page & end-of-page how many times triggers plz tell me
    Thank you
    Rajesh.M

    hi,
    why don't u use alv concept. it will be more useful to you .
    if u wanna display  75 records and moreover,i think u dont need to display all the 75 fields at a single time as u can use the filter for it.
    i am sending u the link frmo where u can have know ledge for starting dis concept.
    http://www.****************/Tutorials/ALV/ALVMainPage.htm
    if u want help more in making the report do send me ur requierment .
    plzz do give points,if u find it useful d above link.

  • Help needed Displaying ALV  Secondary list without using oops concept

    Hi Experts
    Help needed Displaying ALV  Secondary list without using oops concept.
    its urgent
    regds
    rajasekhar

    hi chk this code
    ******************TABLES DECLARATION*****************
    TABLES : VBAP,MARA.
    *****************TYPE POOLS**************************
    TYPE-POOLS : SLIS.
    ****************INTERNAL TABLES**********************
    DATA : BEGIN OF IT_VBAP OCCURS 0,
    VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
    POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
    MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
    END OF IT_VBAP.
    ****************TEMPORARY VARIABLES******************
    DATA : V_VBELN LIKE VBAP-VBELN."SALES DOCUMENT
    DATA : V_MTART LIKE MARA-MTART. "MATERIAL TYPE
    *****************FIELD CATALOG***********************
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    ****************LAYOUT*******************************
    DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    ***************VARIANT*******************************
    DATA : G_VARIANT LIKE DISVARIANT.
    ****************SAVE*********************************
    DATA : G_SAVE(1) TYPE C.
    *****************EVENTS******************************
    DATA : XS_EVENTS TYPE SLIS_ALV_EVENT,
           G_EVENTS TYPE SLIS_T_EVENT.
    ******************PF STATUS**************************
    DATA : PF_STATUS TYPE SLIS_FORMNAME VALUE 'SET_PF_STATUS'.
    ******************USER COMMAND************************
    DATA : USER_COMMAND TYPE SLIS_FORMNAME VALUE 'SET_USER_COMMAND',
           R_UCOMM LIKE SY-UCOMM.
    ****************SELECTION SCREEN************************
    SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.
    ***************AT SELECTION SCREEN*********************
    AT SELECTION-SCREEN.
      PERFORM VALIDATE.
    **************START-OF-SELECTION**************************
    START-OF-SELECTION.
      PERFORM GET_DETAILS.
      PERFORM FIELDCAT.
      PERFORM LAYOUT.
      PERFORM VARIANT.
      PERFORM SAVE.
      PERFORM EVENTS.
      PERFORM ALV_DISPLAY.
    *********************FORMS*******************************************
    *&      Form  validate
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE .
      SELECT SINGLE VBELN
                    FROM VBAP
                    INTO V_VBELN
                    WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'enter valid vbeln'.
      ENDIF.
    ENDFORM.                    " validate
    *&      Form  get_details
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DETAILS .
      SELECT VBELN
             POSNR
             MATNR
             FROM VBAP
             INTO TABLE IT_VBAP
             WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'no details found'.
      ENDIF.
    ENDFORM.                    " get_details
    *&      Form  fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCAT .
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'VBELN'.
      WA_FIELDCAT-OUTPUTLEN = 10.
      WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'POSNR'.
      WA_FIELDCAT-OUTPUTLEN = 6.
      WA_FIELDCAT-SELTEXT_L = 'ITEM'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-OUTPUTLEN = 18.
      WA_FIELDCAT-SELTEXT_L = 'MATERIAL NO'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    " fieldcat
    *&      Form  LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM LAYOUT .
      WA_LAYOUT-ZEBRA = 'X'.
    ENDFORM.                    " LAYOUT
    *&      Form  VARIANT
          text
    -->  p1        text
    <--  p2        text
    FORM VARIANT .
      CLEAR G_VARIANT.
      G_VARIANT-REPORT = SY-REPID.
    ENDFORM.                    " VARIANT
    *&      Form  SAVE
          text
    -->  p1        text
    <--  p2        text
    FORM SAVE .
      CLEAR G_SAVE.
      G_SAVE = 'A'.
    ENDFORM.                    " SAVE
    *&      Form  EVENTS
          text
    -->  p1        text
    <--  p2        text
    FORM EVENTS .
      CLEAR XS_EVENTS.
      XS_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENTS-FORM = 'TOP_OF_PAGE'.
      APPEND XS_EVENTS TO G_EVENTS.
    ENDFORM.                    " EVENTS
    *&      Form  TOP_OF_PAGE
          text
    FORM TOP_OF_PAGE.
      WRITE :/ ' INTELLI GROUP'.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM ALV_DISPLAY .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
         I_CALLBACK_PROGRAM             = SY-REPID
         I_CALLBACK_PF_STATUS_SET       = PF_STATUS
         I_CALLBACK_USER_COMMAND        = USER_COMMAND
      I_STRUCTURE_NAME               =
         IS_LAYOUT                      = WA_LAYOUT
         IT_FIELDCAT                    = IT_FIELDCAT
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
         I_SAVE                         = G_SAVE
         IS_VARIANT                     = G_VARIANT
         IT_EVENTS                      = G_EVENTS
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        TABLES
          T_OUTTAB                       = IT_VBAP
       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.                    " ALV_DISPLAY
    *&      Form  SET_PF_STATUS
          text
    FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'Z50651_PFSTATUS' EXCLUDING EXTAB.
    ENDFORM.                    "SET_PF_STATUS
    *&      Form  SET_USER_COMMAND
          text
    FORM SET_USER_COMMAND USING R_UCOMM
                                RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN 'DC'.
          READ TABLE IT_VBAP INDEX RS_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            SELECT SINGLE MTART
                          FROM MARA
                          INTO V_MTART
                          WHERE MATNR = IT_VBAP-MATNR.
            IF SY-SUBRC <> 0.
       MESSAGE E000 WITH 'NO MATERIAL DESCRIPTION FOR SELECTED MATERIAL NO'.
            ELSE.
              WRITE :/ 'MATERIAL NO :',IT_VBAP-MATNR.
              WRITE :/ 'MATERIAL TYPE :' , V_MTART.
            ENDIF.
          ENDIF.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
        WHEN 'CLOSE'.
          CALL TRANSACTION 'SE38'.
      ENDCASE.
    REPORT  Z_ALV_INTERACTIVE  MESSAGE-ID ZMSG_50651
                                    LINE-SIZE 100
                                    LINE-COUNT 60
                                    NO STANDARD PAGE HEADING.
    ******************TABLES DECLARATION*****************
    TABLES : VBAP,MARA.
    *****************TYPE POOLS**************************
    TYPE-POOLS : SLIS.
    ****************INTERNAL TABLES**********************
    DATA : BEGIN OF IT_VBAP OCCURS 0,
    VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
    POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
    MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
    END OF IT_VBAP.
    ****************TEMPORARY VARIABLES******************
    DATA : V_VBELN LIKE VBAP-VBELN."SALES DOCUMENT
    DATA : V_MTART LIKE MARA-MTART. "MATERIAL TYPE
    *****************FIELD CATALOG***********************
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    ****************LAYOUT*******************************
    DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    ***************VARIANT*******************************
    DATA : G_VARIANT LIKE DISVARIANT.
    ****************SAVE*********************************
    DATA : G_SAVE(1) TYPE C.
    *****************EVENTS******************************
    DATA : XS_EVENTS TYPE SLIS_ALV_EVENT,
           G_EVENTS TYPE SLIS_T_EVENT.
    ******************PF STATUS**************************
    DATA : PF_STATUS TYPE SLIS_FORMNAME VALUE 'SET_PF_STATUS'.
    ******************USER COMMAND************************
    DATA : USER_COMMAND TYPE SLIS_FORMNAME VALUE 'SET_USER_COMMAND',
           R_UCOMM LIKE SY-UCOMM.
    ****************SELECTION SCREEN************************
    SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.
    ***************AT SELECTION SCREEN*********************
    AT SELECTION-SCREEN.
      PERFORM VALIDATE.
    **************START-OF-SELECTION**************************
    START-OF-SELECTION.
      PERFORM GET_DETAILS.
      PERFORM FIELDCAT.
      PERFORM LAYOUT.
      PERFORM VARIANT.
      PERFORM SAVE.
      PERFORM EVENTS.
      PERFORM ALV_DISPLAY.
    *********************FORMS*******************************************
    *&      Form  validate
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE .
      SELECT SINGLE VBELN
                    FROM VBAP
                    INTO V_VBELN
                    WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'enter valid vbeln'.
      ENDIF.
    ENDFORM.                    " validate
    *&      Form  get_details
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DETAILS .
      SELECT VBELN
             POSNR
             MATNR
             FROM VBAP
             INTO TABLE IT_VBAP
             WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'no details found'.
      ENDIF.
    ENDFORM.                    " get_details
    *&      Form  fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCAT .
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'VBELN'.
      WA_FIELDCAT-OUTPUTLEN = 10.
      WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'POSNR'.
      WA_FIELDCAT-OUTPUTLEN = 6.
      WA_FIELDCAT-SELTEXT_L = 'ITEM'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-OUTPUTLEN = 18.
      WA_FIELDCAT-SELTEXT_L = 'MATERIAL NO'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    " fieldcat
    *&      Form  LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM LAYOUT .
      WA_LAYOUT-ZEBRA = 'X'.
    ENDFORM.                    " LAYOUT
    *&      Form  VARIANT
          text
    -->  p1        text
    <--  p2        text
    FORM VARIANT .
      CLEAR G_VARIANT.
      G_VARIANT-REPORT = SY-REPID.
    ENDFORM.                    " VARIANT
    *&      Form  SAVE
          text
    -->  p1        text
    <--  p2        text
    FORM SAVE .
      CLEAR G_SAVE.
      G_SAVE = 'A'.
    ENDFORM.                    " SAVE
    *&      Form  EVENTS
          text
    -->  p1        text
    <--  p2        text
    FORM EVENTS .
      CLEAR XS_EVENTS.
      XS_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENTS-FORM = 'TOP_OF_PAGE'.
      APPEND XS_EVENTS TO G_EVENTS.
    ENDFORM.                    " EVENTS
    *&      Form  TOP_OF_PAGE
          text
    FORM TOP_OF_PAGE.
      WRITE :/ ' INTELLI GROUP'.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM ALV_DISPLAY .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
         I_CALLBACK_PROGRAM             = SY-REPID
       I_CALLBACK_PF_STATUS_SET         = PF_STATUS
         I_CALLBACK_USER_COMMAND        = USER_COMMAND
      I_STRUCTURE_NAME               =
         IS_LAYOUT                      = WA_LAYOUT
         IT_FIELDCAT                    = IT_FIELDCAT
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
         I_SAVE                         = G_SAVE
        IS_VARIANT                      = G_VARIANT
         IT_EVENTS                      = G_EVENTS
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        TABLES
          T_OUTTAB                       = IT_VBAP
       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.                    " ALV_DISPLAY
    *&      Form  SET_PF_STATUS
          text
    FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD' EXCLUDING EXTAB.
    ENDFORM.                    "SET_PF_STATUS
    *&      Form  SET_USER_COMMAND
          text
    FORM SET_USER_COMMAND USING R_UCOMM
                                RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN 'DC'.
          READ TABLE IT_VBAP INDEX RS_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            SELECT SINGLE MTART
                          FROM MARA
                          INTO V_MTART
                          WHERE MATNR = IT_VBAP-MATNR.
            IF SY-SUBRC <> 0.
       MESSAGE E000 WITH 'NO MATERIAL DESCRIPTION FOR SELECTED MATERIAL NO'.
            ELSE.
              WRITE :/ 'MATERIAL NO :',IT_VBAP-MATNR.
              WRITE :/ 'MATERIAL TYPE :' , V_MTART.
      SUBMIT SLIS_DUMMY WITH P_MATNR EQ IT_VBAP-MATNR
                        WITH P_MTART EQ V_MTART.
            ENDIF.
          ENDIF.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
        WHEN 'CLOSE'.
          CALL TRANSACTION 'SE38'.
      ENDCASE.
    plz reward if useful

Maybe you are looking for

  • Sol. Man. dump  STORAGE_PARAMETERS_WRONG_SET

    Sol. Man. dump  STORAGE_PARAMETERS_WRONG_SET Hi experts, We  are facing the following problem in our SM system - SM 7.0 with EhP1 SPS 06. When certain transactions are started a short dump is generated with error text  STORAGE_PARAMETERS_WRONG_SET. T

  • SCCM MP Account from accessing across untrusted domain

    Hi, I am wondering if anyone has any suggestion on how to setup MP connection account from MP in untrusted domain (DMZ) to site server. I tried to create a user account in the domain where SCCM primary site exists and configured that account for MP t

  • Link an 871 router/switch wirelessly to an ISP-provided DSL modem//router?

    Hi, Upstairs we have a 20-Mbps ISP-provided DSL wireless modem/router, and one floor lower, in basement, I would like to install a refurbished 871 Cisco router, without adding a separate Internet connection. I would like the 871 to connect wirelessly

  • Values of a FieldDoc

    If I have a field like private static String[] accountTypes = { "Checking", "Savings", "Credit", "Money Market" in the source code, how do I get "Checking", "Savings", "Credit", "Money Market" via javadoc?

  • Reading Characters From Car Number Plate

    hi , In my application i need to read the car number from Number Plate. For that i used OCR to read the characters from car image. I can read the characters from the image if the images very clear. If the Car number is in some different format i coul