How to create secondary lists in ALV

Hi all,
Can u plz explain me how to create Secondary lists usingl ALV and how many secondary lists we can create.
Thanks in advance
Venkat

this is the very very simple program in HR module to demonstrate interactive ALV report.
If u have HR module implemented...just copy and paste this code and debug it...you will easily get the flow of the report...this is the simplest program..
i hope it helps...here u go......
REPORT ztej_alv_interactive.
TABLES: pa0000, pa0001.
DATA : BEGIN OF it0001 OCCURS 0,
          pernr LIKE pa0001-pernr,
          ename LIKE pa0001-ename,
       END OF it0001.
DATA : BEGIN OF it0000 OCCURS 0,
          pernr LIKE pa0000-pernr,
          begda LIKE pa0000-begda,
          endda LIKE pa0000-endda,
          massn LIKE pa0000-massn,
          massg LIKE pa0000-massg,
          aedtm LIKE pa0000-aedtm,
       END OF it0000.
TYPE-POOLS: slis.
DATA: v_repid LIKE sy-repid .
DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: i_fieldcat1 TYPE slis_t_fieldcat_alv.
DATA: it_listheader TYPE slis_t_listheader.
DATA: it_listheader1 TYPE slis_t_listheader.
DATA: v_events TYPE slis_t_event,
      wa_event TYPE slis_alv_event.
DATA: alv_layout TYPE slis_layout_alv.
DATA:  i_title_0001 TYPE lvc_title VALUE 'FIRST LIST DISPLAYED'.
DATA:  i_title_0000 TYPE lvc_title.
DATA : temp_pernr LIKE pa0001-pernr.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECTION-SCREEN SKIP.
SELECT-OPTIONS : s_pernr FOR pa0000-pernr DEFAULT '16240147'.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
  v_repid = sy-repid.
  PERFORM build_fieldcatlog USING i_fieldcat.
  PERFORM event_call.
  PERFORM populate_event.
START-OF-SELECTION.
  PERFORM data_retrieval.
  PERFORM build_listheader USING it_listheader.
  PERFORM display_alv_report.
*&      Form  BUILD_FIELDCATLOG
      text
-->  p1        text
<--  p2        text
FORM build_fieldcatlog USING temp_fieldcat TYPE slis_t_fieldcat_alv.
  DATA : wa_temp_fieldcat TYPE slis_fieldcat_alv.
  wa_temp_fieldcat-tabname = 'IT0001'.
  wa_temp_fieldcat-fieldname = 'PERNR'.
  wa_temp_fieldcat-seltext_m = 'Personnel Number'.
  APPEND wa_temp_fieldcat TO temp_fieldcat.
  CLEAR wa_temp_fieldcat.
  wa_temp_fieldcat-tabname = 'IT0001'.
  wa_temp_fieldcat-fieldname = 'ENAME'.
  wa_temp_fieldcat-seltext_m = 'Name'.
  APPEND wa_temp_fieldcat TO temp_fieldcat.
  CLEAR wa_temp_fieldcat.
ENDFORM.                    " BUILD_FIELDCATLOG
*&      Form  EVENT_CALL
      text
-->  p1        text
<--  p2        text
FORM event_call.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
           i_list_type     = 0
        IMPORTING
           et_events       = v_events
       EXCEPTIONS
            LIST_TYPE_WRONG = 1
            OTHERS          = 2
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " EVENT_CALL
*&      Form  POPULATE_EVENT
      text
-->  p1        text
<--  p2        text
FORM populate_event.
  READ TABLE v_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
  IF sy-subrc EQ 0.
    wa_event-form = 'TOP_OF_PAGE'.
    MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-form.
  ENDIF.
  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.
  ENDIF.
ENDFORM.                    " POPULATE_EVENT
*&      Form  DATA_RETRIEVAL
      text
-->  p1        text
<--  p2        text
FORM data_retrieval.
  SELECT pernr ename
         FROM pa0001
         INTO TABLE it0001
         WHERE pernr IN s_pernr.
  DELETE ADJACENT DUPLICATES FROM it0001.
ENDFORM.                    " DATA_RETRIEVAL
*&      Form  BUILD_LISTHEADER
      text
     -->P_IT_LISTHEADER  text
FORM build_listheader USING i_listheader TYPE slis_t_listheader.
  DATA hline TYPE slis_listheader.
  hline-info = 'This is Interactive ALV Program.'.
  hline-typ = 'H'.
  APPEND hline TO i_listheader.
ENDFORM.                    " BUILD_LISTHEADER
*&      Form  DISPLAY_ALV_REPORT
      text
-->  p1        text
<--  p2        text
FORM display_alv_report.
  v_repid = sy-repid.
  alv_layout-colwidth_optimize = 'X'.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     i_callback_program                = v_repid
  I_CALLBACK_PF_STATUS_SET          = ' '
     i_callback_user_command           = 'USER_COMMAND'
     i_callback_top_of_page            = 'TOP_OF_PAGE'
     i_grid_title                      = i_title_0001
  I_GRID_SETTINGS                   =
   is_layout                         = alv_layout
     it_fieldcat                       = i_fieldcat[]
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
    i_default                         = 'ZLAY1'
     i_save                            = 'A'
    is_variant                        = i_variant
     it_events                         = v_events
    TABLES
      t_outtab                          = it0001
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.
  REFRESH i_fieldcat.
  CLEAR i_fieldcat.
  REFRESH it_listheader.
  CLEAR it_listheader.
ENDFORM.                    " DISPLAY_ALV_REPORT
*&      Form  TOP_OF_PAGE
      text
FORM top_of_page.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary       = it_listheader
   i_logo                   =
   I_END_OF_LIST_GRID       =
ENDFORM.                    "TOP_OF_PAGE
*&      Form  USER_COMMAND
      text
     -->R_UCOMM    text
     -->,          text
     -->RS_SLEFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
  REFRESH i_fieldcat1.
  REFRESH it_listheader1.
  CASE r_ucomm.
    WHEN '&IC1'.
      READ TABLE it0001 INDEX rs_selfield-tabindex.
      IF sy-subrc = 0.
        temp_pernr = it0001-pernr.
        PERFORM build_fieldcatlog_0000 USING i_fieldcat1.
        PERFORM event_call_0000.
        PERFORM populate_event_0000.
        PERFORM data_retrieval_0000.
        PERFORM build_listheader_0000 USING it_listheader1.
        PERFORM display_alv_0000.
      ENDIF.
  ENDCASE.
ENDFORM.                    "user_command
*&      Form  BUILD_FIELDCATLOG_0000
      text
-->  p1        text
<--  p2        text
FORM build_fieldcatlog_0000 USING temp_fieldcat TYPE slis_t_fieldcat_alv
  DATA : wa_temp_fieldcat TYPE slis_fieldcat_alv.
  wa_temp_fieldcat-tabname = 'IT0000'.
  wa_temp_fieldcat-fieldname = 'BEGDA'.
  wa_temp_fieldcat-seltext_m = 'From Date'.
  APPEND wa_temp_fieldcat TO temp_fieldcat.
  CLEAR wa_temp_fieldcat.
  wa_temp_fieldcat-tabname = 'IT0000'.
  wa_temp_fieldcat-fieldname = 'ENDDA'.
  wa_temp_fieldcat-seltext_m = 'To Date'.
  APPEND wa_temp_fieldcat TO temp_fieldcat.
  CLEAR wa_temp_fieldcat.
  wa_temp_fieldcat-tabname = 'IT0000'.
  wa_temp_fieldcat-fieldname = 'MASSN'.
  wa_temp_fieldcat-seltext_m = 'Action'.
  APPEND wa_temp_fieldcat TO temp_fieldcat.
  CLEAR wa_temp_fieldcat.
  wa_temp_fieldcat-tabname = 'IT0000'.
  wa_temp_fieldcat-fieldname = 'MASSG'.
  wa_temp_fieldcat-seltext_m = 'Reason'.
  APPEND wa_temp_fieldcat TO temp_fieldcat.
  CLEAR wa_temp_fieldcat.
  wa_temp_fieldcat-tabname = 'IT0000'.
  wa_temp_fieldcat-fieldname = 'AEDTM'.
  wa_temp_fieldcat-seltext_m = 'Action Run On'.
  APPEND wa_temp_fieldcat TO temp_fieldcat.
  CLEAR wa_temp_fieldcat.
ENDFORM.                    " BUILD_FIELDCATLOG
*&      Form  EVENT_CALL_0000
      text
-->  p1        text
<--  p2        text
FORM event_call_0000.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
   EXPORTING
     i_list_type           = 0
   IMPORTING
     et_events             = v_events
EXCEPTIONS
  LIST_TYPE_WRONG       = 1
  OTHERS                = 2
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " EVENT_CALL_0000
*&      Form  POPULATE_EVENT_0000
      text
-->  p1        text
<--  p2        text
FORM populate_event_0000.
  READ TABLE v_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
  IF sy-subrc EQ 0.
    wa_event-form = 'F_TOP_OF_PAGE'.
    MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-form.
  ENDIF.
ENDFORM.                    " POPULATE_EVENT_0000
*&      Form  TOP_OF_PAGE
      text
FORM f_top_of_page.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary       = it_listheader1
   i_logo                   =
   I_END_OF_LIST_GRID       =
ENDFORM.                    "TOP_OF_PAGE
*&      Form  USER_COMMAND
      text
     -->R_UCOMM    text
     -->,          text
     -->RS_SLEFIELDtext
*retreiving values from the database table ekko
FORM data_retrieval_0000.
  SELECT pernr begda endda massn massg aedtm
         FROM pa0000
         INTO TABLE it0000
         WHERE pernr = temp_pernr.
ENDFORM.
*&      Form  BUILD_LISTHEADER_0000
      text
     -->P_IT_LISTHEADER  text
FORM build_listheader_0000 USING i_listheader1 TYPE slis_t_listheader.
  DATA: hline1 TYPE slis_listheader.
  hline1-typ = 'H'.
  hline1-info = 'Actions Detail List'.
  APPEND hline1 TO i_listheader1.
ENDFORM.                    " BUILD_LISTHEADER_0000
*&      Form  DISPLAY_ALV_0000
      text
-->  p1        text
<--  p2        text
FORM display_alv_0000.
  CONCATENATE 'Actions For Personnel Number ' temp_pernr
               INTO i_title_0000 SEPARATED BY ' '.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
     i_callback_program                = v_repid
  I_CALLBACK_PF_STATUS_SET          = ' '
  I_CALLBACK_USER_COMMAND           = 'F_USER_COMMAND'
     i_callback_top_of_page            = 'F_TOP_OF_PAGE'
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
  I_BACKGROUND_ID                   = ' '
     i_grid_title                      = i_title_0000
  I_GRID_SETTINGS                   =
   is_layout                          = alv_layout
     it_fieldcat                      = i_fieldcat1[]
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         =
     i_save                            = 'A'
  IS_VARIANT                        =
     it_events                         = v_events
    TABLES
      t_outtab                          = it0000
   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_0000
Regards,
Tejas

Similar Messages

  • How to create check box in ALV Reports?

    how to create check box in ALV Reports?

    Hi
    check the report  BCALV_TEST_GRID_EDITABLE
    or
    check this report
    REPORT ZRFC346_TST.
    TABLES:SFLIGHT,RL034.
    TYPE-POOLS:SLIS.
    INCLUDE:<ICON>,<SYMBOL>.
    DATA: G_REPID          LIKE SY-REPID,
          G_FIELDCAT       TYPE SLIS_T_FIELDCAT_ALV,
          G_IT_SORT        TYPE SLIS_T_SORTINFO_ALV,
          G_LAYOUT         TYPE SLIS_LAYOUT_ALV,
          G_TABNAME_HEADER TYPE SLIS_TABNAME,
          G_TABNAME_ITEM   TYPE SLIS_TABNAME,
          G_KEYINFO        TYPE SLIS_KEYINFO_ALV,
          G_VARIANT        LIKE DISVARIANT,
          G_EXTAB          TYPE SLIS_T_EXTAB,
          I_SLIS_EXIT_BY_USER TYPE SLIS_EXIT_BY_USER.
    DATA: XEVENT         TYPE SLIS_T_EVENT,
          AEVENT         TYPE SLIS_ALV_EVENT,
          VARIANT        LIKE DISVARIANT,
          LAYOUT         TYPE SLIS_LAYOUT_ALV,
          ASP_GROUP      TYPE SLIS_SP_GROUP_ALV,
          GT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV,
          EXTAB          TYPE SLIS_T_EXTAB WITH HEADER LINE,
          XFIELD         TYPE SLIS_T_FIELDCAT_ALV,
          AFIELD         TYPE SLIS_FIELDCAT_ALV,
          G_SUCOMM      LIKE SY-UCOMM,
          G_SELFLD       TYPE SLIS_SELFIELD.
    DATA: SAV_SY_REPID      LIKE SY-REPID.
    CONSTANTS: CON_SFLIGHT TYPE LVC_FNAME VALUE 'SFLIGHT',
               CON_DISPLAY_FULL TYPE I VALUE 3.
    Data to be displayed
    DATA: BEGIN OF GT_SFLIGHT OCCURS 0.
            INCLUDE STRUCTURE SFLIGHT.
    DATA:ACTIVATE(1).
    DATA: END OF GT_SFLIGHT.
    INITIALIZATION.
    *........Initialisierung...............................................
      PERFORM INITIALIZATION_RL034.
    *........Field cata....................................................
      PERFORM FIELD_CAT.
    *........SPECIAL GROUP.................................................
      PERFORM E07_SP_GROUP_BUILD USING GT_SP_GROUP[].
    START-OF-SELECTION.
    Selection
      SELECT * FROM SFLIGHT INTO TABLE GT_SFLIGHT.
    *........ALV CALL.......................................................
      PERFORM ALV_CALL.
      PERFORM USER_COMMAND_LOCAL USING G_SUCOMM G_SELFLD.
          FORM USER_COMMAND_LOCAL                                       *
    -->  G_UCOMM                                                       *
    -->  G_SELFIELD                                                    *
    FORM USER_COMMAND_LOCAL USING G_UCOMM LIKE SY-UCOMM
                                  G_SELFIELD TYPE SLIS_SELFIELD.
      CASE G_UCOMM.
        WHEN 'ACT'.
      ENDCASE.
    ENDFORM.
          FORM ALV_CALL                                                 *
    FORM ALV_CALL.
    Call ABAP List Viewer (ALV)
    G_LAYOUT-BOX_FIELDNAME = 'ACTIVATE'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
                 EXPORTING
                I_BACKGROUND_ID         = 'ALV_BACKGROUND'
                   I_BYPASSING_BUFFER                = SPACE
                   I_BUFFER_ACTIVE                   = SPACE
                    I_CALLBACK_PROGRAM                = SAV_SY_REPID
                    I_CALLBACK_PF_STATUS_SET          = 'STATUS'
                   I_CALLBACK_USER_COMMAND           = 'USER_COMMAND_LOCAL'
                I_CALLBACK_TOP_OF_PAGE            = ' '
                I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
                I_CALLBACK_HTML_END_OF_LIST       = ' '
                 I_STRUCTURE_NAME                  = 'SFLIGHT'
                I_BACKGROUND_ID                   = ' '
                I_GRID_TITLE                      =
                I_GRID_SETTINGS                   =
                  IS_LAYOUT                         = G_LAYOUT
                  IT_FIELDCAT                       = XFIELD[]
                IT_EXCLUDING                      =
                  IT_SPECIAL_GROUPS                 = GT_SP_GROUP[]
                IT_SORT                           =
                IT_FILTER                         =
                 IS_SEL_HIDE                       = 'X'
                I_DEFAULT                         = 'X'
                  I_SAVE                            = 'A'
                IS_VARIANT                        =
                 IT_EVENTS                         = XEVENT
                IT_EVENT_EXIT                     =
                IS_PRINT                          =
                IS_REPREP_ID                      =
                I_SCREEN_START_COLUMN             = 0
                I_SCREEN_START_LINE               = 0
                I_SCREEN_END_COLUMN               = 0
                I_SCREEN_END_LINE                 = 0
                IT_ALV_GRAPHICS                   =
                IT_ADD_FIELDCAT                   =
                IT_HYPERLINK                      =
                I_HTML_HEIGHT_TOP                 =
                I_HTML_HEIGHT_END                 =
                IT_EXCEPT_QINFO                   =
              IMPORTING
                E_EXIT_CAUSED_BY_CALLER           =
                ES_EXIT_CAUSED_BY_USER            =
                  TABLES
                    T_OUTTAB                          = GT_SFLIGHT
              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.
          FORM status                                                   *
    -->  EXTAB                                                         *
    FORM STATUS USING EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STAT' EXCLUDING EXTAB.
    ENDFORM.                               " STATUS
    *&      Form  INITIALIZATION_RL034
          text
    -->  p1        text
    <--  p2        text
    FORM INITIALIZATION_RL034.
      SAV_SY_REPID = SY-REPID.
    ENDFORM.                    " INITIALIZATION_RL034
    *&      Form  DEFINE_EVENTS_RL034
          text
    -->  p1        text
    <--  p2        text
    FORM DEFINE_EVENTS_RL034.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE = 0
           IMPORTING
                ET_EVENTS   = XEVENT.
       exceptions
            list_type_wrong = 1
            others          = 2.
    ENDFORM.                    " DEFINE_EVENTS_RL034
    *&      Form  FIELD_CAT
          text
    -->  p1        text
    <--  p2        text
    FORM FIELD_CAT.
      DATA: LS_FCAT TYPE SLIS_FIELDCAT_ALV,
            L_LIN   TYPE I.
      REFRESH XFIELD.
           1. per Default eingeblendete Felder                          *
    *........Ikone/Symbol..................................................
      CLEAR AFIELD.
      DATA: LS1_FCAT TYPE SLIS_FIELDCAT_ALV,
            L_LIN1   TYPE I.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_STRUCTURE_NAME       = CON_SFLIGHT
                I_BYPASSING_BUFFER     = SPACE
                I_BUFFER_ACTIVE        = SPACE
           CHANGING
                CT_FIELDCAT            = XFIELD
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
      DESCRIBE TABLE XFIELD LINES L_LIN1.
      ADD 1 TO L_LIN1.
      CLEAR LS_FCAT.
      LS1_FCAT-FIELDNAME = 'ACTIVATE'.
      LS1_FCAT-CHECKBOX  = 'X'.
    LS1_FCAT-KEY       = 'X'.
      LS1_FCAT-INPUT     = 'X'.
      LS1_FCAT-EDIT     = 'X'.
      LS1_FCAT-INTTYPE   = 'C'.
      LS1_FCAT-DATATYPE  = 'CHAR'.
      LS1_FCAT-INTLEN    = 1.
      LS1_FCAT-COL_POS   = L_LIN1.
      LS1_FCAT-SELTEXT_S = LS1_FCAT-FIELDNAME.
      LS1_FCAT-SELTEXT_M = LS1_FCAT-FIELDNAME.
      LS1_FCAT-SELTEXT_L = LS1_FCAT-FIELDNAME.
      LS1_FCAT-SP_GROUP = 'A'.
      APPEND LS1_FCAT TO XFIELD.
      ADD 1 TO L_LIN.
    ENDFORM.                    " FIELD_CAT
    FORM E07_SP_GROUP_BUILD USING E07_LT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV.
      DATA: LS_SP_GROUP TYPE SLIS_SP_GROUP_ALV.
      CLEAR  LS_SP_GROUP.
      LS_SP_GROUP-SP_GROUP = 'A'.
      LS_SP_GROUP-TEXT     = 'SPECIAL'.
      APPEND LS_SP_GROUP TO E07_LT_SP_GROUP.
    ENDFORM.
    Regards
    Shiva

  • How to handle interactive list in alv reports

    hi experts.
    how to handle interactive list in alv reports.
    regards.
    subhasis

    HI Subhasis,
    below is the sample code for handling an interactive ALV report, hope this helps you ..
    REPORT  ZTEST_ALV123.                           
    TYPE-POOLS:SLIS.
    DATA :   IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
              IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
    DATA: BEGIN OF ITAB OCCURS 0,
           VBELN LIKE VBAK-VBELN,
           POSNR LIKE VBAP-POSNR,
           END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0,
           VBELN LIKE LIKP-VBELN,
           POSNR LIKE LIPS-POSNR,
           VGBEL LIKE LIPS-VGBEL,
           VGPOS LIKE LIPS-VGPOS,
           END OF ITAB1.
    DATA: IT_LIPS LIKE ITAB1 OCCURS 0 WITH HEADER LINE.
    SELECT  VBELN
            POSNR
            FROM VBAP
            INTO TABLE ITAB.
    IF SY-SUBRC = 0.
      SORT ITAB BY VBELN .
      SELECT VBELN
       POSNR
       VGBEL
       VGPOS
       INTO TABLE ITAB1
       FROM LIPS
       FOR ALL ENTRIES IN ITAB
       WHERE VGBEL = ITAB-VBELN
         AND    VGPOS = ITAB-POSNR.
    ENDIF.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS  = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS  = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = SY-REPID
        I_CALLBACK_PF_STATUS_SET = 'PFSTATUS'
        I_CALLBACK_USER_COMMAND  = 'HANDLE_USER_COMMAND'
        IT_FIELDCAT              = IT_FIELDCAT
      TABLES
        T_OUTTAB                 = ITAB
      EXCEPTIONS
        PROGRAM_ERROR            = 1
        OTHERS                   = 2.
    IF SY-SUBRC  = 0.
    ENDIF.
    *&      Form  POPUP
          text
         -->P_EXTAB    text
    FORM POPUP USING P_EXTAB TYPE SLIS_T_EXTAB.
    "here double click on PFSTATUS and create the status, "activate, before that set PICK for choose(F2).
    *- Pf status
      SET PF-STATUS 'PFSTATUS'.
    ENDFORM.                 " POPUP
    *&      Form  HANDLE_USER_COMMAND
          text
         -->R_UCOMM      text
         -->RS_SELFIELD  text
    FORM HANDLE_USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                                   RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          IF RS_SELFIELD-FIELDNAME = 'VBELN'.
            READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
            LOOP AT ITAB1 WHERE VGBEL = ITAB-VBELN
                              AND VGPOS = ITAB-POSNR.
              MOVE-CORRESPONDING ITAB1 TO IT_LIPS.
              APPEND IT_LIPS.
            ENDLOOP.
            PERFORM INTERACTIVE_REPORT.
          ENDIF.
      ENDCASE.
    ENDFORM.                    "HANDLE_USER_COMMAND
    *&      Form  interactive_report
          text
    FORM INTERACTIVE_REPORT .
      X_FIELDCAT-FIELDNAME = 'VBELN'.
      X_FIELDCAT-SELTEXT_L = 'VBELN'.
      X_FIELDCAT-TABNAME = 'IT_LIPS'.
      X_FIELDCAT-COL_POS  = 1.
      APPEND X_FIELDCAT TO IT_FIELDCAT1.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-FIELDNAME = 'POSNR'.
      X_FIELDCAT-SELTEXT_L = 'ITEM'.
      X_FIELDCAT-TABNAME = 'IT_LIPS'.
      X_FIELDCAT-COL_POS  = 2.
      APPEND X_FIELDCAT TO IT_FIELDCAT1.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-FIELDNAME = 'VGBEL'.
      X_FIELDCAT-SELTEXT_M = 'SO #'.
      X_FIELDCAT-TABNAME = 'IT_LIPS'.
      X_FIELDCAT-COL_POS  = 3.
      APPEND X_FIELDCAT TO IT_FIELDCAT1.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-FIELDNAME = 'VGPOS'.
      X_FIELDCAT-SELTEXT_M = 'SO ITEM'.
      X_FIELDCAT-TABNAME = 'IT_LIPS'.
      X_FIELDCAT-COL_POS  = 4.
      APPEND X_FIELDCAT TO IT_FIELDCAT1.
      CLEAR X_FIELDCAT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = SY-REPID
          IT_FIELDCAT        = IT_FIELDCAT1
        TABLES
          T_OUTTAB           = IT_LIPS
        EXCEPTIONS
          PROGRAM_ERROR      = 1
          OTHERS             = 2.
      IF SY-SUBRC  = 0.
      ENDIF.
    ENDFORM.                    " interactive_report
    Regards,
    Ranjita
    null

  • How to use intractive list in Alv REPORT

    how to use intractive list in Alv REPORT with example.
    thangs
    venki.......

    Hi
    using the USER_COMMAND we can move to the Secondary(interactive) list in the ALV
    see the sample code
    report yh645_secndry_alv.
    type-pools: slis.
    data: fieldcat type slis_t_fieldcat_alv,
    fieldcat_ln like line of fieldcat,
    fs_layout type slis_layout_alv,
    t_layoout like standard table
    of fs_layout.
    data: begin of fs_spfli,
    carrid type spfli-carrid,
    connid type spfli-connid,
    countryfr type spfli-countryfr,
    cityfrom type spfli-cityfrom,
    airpfrom type spfli-airpfrom,
    countryto type spfli-countryto,
    cityto type spfli-cityto,
    airpto type spfli-airpto,
    fltime type spfli-fltime,
    deptime type spfli-deptime,
    arrtime type spfli-arrtime,
    distance type spfli-distance,
    distid type spfli-distid,
    fltype type spfli-fltype,
    period type spfli-period,
    checkbox,
    color(3),
    end of fs_spfli.
    data:
    begin of fs_table,
    carrid type spfli-carrid,
    connid type spfli-connid,
    end of fs_table.
    data: begin of fs_sflight,
    check,
    color(3).
    include type sflight.
    data:end of fs_sflight.
    data:
    begin of fs_table1,
    carrid type sflight-carrid,
    connid type sflight-connid,
    fldate type sflight-fldate,
    end of fs_table1.
    data:
    t_spfli like standard table
    of fs_spfli.
    data:
    t_table like standard table
    of fs_table.
    data:
    t_table1 like standard table
    of fs_table1.
    data:
    t_sflight like standard table
    of fs_sflight.
    data:
    t_sbook like standard table
    of sbook.
    data t_layout type slis_layout_alv.
    select *
    into corresponding fields of table t_spfli
    from spfli.
    perform start_list_viewer.
    perform get_spfli_details.
    *& Form SUB1
    text
    -->RT_EXTAB text
    form sub1 using rt_extab type slis_t_extab.
    data: flight type slis_extab.
    flight-fcode = 'SFLIGHT'.
    append flight to rt_extab.
    set pf-status 'SFLIGHT'. " EXCLUDING RT_EXTAB.
    endform. "SUB1
    *& Form START_LIST_VIEWER
    text
    --> p1 text
    <-- p2 text
    form start_list_viewer .
    data: pgm like sy-repid.
    pgm = sy-repid.
    fs_layout-box_fieldname = 'CHECKBOX'.
    fs_layout-info_fieldname = 'COLOR'.
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    i_callback_program = pgm
    i_callback_pf_status_set = 'SUB1'
    i_callback_user_command = 'USER_COMMAND'
    i_structure_name = 'SPFLI'
    is_layout = fs_layout
    tables
    t_outtab = t_spfli
    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. " START_LIST_VIEWER
    *******Process Call Back Events (Begin)**************************
    form user_command using ucomm like sy-ucomm
    selfield type slis_selfield.
    case ucomm.
    when 'SFLIGHT'.
    selfield-refresh = 'X'.
    perform get_spfli_details.
    select *
    from sflight
    into corresponding fields of table t_sflight
    for all entries in t_table
    where carrid eq t_table-carrid
    and connid eq t_table-connid.
    perform display_sflight.
    when 'SBOOK'.
    selfield-refresh = 'X'.
    perform get_sflight_details.
    select *
    from sbook
    into corresponding fields of table t_sbook
    for all entries in t_table1
    where carrid eq t_table1-carrid
    and connid eq t_table1-connid
    and fldate eq t_table1-fldate.
    perform display_sbook.
    endcase.
    endform. "USER_COMMAND
    *& Form SUB2
    text
    -->RT_EXTAB text
    form sub2 using rt_extab type slis_t_extab.
    data: flight type slis_extab.
    flight-fcode = 'SBOOK'.
    append flight to rt_extab.
    set pf-status 'SBOOK'. " EXCLUDING RT_EXTAB.
    endform. "SUB2
    *& Form DISPLAY_SFLIGHT
    text
    --> p1 text
    <-- p2 text
    form display_sflight .
    data: pgm like sy-repid.
    pgm = sy-repid.
    clear t_layout.
    fs_layout-box_fieldname = 'CHECK'.
    fs_layout-info_fieldname = 'COLOR'.
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    i_callback_program = pgm
    i_callback_pf_status_set = 'SUB2'
    i_callback_user_command = 'USER_COMMAND'
    i_structure_name = 'SFLIGHT'
    is_layout = fs_layout
    tables
    t_outtab = t_sflight
    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_SFLIGHT
    *& Form GET_SPFLI_DETAILS
    text
    --> p1 text
    <-- p2 text
    form get_spfli_details .
    loop at t_spfli into fs_spfli.
    if fs_spfli-checkbox = 'X'.
    fs_spfli-color = 'C51'.
    fs_spfli-checkbox = '1'.
    fs_table-carrid = fs_spfli-carrid.
    fs_table-connid = fs_spfli-connid.
    append fs_table to t_table.
    modify t_spfli from fs_spfli.
    endif.
    endloop.
    endform. " GET_SFLIGHT_DETAILS
    *& Form GET_SFLIGHT_DETAILS
    text
    --> p1 text
    <-- p2 text
    form get_sflight_details .
    loop at t_sflight into fs_sflight.
    if fs_sflight-check = 'X'.
    fs_sflight-color = 'C71'.
    fs_sflight-check = '1'.
    fs_table1-carrid = fs_sflight-carrid.
    fs_table1-connid = fs_sflight-connid.
    fs_table1-fldate = fs_sflight-fldate.
    append fs_table1 to t_table1.
    modify t_sflight from fs_sflight.
    endif.
    endloop.
    endform. " GET_SFLIGHT_DETAILS
    *& Form DISPLAY_SBOOK
    text
    --> p1 text
    <-- p2 text
    form display_sbook .
    data: pgm like sy-repid.
    pgm = sy-repid.
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    i_callback_program = pgm
    i_structure_name = 'SBOOK'
    tables
    t_outtab = t_sbook
    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_SBOOK
    Reward points for useful Answers
    Regards
    Anji

  • How to create distribution list in workflow? for  sending mail or work-item

    Hi,
    How to create distribution list in workflow? for  sending mail or work-item to multiple users.
    Regards,
    Surjith

    Hi Surjith,
    A.Working with Distribution Lists Creating a Distribution List.
    1 Businees Workplace->shared folder - create new subfolder name = WF_distributor
    2.Then click on the distribution list in Businees Workplace.
    say create Name = WF_Vliste
    folder Name = WF_distributor
    3.distribution list content tab
    Enter Recipient (SAP User ID)
    B.Wrkflow Builder
    Find out the dialig step in which u want to use distribution list
    Use workflow Rule 30000012 (SWX_READ_DLI).
    Maintain the binding from workflow container to rule container.
    Just pass the name of the distribution list from WF to Rule container.
    Regards
    Sagar S

  • How-to create dependent list boxes in a table -Frank Sample

    hi everyone i would like to ask a suggestion about Frank's example on How-to create dependent list boxes in a table -Frank Sample ...
    i want to extend this example for 3 dependent lists... including locations, departaments and employes....
    this the ListboxBean java that Frank is using in his example.... and this is only for locations and departaments tables and it works ok... i want to add the third list for employers wich is dependent only from departaments list.... as i am not good in java i would like to ask u a suggestion on how to develop the third list in this java class ...
    public class ListboxBean {
    private SelectItem[] locationsSelectItems = null;
    private SelectItem[] departmentsSelectItems = null;
    public SelectItem[] getLocationsSelectItems() {
    if (locationsSelectItems == null){
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding vbinding = fctx.getApplication().createValueBinding("#{bindings.LocationsView1Iterator}");
    DCIteratorBinding locationsIterBinding = (DCIteratorBinding) vbinding.getValue(fctx);
    locationsIterBinding.executeQuery();
    Row[] locRowsArray = locationsIterBinding.getAllRowsInRange();
    // define select items
    locationsSelectItems = new SelectItem[locRowsArray.length];
    for (int indx = 0; indx < locRowsArray.length; indx++) {
    SelectItem addItem = new SelectItem();
    addItem.setLabel((String)locRowsArray[indx].getAttribute("City"));
    addItem.setValue(locRowsArray[indx].getAttribute("LocationId"));
    locationsSelectItems[indx] = addItem;
    return locationsSelectItems;
    return locationsSelectItems;
    public SelectItem[] getDepartmentsSelectItems() {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding vbinding = fctx.getApplication().createValueBinding("#{row}");
    JUCtrlValueBindingRef rwJUCtrlValueBinding = (JUCtrlValueBindingRef) vbinding.getValue(fctx);
    Row rw = rwJUCtrlValueBinding.getRow();
    if (rw.getAttribute(6) != null){
    OperationBinding oBinding = (OperationBinding) fctx.getApplication().createValueBinding("#{bindings.ExecuteWithParams}").getValue(fctx);
    oBinding.getParamsMap().put("locId",rw.getAttribute(6).toString());
    oBinding.execute();
    ValueBinding vbinding2 = fctx.getApplication().createValueBinding("#{bindings.DepartmentsView2Iterator}");
    DCIteratorBinding departmentsIterBinding = (DCIteratorBinding) vbinding2.getValue(fctx);
    departmentsIterBinding.executeQuery();
    Row[] depRowsArray = departmentsIterBinding.getAllRowsInRange();
    // define select items
    departmentsSelectItems = new SelectItem[depRowsArray.length];
    for (int indx = 0; indx < depRowsArray.length; indx++) {
    SelectItem addItem = new SelectItem();
    addItem.setLabel((String)depRowsArray[indx].getAttribute("DepartmentName"));
    addItem.setValue(depRowsArray[indx].getAttribute("DepartmentId"));
    departmentsSelectItems[indx] = addItem;
    return departmentsSelectItems;
    public void setLocationsSelectItems(SelectItem[] locationsSelectItems) {
    this.locationsSelectItems = locationsSelectItems;
    public void setDepartmentsSelectItems(SelectItem[] departmentsSelectItems) {
    this.departmentsSelectItems = departmentsSelectItems;
    Thanks in advance :0

    Hi,
    I think that all you need to do is to look at how I implemented the dependent detail for querying the Employees select items
    Then you make sure the DepartmentsVO and the EmployeesVO have bind variable to query them according to the pre-selected value in their respective master list
    Frank

  • How to create Invoice list??

    Hi guyz,
    could you please tell me how to create invoice list, i have created sales order, done the delivery,created billing.
    appreciate immediate reply.
    Thanks.
    Mohammed.

    Hi Mohammed,
    To create an invoice list:
    Select the Billing screen.
    Depending on the number of billing documents that you want to include, you can choose one of two ways to create the invoice list. You can either
    · Select Invoice list Create and enter each billing document separately
    · Create a list for all billing documents that are relevant for the invoice list. You can then process the work list for invoice lists.
    This procedure shows you how to create the work list.
    Select Invoice list Edit work list.
    Enter your selection criteria and press ENTER.
    The system displays a list of billing documents that meet your selection criteria.
    Select the billing documents that you want to include in the invoice list and select Invoice list Save.
    You can also simulate creation of invoice lists via the work list for invoice lists. This is useful as a test option. The simulation also allows you to carry out a split analysis, which shows you why billing documents are written to different invoice lists (e.g. due to different payers).
    Prerequisites
    You can only process invoice lists if the following prerequisite data is defined by your system administrator in Customizing for Sales:
    Condition type RL00 (factoring discount) must be maintained and, if required, also the condition type MW15.
    An invoice list type must be assigned to each billing type that you want to process in invoice lists. The standard version of the SAP R/3 System includes two types of invoice lists: LR for invoices and debit memos, LG for credit memos.
    Copying requirements must be defined (for example, the payer, terms of payment and other fields that must be identical in the documents to be included in the invoice list)
    In addition, before you process an invoice list, you must maintain the following master data:
    A customer calendar must be defined, specifying the time intervals or dates on which invoice lists are to be processed.
    The customer calendar must be entered in the Billing Sales Area view of the customer master record.
    Pricing condition records for the condition type RL00 and, if necessary, (e.g. in Germany) the condition type MW15 must be maintained.
    Output condition records for condition types LR00 and RD01 must be created.
    Hope with this info you can do it. Pl. reward if it helps.
    Thanks & Regards
    Sadhu Kishore

  • How to create a list of Vendor's Account group, to call by a macht -code?

    Hi All,
    Could anyone tell me how to create a list of Vendor's Account group, to call by a macht -code?
    Thanks
    Gandalf

    Hi,
    Use this report S_ALR_87012086 and select the account group single or multiple ranges from dynamic selection.
    Thanks
    Javed

  • How to create required field in alv?

    hi friends^^
    how to create required field in alv?
    i don't find required option in fieldcatalog and others.
    is it possible?

    Source code..
    PLANETYPE is key_sel = 'X'.
    But does't required field...
    REPORT  zs32editable1  .
    TYPE-POOLS : slis.
    DATA : gt_sflight  TYPE TABLE OF sflight.
    DATA : gt_fieldcat TYPE slis_t_fieldcat_alv,
           gs_fieldcat LIKE LINE OF gt_fieldcat,
           gs_layout   TYPE slis_layout_alv.
    START-OF-SELECTION.
      SELECT *
        INTO CORRESPONDING FIELDS OF TABLE gt_sflight
        FROM sflight.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-edit = 'X'.
      gs_fieldcat-fieldname = 'PLANETYPE'.
      gs_fieldcat-key_sel = 'X'.
      append gs_fieldcat to gt_fieldcat.
    END-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_STRUCTURE_NAME = 'SFLIGHT'
          is_layout        = gs_layout
          IT_FIELDCAT      = gt_fieldcat
        TABLES
          t_outtab         = gt_sflight
        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.

  • How to create Secondary Index?

    Hello All
    Can anyone let me know how to create secondary indexes?
    I hope Primary Indexes are being created automatically?V can'nt able to create this.
    regards
    balji

    Hi,
    1) Go to Se11 select table /BI0/A<ODS>00 > Utilities> Data bse Object --> Check.
    2) If you are using ODS Active table in any Start routine ,Make sure that the order of objects to be seleccted (select statement) should be in same order of index fields.
    In Query, Use RSRT to know the SQL statement of the Query .and follow same logic explained above.
    3) No need to create Secondary Index for Cube.
    4) IT recreates the Index.
    With rgds,
    Anil Kumar Sharma .P

  • How to create a secondary list of alv grid inside the function module

    Hi All,
    My requirement is to create a RFC function module to display the alv grid of one table.
    i have created that.
    while clicking on the records of the alv it should open the secondary list of another table.
    My problem is it is not fetching the records of the internal table of the primary list since it is created inside the function module(FUNCTION...ENDFUNCTION).
    pls help me on this.
    Thanks in Advance.

    hi,
    READ TABLE sel_sheet INTO wa_sheet INDEX rs_selfield-tabindex.
    here sel_sheet is the internal table for the primary list..
    i called the function module "reuse_lav_grid_display" inside Function...Endfunction.
    so when i am using  READ TABLE sel_sheet INTO wa_sheet INDEX rs_selfield-tabindex.
    inside the user command perform therecords in this internal table is not populating..
    pls help me on this.
    thanks in advance.

  • Adding button in the secondary list and alv grid

    Hi all ,
                i have devloped an alv grid interactive report as below, my problem is i want to add some button in the secondary list and do some interactions. but i dont know how to do that. i m sending u my code below ,,, plzz suggest what can be done do add that.
    <code>
    *& Report  Z_demo_SALESDOC
    REPORT  z_demo_salesdoc.
    TABLES: vbak, vbap.
    TYPE-POOLS:slis.
    DATA: BEGIN OF it_vbak OCCURS 0,
           vbeln TYPE vbak-vbeln,
           ernam TYPE vbak-ernam,
           erdat TYPE vbak-erdat,
           auart TYPE vbak-auart,
           END OF it_vbak.
    DATA: BEGIN OF it_vbap OCCURS 0,
           vbeln TYPE vbap-vbeln,
           posnr TYPE vbap-vbeln,
           matnr TYPE vbap-matnr,
           zmeng TYPE vbap-zmeng,
           netwr TYPE vbap-netwr,
           END OF it_vbap.
    DATA:it_event TYPE slis_t_event.
    DATA: t_field TYPE slis_t_fieldcat_alv,
          w_field TYPE slis_fieldcat_alv,
          t_field1 TYPE slis_t_fieldcat_alv,
          w_field1 TYPE slis_fieldcat_alv,
          w_layout TYPE slis_layout_alv,
          t_sort TYPE slis_t_sortinfo_alv,
          w_sort TYPE slis_sortinfo_alv.
    CONSTANTS: c_top_of_page  TYPE slis_formname VALUE 'TOP_OF_PAGE',
               c_usercommand  TYPE slis_formname VALUE 'USER_COMMAND'.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln MODIF ID m1,
                    s_erdat FOR vbak-erdat MODIF ID m2.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
    PARAMETERS:rb1 RADIOBUTTON GROUP g1 USER-COMMAND us1,
               rb2 RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK B2.
    AT SELECTION-SCREEN OUTPUT.
      IF rb1 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1    = 'M1'.
         IF screen-name    CS 'S_VBELN'.
            screen-active    = '0'.
           screen-input     = '0'.
          screen-output    = '0'.
          screen-invisible = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
      IF rb2 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1    = 'M2'.
            screen-active    = '0'.
           screen-input     = '0'.
          screen-output    = '0'.
          screen-invisible = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    AT SELECTION-SCREEN.
      DATA: v_vbeln LIKE vbak-vbeln.
      SELECT SINGLE vbeln
                      FROM vbak
                      INTO (v_vbeln)
                      WHERE vbeln IN s_vbeln .
      IF sy-subrc <> 0.
        MESSAGE e001(q) WITH 'Invalid Sales document'.
      ENDIF.
      DATA: v_erdat LIKE vbak-erdat.
      SELECT SINGLE erdat
                      FROM vbak
                      INTO (v_erdat)
                      WHERE erdat IN s_erdat.
      IF sy-subrc <> 0.
        MESSAGE e001(q) WITH 'No document available with given date'.
      ENDIF.
    START-OF-SELECTION.
      PERFORM get_data_vbak.
      PERFORM build_field_catalog.
    PERFORM fill_event.
      PERFORM print_data_vbak.
    END-OF-SELECTION.
    *&      Form  get_data_vbak
          text
    -->  p1        text
    <--  p2        text
    FORM get_data_vbak .
      SELECT vbeln ernam erdat auart
                                FROM vbak
                                INTO TABLE it_vbak
                                WHERE vbeln IN s_vbeln AND erdat IN s_erdat.
    ENDFORM.                    " get_data_vbak
    *&      Form  build_field_catalog
          text
    -->  p1        text
    <--  p2        text
    FORM build_field_catalog .
      w_field-col_pos = 1.
      w_field-fieldname = 'VBELN'.
      w_field-tabname = 'IT_VBAK'.
      w_field-seltext_m = 'Sales Order'.
      w_field-emphasize = 'C710'.
      APPEND w_field TO t_field.
      CLEAR w_field.
      w_field-col_pos = 2.
      w_field-fieldname = 'ERNAM'.
      w_field-tabname = 'IT_VBAK'.
      w_field-seltext_m = 'Created by'.
      w_field-emphasize = 'C710'.
      APPEND w_field TO t_field.
      CLEAR w_field.
      w_field-col_pos = 3.
      w_field-fieldname = 'ERDAT'.
      w_field-tabname = 'IT_VBAK'.
      w_field-seltext_m = 'Created Date'.
      w_field-emphasize = 'C710'.
      APPEND w_field TO t_field.
      CLEAR w_field.
      w_field-col_pos = 4.
      w_field-fieldname = 'AUART'.
      w_field-tabname = 'IT_VBAK'.
      w_field-seltext_m = 'Order type'.
      w_field-emphasize = 'C710'.
      APPEND w_field TO t_field.
      CLEAR w_field.
      w_sort-spos = 1.
      w_sort-fieldname = 'VBELN'.
      w_sort-up = 'X'.
      APPEND w_sort TO t_sort.
      w_layout-colwidth_optimize = 'X'.
    ENDFORM.                    " build_field_catalog
    *&      Form  user_command
          text
         -->RF_UCOMM     text
         -->RS_SELFIELD  text
    FORM user_command USING rf_ucomm    TYPE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      CASE rf_ucomm.
        WHEN '&IC1'.
          IF rs_selfield-fieldname = 'VBELN'.
            READ TABLE it_vbak INDEX rs_selfield-tabindex.
            IF sy-subrc = 0.
              PERFORM get_data_vbap.
              PERFORM build_field_catalog2.
              PERFORM print_field_data.
            ENDIF.
          ENDIF.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  print_data_vbak
          text
    -->  p1        text
    <--  p2        text
    FORM print_data_vbak .
      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            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  = I_STRUCTURE_NAME
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      = I_GRID_TITLE
      I_GRID_SETTINGS                   = I_GRID_SETTINGS
         is_layout                         = w_layout
       it_fieldcat                       = t_field[]
      IT_EXCLUDING                      = IT_EXCLUDING
      IT_SPECIAL_GROUPS                 = IT_SPECIAL_GROUPS
       it_sort                           = t_sort
      IT_FILTER                         = IT_FILTER
      IS_SEL_HIDE                       = IS_SEL_HIDE
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        = IS_VARIANT
      it_events                         = it_event[]
      IT_EVENT_EXIT                     = IT_EVENT_EXIT
      IS_PRINT                          = IS_PRINT
      IS_REPREP_ID                      = IS_REPREP_ID
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   = IT_ALV_GRAPHICS
      IT_HYPERLINK                      = IT_HYPERLINK
      IT_ADD_FIELDCAT                   = IT_ADD_FIELDCAT
      IT_EXCEPT_QINFO                   = IT_EXCEPT_QINFO
      IR_SALV_FULLSCREEN_ADAPTER        = IR_SALV_FULLSCREEN_ADAPTER
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           = E_EXIT_CAUSED_BY_CALLER
      ES_EXIT_CAUSED_BY_USER            = ES_EXIT_CAUSED_BY_USER
        TABLES
          t_outtab                          = it_vbak
    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.                    " print_data_vbak
    *&      Form  fill_event
          text
    FORM fill_event .
      DATA : st_event TYPE slis_alv_event.
    *- Clear.
      CLEAR : st_event, it_event[].
    *- Local variable
      DATA : l_tabix TYPE sy-tabix.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        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 event table
      READ TABLE it_event WITH KEY name = slis_ev_user_command
                           INTO st_event.
    *- Clear
      CLEAR l_tabix.
      l_tabix = sy-tabix.
    *- Check subrc
      IF sy-subrc = 0.
        st_event-form = c_usercommand.
    *- Modify
        MODIFY it_event FROM st_event INDEX l_tabix.
    *- Clear
        CLEAR st_event.
      ENDIF.
    ENDFORM.                    " fill_event
    *&      Form  get_data_vbap
          text
    FORM get_data_vbap .
      IF NOT it_vbak[] IS INITIAL.
        SELECT vbeln
               posnr
               matnr
               zmeng
               netwr
            FROM vbap
            INTO TABLE it_vbap
            WHERE vbeln = it_vbak-vbeln.
        IF sy-subrc = 0.
          SORT it_vbap BY vbeln.
        ENDIF.
      ENDIF.
    ENDFORM.                    " get_data_vbap
    *&      Form  build_field_catalog2
          text
    FORM build_field_catalog2 .
      CLEAR:t_field1,w_field1.
      w_field1-col_pos = 1.
      w_field1-fieldname = 'VBELN'.
      w_field1-tabname = 'IT_VBAP'.
      w_field1-seltext_m = 'Sales Order'.
      w_field1-emphasize = 'C710'.
      APPEND w_field1 TO t_field1.
      CLEAR w_field1.
      w_field1-col_pos = 2.
      w_field1-fieldname = 'POSNR'.
      w_field1-tabname = 'IT_VBAP'.
      w_field1-seltext_m = 'Sales Doc Item'.
      w_field1-emphasize = 'C710'.
      APPEND w_field1 TO t_field1.
      CLEAR w_field1.
      w_field1-col_pos = 3.
      w_field1-fieldname = 'MATNR'.
      w_field1-tabname = 'IT_VBAP'.
      w_field1-seltext_m = 'Material No'.
      w_field1-emphasize = 'C710'.
      APPEND w_field1 TO t_field1.
      CLEAR w_field1.
      w_field1-col_pos = 4.
      w_field1-fieldname = 'ZMENG'.
      w_field1-tabname = 'IT_VBAP'.
      w_field1-seltext_m = 'Target quan units'.
      w_field1-emphasize = 'C710'.
      APPEND w_field1 TO t_field1.
      CLEAR w_field1.
      w_field1-col_pos = 5.
      w_field1-fieldname = 'NETWR'.
      w_field1-tabname = 'IT_VBAP'.
      w_field1-seltext_m = 'Net value dc cu'.
      w_field1-emphasize = 'C710'.
      APPEND w_field1 TO t_field1.
      CLEAR w_field1.
    ENDFORM.                    " build_field_catalog2
    *&      Form  print_field_data
          text
    FORM print_field_data .
    SET PF-STATUS 'VBAP'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  = I_STRUCTURE_NAME
      I_BACKGROUND_ID                   = ' '
         i_grid_title                      = 'VBAP DETAILS'
      I_GRID_SETTINGS                   = I_GRID_SETTINGS
      IS_LAYOUT                         = IS_LAYOUT
         it_fieldcat                       = t_field1[]
      IT_EXCLUDING                      = IT_EXCLUDING
      IT_SPECIAL_GROUPS                 = IT_SPECIAL_GROUPS
      IT_SORT                           = IT_SORT
      IT_FILTER                         = IT_FILTER
      IS_SEL_HIDE                       = IS_SEL_HIDE
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        = IS_VARIANT
      IT_EVENTS                         = IT_EVENTS
      IT_EVENT_EXIT                     = IT_EVENT_EXIT
      IS_PRINT                          = IS_PRINT
      IS_REPREP_ID                      = IS_REPREP_ID
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   = IT_ALV_GRAPHICS
      IT_HYPERLINK                      = IT_HYPERLINK
      IT_ADD_FIELDCAT                   = IT_ADD_FIELDCAT
      IT_EXCEPT_QINFO                   = IT_EXCEPT_QINFO
      IR_SALV_FULLSCREEN_ADAPTER        = IR_SALV_FULLSCREEN_ADAPTER
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           = E_EXIT_CAUSED_BY_CALLER
      ES_EXIT_CAUSED_BY_USER            = 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.                    " print_field_data
    </code>

    Hi Satya..
    This is the Sample code...
    DATA : V_FORM_GUI TYPE SLIS_FORMNAME VALUE 'F_GUI'.  "Form name
    **Secondary List
    FORM print_field_data .
    SET PF-STATUS 'VBAP'.  "This statement will not work for ALV
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    i_callback_program = sy-repid
    <b> I_CALLBACK_PF_STATUS_SET = V_FORM_GUI  
                                                      "Subroutine in which GUI status is called</b>
    I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'   "To handle GUI
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME = I_STRUCTURE_NAME
    I_BACKGROUND_ID = ' '
    i_grid_title = 'VBAP DETAILS'
    I_GRID_SETTINGS = I_GRID_SETTINGS
    IS_LAYOUT = IS_LAYOUT
    it_fieldcat = t_field1[]
    IT_EXCLUDING = IT_EXCLUDING
    IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
    IT_SORT = IT_SORT
    IT_FILTER = IT_FILTER
    IS_SEL_HIDE = IS_SEL_HIDE
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT = IS_VARIANT
    IT_EVENTS = IT_EVENTS
    IT_EVENT_EXIT = IT_EVENT_EXIT
    IS_PRINT = IS_PRINT
    IS_REPREP_ID = IS_REPREP_ID
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    I_HTML_HEIGHT_TOP = 0
    I_HTML_HEIGHT_END = 0
    IT_ALV_GRAPHICS = IT_ALV_GRAPHICS
    IT_HYPERLINK = IT_HYPERLINK
    IT_ADD_FIELDCAT = IT_ADD_FIELDCAT
    IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
    IR_SALV_FULLSCREEN_ADAPTER = IR_SALV_FULLSCREEN_ADAPTER
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
    ES_EXIT_CAUSED_BY_USER = 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. " print_field_data
    FORM F_GUI USING rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'GUI_1'.  "Double click and Create this GUI status and add buttons
    ENDFORM.
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

  • How to create a program in alv.

    Hi Experts,
    I am new to Alv programming. I am learning alv programming myself.I dont know anything about that. so can u please guide me how to create an alv program. give some documents to learn about alv.i ve searched it but i could not find any subsequent documents or materials here. please help me to learn.
    My some doubts are below.
    1.why are we using Type pools?
    2.How many type pools are there?
    3. give some links to learn alv.
    Thanks in advance.
    Urs
    Goreddem.

    HI,
    There are basically two types of ALV reports are there
    list and grid.
    List mode is good old list processing with standard functionalities,
    and grid mode is using a new OCX object displaying grids.
    For list check this
    http://www.scribd.com/doc/7345300/basic-ALV-1-Step-by-Step
    For Grid checkout this might be helpful.
    http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    http://help.sap.com/saphelp_sm32/helpdata/en/8d/e994374c9cd355e10000009b38f8cf/content.htm
    Regards and Best wishes.

  • How to create a list based on a value in multiple sheets

    I am trying to create a list in numbers that references a common value among multiple sheets.  I have 4 sheets created for a fantasy football league (1 sheet for QB, 1 for Running Back, 1 for Wide Receiver and 1 for Tight End).  I have assigned a value to each player listed on each individual sheet.  I would like to create a 5th sheet that lists the players in order from highest to lowest value as they are marked on their position sheet.  How would this be done in Numbers?
    Thanks for the help!

    Here is one possible solution:
    I named the four data tables "QB", "RB", "TE", and "WR", and the 5th table, for lack of a better name "Summary".
    NOTE:  The first row OF EVERY TABLE is a header.
    In the summary table:
    A2=OFFSET(INDIRECT(A$1&" :: $A$1"), MATCH(LARGE(INDIRECT(A$1&" :: B"), ROW()-1), INDIRECT(A$1&" :: B"))-1, 0, 1, 1)
    select A2 and fill to the right, then select A2 thru D2 and fill down as needed

  • OCS2007R2 - how to create a list of users and meeting policies assigned to them?

    Hi all
    is it possible to create a list of users and policy assigned?
    For example
    UserA   Default
    UserB   High
    UserC    High
    UserD   Medium
    and so on?
    Thanks in advance!

    You can try to use the Office Communications Server 2007 R2 Resource Kit Script LCSEnableConfigureUsers
    The LCSEnableConfigureUsers.wsf script automates enabling and configuring users belonging to the local Active Directory Domain Services domain.
    For details, see
    http://blogs.technet.com/b/nexthop/archive/2011/08/02/how-to-use-the-office-communications-server-2007-r2-resource-kit-script-lcsenableconfigureusers.aspx
    Lisa Zheng
    TechNet Community Support

Maybe you are looking for

  • Error in IMPORT statement: Change of length on conversion.

    Hi this is an error i had when creating a source system for a client. Runtime Errors CONNE_IMPORT_CONVERSION_ERROR Occurred on 21.02.2005 at 14:08:20 The error probably occurred when installing the R/3 system. When importing an object, conversion wou

  • PDF with movable parts.

    I'm trying to create a PDF file with movable parts.  I'm doing a research project where participants will try to match wallpaper to a specific room.  I would like to have a PDF file that has wallpaper squares that can move around a hallway in another

  • Will AirPlay use Battery when not in use?

    Hi everyone, i'm pretty new in the Apple Universe (Aug 2012) and...well enjoying it :-) One thing i was not able to find an answer to is if AirPlay will drain more Battery from iPad and iPhone when activated even if nothing ist streamed or mirrored?!

  • Play it again, Sam (ie. retry the statement)

    there is a merge statement that causes ORA-08006 error from time to time: specified row no longer exists. I found out that the main solution cited on the internet is to retry the operation: ORA-08006: specified row no longer exists Cause: the row has

  • Installing Repository, but Operation 'close' on ACTIVITY has failed

    Hi all! I've installed Oracle 9.0.1.1.1 on my Windows 2000 machine. After that, i've installed Oracle Developer Suite, and the run the Repository Administration Utility, and I created a repository. Before that, I created the tablespace and the user f