Hierarchial list

i am using this code to create ahierarchial list but it is not working
can u tell me wat is wrong
FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
  I_INTERFACE_CHECK              = ' '
     i_callback_program             = gv_repid
  I_CALLBACK_PF_STATUS_SET       = ' '
  I_CALLBACK_USER_COMMAND        = ' '
  IS_LAYOUT                      =
     it_fieldcat                    = t_fieldcat
  IT_EXCLUDING                   =
  IT_SPECIAL_GROUPS              =
  IT_SORT                        =
  IT_FILTER                      =
  IS_SEL_HIDE                    =
  I_SCREEN_START_COLUMN          = 0
  I_SCREEN_START_LINE            = 0
  I_SCREEN_END_COLUMN            = 0
  I_SCREEN_END_LINE              = 0
  I_DEFAULT                      = 'X'
  I_SAVE                         = ' '
  IS_VARIANT                     =
  IT_EVENTS                      =
  IT_EVENT_EXIT                  =
      i_tabname_header               = 't_final'
      i_tabname_item                 = 't_bseg'
  I_STRUCTURE_NAME_HEADER        =
  I_STRUCTURE_NAME_ITEM          =
      is_keyinfo                     = g_kinfo
  IS_PRINT                       =
  IS_REPREP_ID                   =
  I_BYPASSING_BUFFER             =
  I_BUFFER_ACTIVE                =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER        =
  ES_EXIT_CAUSED_BY_USER         =
    TABLES
      t_outtab_header                = t_final
      t_outtab_item                  = t_bseg
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.

hi,
sample code is present u can take help of this.
  DATA:   cherry_fieldcat TYPE slis_t_fieldcat_alv,
          cherry_layout   TYPE slis_layout_alv,
         fieldcat_ln LIKE LINE OF cherry_fieldcat,
           gt_list_top_of_page TYPE slis_t_listheader,
           gt_list_end_of_page TYPE slis_t_listheader,
      g_repid LIKE sy-repid.
  DATA:       l_sort           TYPE slis_t_sortinfo_alv,
            i_print          TYPE slis_print_alv.
  g_repid = sy-repid.
  DATA : vrepid TYPE sy-repid.
  vrepid = sy-repid.
  DATA gs_keyinfo  TYPE slis_keyinfo_alv.
  DATA: fieldcat_ln TYPE slis_fieldcat_alv.
  DATA:  i_title_ekko TYPE lvc_title VALUE 'VENDOR-BALANCE REPORT'.
  DATA: gt_events TYPE slis_t_event,
         gd_prntparams TYPE slis_print_alv.
        gd_prntparams-no_print_listinfos = 'X'.
  DATA:   gt_sort    TYPE slis_t_sortinfo_alv.
  DATA:   g_tabname_header TYPE slis_tabname,
          g_tabname_item   TYPE slis_tabname,
DATA: WA_PRINT TYPE  SLIS_PRINT_ALV.
*gd_prntparams-no_new_page = 'X'.
****key info for header and item table for hierarichal alv***
  initialization.
  g_repid = sy-repid.
  g_tabname_header = 'I_TAB2'.
  g_tabname_item   = 'OUT_TAB'.
  CLEAR gs_keyinfo.
  gs_keyinfo-header01 = 'LIFNR'.
  gs_keyinfo-item01   = 'LIFNR'.
GS_KEYINFO-HEADER02 =  'BLDAT'.
GS_KEYINFO-ITEM02   = 'KUNNR'.
*******preparing field catalog***************
  CLEAR fieldcat_ln.
CLEAR cherry_fieldcat.
  fieldcat_ln-fieldname = 'LIFNR'.
  fieldcat_ln-tabname   = 'I_TAB2'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-seltext_l = 'VENDOR'.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
  CLEAR fieldcat_ln.
CLEAR cherry_fieldcat.
  fieldcat_ln-fieldname =   'NAME'.
  fieldcat_ln-tabname   =   'I_TAB2'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-seltext_l =  'NAME'.
  fieldcat_ln-just    = 'C'.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
  CLEAR fieldcat_ln.
CLEAR cherry_fieldcat.
  fieldcat_ln-fieldname =   'CITY'.
  fieldcat_ln-tabname   =   'I_TAB2'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-seltext_l =   'CITY'.
  fieldcat_ln-just    = 'C'.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
  CLEAR fieldcat_ln.
  fieldcat_ln-fieldname = 'OPENING_BALANCE1'.
  fieldcat_ln-tabname   = 'I_TAB2'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-just    = 'L'.
  fieldcat_ln-seltext_l = ''.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
  CLEAR fieldcat_ln.
  fieldcat_ln-fieldname = 'BUDAT'.
  fieldcat_ln-tabname   = 'OUT_TAB'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-no_out    = ' '.
  fieldcat_ln-seltext_l = 'DOC-DATE'.
  fieldcat_ln-col_pos    = ''.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
CLEAR fieldcat_ln.
  fieldcat_ln-fieldname = 'XBLNR'.
  fieldcat_ln-tabname   = 'OUT_TAB'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-just    = 'L'.
  fieldcat_ln-no_out    = ' '.
  fieldcat_ln-seltext_l = 'REFERENCE'.
  fieldcat_ln-col_pos    = ''.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
  CLEAR fieldcat_ln.
  fieldcat_ln-fieldname = 'PARTICULARS1'.
  fieldcat_ln-tabname   = 'OUT_TAB'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-just    = 'L'.
  fieldcat_ln-no_out    = ' '.
  fieldcat_ln-seltext_l = 'PARTICULARS'.
  fieldcat_ln-col_pos    = ''.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
  CLEAR fieldcat_ln.
  fieldcat_ln-fieldname = 'SHKZG'.
  fieldcat_ln-tabname   = 'OUT_TAB'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-no_out    = ' '.
  fieldcat_ln-just    = 'C'.
  fieldcat_ln-col_pos    = ''.
  fieldcat_ln-seltext_l = 'D/C'.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
  CLEAR fieldcat_ln.
  fieldcat_ln-fieldname = 'DEBIT'.
  fieldcat_ln-tabname   = 'OUT_TAB'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-no_out    = ' '.
  fieldcat_ln-seltext_l = 'DEBIT'.
  fieldcat_ln-just    = 'C'.
  fieldcat_ln-col_pos    = ''.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
  CLEAR fieldcat_ln.
  fieldcat_ln-fieldname = 'CREDIT'.
  fieldcat_ln-tabname   = 'OUT_TAB'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-no_out    = ' '.
  fieldcat_ln-seltext_l = 'CREDIT'.
  fieldcat_ln-col_pos    = ''.
  fieldcat_ln-just    = ' '.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
  CLEAR fieldcat_ln.
  fieldcat_ln-fieldname = 'BALANCE'.
  fieldcat_ln-tabname   = 'OUT_TAB'.
  fieldcat_ln-key       = ' '.   "SUBTOTAL KEY
  fieldcat_ln-no_out    = ' '.
  fieldcat_ln-seltext_l = 'BALANCE'.
  fieldcat_ln-col_pos    = ''.
  fieldcat_ln-just    = ' '.
  APPEND  fieldcat_ln TO    cherry_fieldcat.
*******end of field catalog********
  DATA: gs_sort TYPE slis_sortinfo_alv.
  PERFORM e03_eventtab_build USING gt_events[].
  PERFORM e04_comment_build USING gt_list_top_of_page[].
  PERFORM f_event_print.
  PERFORM f_event_sort.
  LOOP AT i_tab2.
    v_tabix = sy-tabix.
    READ TABLE out_tab WITH KEY lifnr = i_tab2-lifnr.
    IF sy-subrc NE 0.
      DELETE i_tab2 INDEX v_tabix.
    ENDIF.
  ENDLOOP.
  CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
    i_interface_check              = 'I'
     i_callback_program             = g_repid
      is_layout                      = cherry_layout
      it_fieldcat                    = cherry_fieldcat
    it_sort                        = l_sort[]
    it_events                      = gt_events
      i_tabname_header               = g_tabname_header
      i_tabname_item                 = g_tabname_item
     is_keyinfo                     = gs_keyinfo
    is_print                       = i_print
    TABLES
      t_outtab_header                = i_tab2
      t_outtab_item                  = out_tab
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  FREE out_tab.          " releasing out_tab from memory
if helpful then rewards mark
priya

Similar Messages

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

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

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

  • Download Hierarchial List ALV  to excel

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

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

  • Programs for alv block and hierarchy list

    hi abapers,
    can anyone pls mail me the simple program to get an idea of block and hierarchy list.
    my mail id is <u>[email protected]</u>

    HI
    go through below links
    http://www.sapgenie.com/abap/controls/alvgrid.htm
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305
    Reward points if help full
    Regards
    Suresh.D

  • Objects hidden (missing) in the Hierarchy list of SE80

    Hi Experts,
    The situation is, I have seen many times in my programs that, out of all the objects declared in the ABAP program some are found missing in the objects hierarchy list. Example, there will be a selection screen delcared and the program is working fine, but in the objects list, either screens node is not shown or if screens tab is shown, the number 1000 screen will be missing. another instannce is, out of the internal tables declared usinf the "data" statment, one or two of them will not be seen under "fields" node. Can any one please tell me why this happens practically when it should not happen ideally.
    Is there any way to make them visible again?
    All the satisfying and justifying answers will be rewarded.
    Thanks & Regrads,
    N.M.S.M.Krishna

    Hello,
    Open the report in se80.
    From menu, choose : Utilities->Update Navigation index
    = Or =
    Right click the report program; from the context menu choose
    Other Functions->Rebuild Object List
    This will regenerate the program object list.
    Cheers,
    Remi

  • Hierarchial list display

    hi all,
    please send me some programs for hierarchial list display in ALVs.
    thanks in advance,
    hema.

    hi,
    this is used to specify that according to which field u want hierarchy....
    means i want that according to material number i want hierarchical display than i have to pass matnr in this
    and
    key_info-header01 = 'MAT'.
    key_info-item01 = 'MAT'.
    In this we passing field name of header table and item table....
    Now see this example..
    In this i want hierarchy depend on Material and palnt both..
    so my code will be
    TYPE-POOLS : slis.
    TABLES : mseg.
    DATA : BEGIN OF itab_head OCCURS 0,
    mat LIKE mseg-matnr,
    matnr LIKE mseg-matnr,
    werks LIKE mseg-werks,
    END OF itab_head.
    DATA : BEGIN OF itab_item OCCURS 0,
    mat LIKE mseg-matnr,
    matnr LIKE mseg-matnr,
    werks LIKE mseg-werks,
    mblnr LIKE mseg-mblnr,
    menge LIKE mseg-menge,
    END OF itab_item.
    DATA : t_fcat TYPE slis_t_fieldcat_alv,
    key_info TYPE slis_keyinfo_alv,
    t_eve TYPE slis_t_event,
    gt_subtot TYPE slis_t_sortinfo_alv,
    subtot LIKE LINE OF gt_subtot,
    t_listhead TYPE slis_t_listheader,
    st_line TYPE slis_listheader.
    DATA : t_mtdoc LIKE mseg-mblnr.
    SELECT-OPTIONS : mat FOR mseg-matnr.
    INITIALIZATION.
    PERFORM build_cat USING t_fcat.
    PERFORM build_eve.
    START-OF-SELECTION.
    PERFORM get_data.
    PERFORM dis_data.
    *& Form build_cat
    text
    -->TEMP_FCAT text
    FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.
    DATA : wa_fcat TYPE slis_fieldcat_alv.
    wa_fcat-tabname = 'ITAB_HEAD'.
    wa_fcat-fieldname = 'MAT'.
    wa_fcat-seltext_m = 'Material'.
    APPEND wa_fcat TO temp_fcat.
    CLEAR wa_fcat.
    wa_fcat-tabname = 'ITAB_HEAD'.
    wa_fcat-fieldname = 'WERKS'.
    wa_fcat-seltext_m = 'Plant'.
    APPEND wa_fcat TO temp_fcat.
    CLEAR wa_fcat.
    wa_fcat-tabname = 'ITAB_ITEM'.
    wa_fcat-fieldname = 'MBLNR'.
    wa_fcat-seltext_m = 'Material Doc.'.
    APPEND wa_fcat TO temp_fcat.
    CLEAR wa_fcat.
    wa_fcat-tabname = 'ITAB_ITEM'.
    wa_fcat-fieldname = 'MENGE'.
    wa_fcat-seltext_m = 'Quantity'.
    wa_fcat-do_sum = 'Y'.
    APPEND wa_fcat TO temp_fcat.
    CLEAR wa_fcat.
    subtot-spos = 1.
    subtot-fieldname = 'MAT'.
    subtot-tabname = 'ITAB_HEAD'.
    subtot-up = 'X'.
    subtot-group = 'X'.
    subtot-subtot = 'X'.
    subtot-expa = 'X'.
    APPEND subtot TO gt_subtot.
    ENDFORM. "build_cat
    *& Form build_eve
    text
    FORM build_eve.
    DATA : wa_eve TYPE slis_alv_event.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    i_list_type = 0
    IMPORTING
    et_events = t_eve
    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. "build_eve
    *& Form get_data
    text
    FORM get_data.
    SELECT matnr AS mat werks mblnr menge FROM mseg INTO CORRESPONDING FIELDS OF TABLE itab_item
    WHERE matnr IN mat.
    ENDFORM. "get_data
    *& Form dis_data
    text
    FORM dis_data.
    key_info-header01 = 'MAT'.
    key_info-item01 = 'MAT'.
    key_info-header02 = 'WERKS'.
    key_info-item02 = 'WERKS'.
    REFRESH itab_head.
    LOOP AT itab_item.
    ON CHANGE OF itab_item-mat OR itab_item-werks.
    MOVE-CORRESPONDING itab_item TO itab_head.
    APPEND itab_head.
    ENDON.
    ENDLOOP.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
    i_callback_program = 'ZALV_PRDS'
    it_fieldcat = t_fcat
    it_sort = gt_subtot
    it_events = t_eve[]
    i_tabname_header = 'ITAB_HEAD'
    i_tabname_item = 'ITAB_ITEM'
    is_keyinfo = key_info
    TABLES
    t_outtab_header = itab_head
    t_outtab_item = itab_item
    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. "dis_data
    cheers,
    madhavi.

  • ADM Hierarchy List question

    It seems I'm not the only one having problems using an ADM Hierarchy list.  I've searched the forums and found people have similar issues, but for the life of me I can seem to get the list to display correctly for me.
    The list correctly displays the expand/collapse arrows, but where the text should be for each item is just a solid black rectangle.
    As instructed by other posters, I implemented the SetDrawProcResursive callback for the list, but the only area of the list I have access to draw into seems to be where the expand/collapse arrows are.  If I create a rectangle that extends into where the text is and paint it, it gets clipped to the arrow area.
    In the drawing callback function, I have tried calling the ADMListEntry->DefaultDraw, setting the background and text colors, and used every rectangle the API returns, but to no avail.
    I must be missing something, I just can't figure it out!  Is there a different callback I should be using?  Is there a list-item painting callback that isn't documented?

    I've got a fully customized & functioning hierarchy list and I don't seem to ever call SetDrawProcResursive(). I'm using a customized version of the IADMHierarchyList & ListEntry objects -- it looks like that gets set every time I create a BaseADMListEntry in its constructor. I don't seem to do anything except set the height recursively, so its standard.
    I then do something like this:
    IADMRect rect;
    GetLocalRect(rect);
    drawer.SetADMColor(GetBackgroundColour());
    drawer.FillRect(drawRect);
    // draw selection (similary to drawing background colour)
    // draw icon, etc.

  • How do I come back to the Hierarchy List Display screen?

    Hi Gurus,
    I have designed a report (Hierarchy Sequential List Display).
    I would select a few records from the resulting report (by clicking on checkboxes that i've provided in the report) and perform an event which inturn executes BDC code.
    After executing the event, I am displaying another screen where in I am displaying the result of BDC with Success/Error messages. Now in here when I press the back button it is taking me to the selection-screen.
    How can I get back to the report screen after pressing the back button on the message screen.
    Solution would be rewarded.
    Thanking You,
    Kiran Kumar S

    Hi Anji,
    I am not calling a screen exclusively for my BDC, so whatz happening is the new messages report is getting displayed on the same screen and I am losing the report screen. BDC is not written as a different program and hence I could not use SUBMIT.
    The thing I am doing is SET PF-STATUS 'xxx'. I have defined a GUI for 'xxx'.
    So this is setting GUI and then displaying the error/success messages report on the same screen.
    How do i handle this?
    Regards,
    Kiran

  • Hierarchial list display- multiple line selection

    hi all,
        In my program I have multiple item field records under a header field.When I select some of the item record line and press a button on application tool bar the control should be transferred to a transaction code.
        how can I accomplish this in hierarchial sequential list display.
      The code I used is:
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
      EXPORTING
      I_INTERFACE_CHECK              = ' '
       I_CALLBACK_PROGRAM             = GV_PROGNAME
       I_CALLBACK_PF_STATUS_SET       = 'ORDERS'
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
       IS_LAYOUT                      = X_LAYOUT
       IT_FIELDCAT                    = I_FCAT
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
       IT_SORT                        = LT_SORT
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
        i_tabname_header               = I_TAB_HEAD
        i_tabname_item                 = I_TAB_ITEM
      I_STRUCTURE_NAME_HEADER        =
      I_STRUCTURE_NAME_ITEM          =
        is_keyinfo                     = IKEYINFO
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                =
      IR_SALV_HIERSEQ_ADAPTER        =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      tables
        t_outtab_header                = I_HEADER
        t_outtab_item                  = I_ITEM
    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 USER_COMMAND USING r_ucomm LIKE sy-ucomm
                 rs_selfield TYPE slis_selfield.
    *at user-command.
    case r_ucomm.
    when 'SEL'.
    *IF sy-lsind = 1 .
        DO.
          CLEAR wa_item-chk.
          READ LINE sy-index FIELD VALUE wa_item-chk.
          IF sy-subrc <> 0.
            EXIT.
          ELSE.
            CHECK wa_item-chk = 'X'.
            IF rs_selfield-tabindex <> '0'. "CHECKS IF A VALID IS SELECTED OR NOT.
            CHECK i_item IS NOT INITIAL.
            READ TABLE i_item INTO wa_item INDEX rs_selfield-tabindex.
           SET PARAMETER ID 'VST' FIELD wa_item-vstel.
           call transaction 'VL03N' and skip first screen.
           endif.
           endif.
           enddo.
    endcase.
    endform.
                Please help me out with a solution.
                          Thanks in advance.

    hi,
    if u want to go to different transactions according to different fields u have selected than there is one field u can check that
    <b>selfield-fieldname</b>
    IF <b>selfield-fieldname</b> = 'VBELN'.
       SET PARAMETER ID 'VF' FIELD itab-vbeln.
      CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
    ELSEIF <b>selfield-fieldname</b> = 'MATNR'.
      SET PARAMETER ID 'MAT' FIELD t_mat.
      CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
    ENDIF.

  • SE30 - Hierarchy list?

    Anybody knows how to use the Call Hierarchy Menu Item that I can see disabled under the Goto menu of transaction SE30 (SE30 select analyze F7)?
    I remember that in old releases was possibile to view the list in HIER format but since SAP Web AS 6.20 I'was no more able.
    I also tried to customize the variant (Aggregation- By Call) without good results.

    Hi Sergio,
    I had the same problem and finally noticed full aggregation is the default setting... which prevents call hierarchy.
    To get past this, you should use a temporary variant in the "Restrictions" section, then click change icon, in the "Duratn/type" tab select none for aggregation and all features are restored.
    hope this helps!

  • Hierarchial list output to internal table

    Hi Folks,
    REPORT  ZMB51                                   .
    DATA LIST_TAB TYPE TABLE OF ABAPLIST.
    <b>DATA: BEGIN OF olist OCCURS 0,
            filler1(1500)   TYPE c,
          END OF olist.</b>
    submit RM07DOCS EXPORTING LIST TO MEMORY
                     AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        LISTOBJECT = LIST_TAB
      EXCEPTIONS
        NOT_FOUND  = 1
        OTHERS     = 2.
    IF SY-SUBRC = 0.
      CALL FUNCTION 'LIST_TO_ASCI'
        EXPORTING
          LIST_INDEX         = -1
        TABLES
          <b>LISTASCI           = oLIST</b>    
         LISTOBJECT         = LIST_TAB
        EXCEPTIONS
          EMPTY_LIST         = 1
          LIST_INDEX_INVALID = 2
          OTHERS             = 3.
    BREAK-POINT.
    write:/ sy-subrc.
    ENDIF.
    The above program is getting the MB51 output into an internal table.So far it is fine but this internal table can't  be used for further processing.I want to get the MB51 output into an internal table which can be used for further processing.
    data:begin of itab1 occurs 0,
         matnr  like mara-matnr,
         maktx like makt-maktx,
         werks like vbrp-werks,
         sloc like zmmstoragebin-storage,
         bwart like mseg-bwart,
         mblnr like mseg-mblnr,
         zeile like mseg-zeile,
         budat like bkpf-budat,
         menge like mseg-menge,
         meins like mara-meins,
         end of itab1.
    If I delcare an internal table as above and given itab1 instead of olist it is going for dump.How to achieve this?
    Thanks,
    K.Kiran.

    Hi Kiran,
    You will be getting all the fields in the concatenation form into the string of oLIST.
    Is there any delimitor like space or Tab between the fields or not?
    so try to use Split the oLIST-filler1 into different fields at the delimiter
    or you have to offet oLIST-filler1  to different fields
    like example 
    itab1-matnr = oLIST-filler1+0(18)
    itab1-werks = oLIST-filler1+19(4) like that
    based on the fields data in oLIST-filler1   you have to do it
    Regards
    Anji

  • Hierarchial List double click Event

    Hi Friends,
    I have developed a Heirarchial List using Function Modules.
    My requirement is when i double click on items(child) it has to go to a sap standard transaction.
    But Double clcik event is not working when i double click on any item. Can anybody pls  give me an idea
    how to achieve this?
    Thnaks in Advance.
    With regards,
    Rajgopal

    Dera friend,
                      follow the below mentioned code . hope u will undersatnd.
    Here is the procedure to handle Interactive ALV.
    1. declare events table like this.
    data :
          i_events  type slis_t_event,
          w_events  like line of i_events.
    2.
    Build events table .
    w_events-name = 'USER_COMMAND' .
    w_events-form = 'USER_COMMAND' .
    append w_events to i_events.
    clear w_events.
    3.
    pass this events table through REUSE_ALV_GRID_DISPLAY.
    4.
    USER_COMMAND call back subroutine should be like this in your case. This is nowhere called using PERFORM statement in ur program.
    5.
    USER_COMMAND subroutine should be like this.
    *&      Form  user_command
    form user_command using ucomm like sy-ucomm
                      selfield type slis_selfield.
      case ucomm .
        when '&IC1'. This is for double click on ALV output.  
       skip 10.
          position 10.
          write 'Double click was executed'.
      endcase.
    endform.                    "user_command
    selfield structure
    You can also handle Interactive ALV using this structure.
    types: begin of slis_selfield,
             tabname              type slis_tabname,
             tabindex             like sy-tabix,
             sumindex             like sy-tabix,
             endsum(1)            type c,
             sel_tab_field        type slis_sel_tab_field,
             value                type slis_entry,
             before_action(1)     type c,
             after_action(1)      type c,
             refresh(1)           type c,
             col_stable(1)        type c,
             row_stable(1)        type c,
           colwidth_optimize(1) type c,
             exit(1)              type c,
             fieldname            type slis_fieldname,
             grouplevel           type i,
             collect_from         type i,
             collect_to           type i,
           end of slis_selfield.
    You have to check the above structure in debug when u double click what the above contains. very helpful structure fo ur case.
    regards,
    PrashantH maturu.

  • How to get loops to list hierarchially in browser like before?

    I had a nice hierarchial list of my loop folders in the Loop Browser menu list for months, until I screwed it up today.
    I had made main folders for my loops which contained subfolders, like this:
    Beatnik (in gray lettering)
    (indented) Drums
    (indented) Percussion
    (indented) Synths
    and that whole section would be within divider marks, as a group. Then the next category, etc. etc. They were showing up in the browser menu that way, and I loved it. They were located in the root library/audio/Apple loops.
    Unfortunately, I moved my stuff around today, and now I lost that nice hierarchial list. When I reindexed everything, now only the main folders, i.e. Beatnik, including the Jam Pack, are listed under the heading called "Other" instead of by itself like it used to be within dividers. My subfolders are not showing up anymore like they used to be.
    I remember two things, vaguely: to get rid of stuff showing up in "Other" I had to get the folders out of the ~/...user loops, I think.
    I remember there was a little trick I stumbled upon to get this hierarchy, like an extra nested folder, or something. In fact, I added a new folder this morning and had to place it within another folder, or something like that to still get the hierarchy, now I don't remember what but I remember I had to do it twice to get it to work. Without that trick, it didn't work, and unfortunately, I didn't write it down or commit it to memory. But I had a great list.
    So, what causes the dividers to appear in the Apple Loop Browser Management list, so that folders will be listed hierarchially like they do in the finder? What is it that makes each section appear within the dividers? and show the hierarchy main folder/subfolder?
    How can I get this back? Thanks.

    Use the "Search Discussions" (upper right of this page) and use "question mark" as the search term. Limit the search to QuickTime.
    Look for pages that have the green "Solved" star at the top of the page to find the answer.

  • How can I get the checked item from a list that is generated automatically?

    I am still pretty new a CF and could really use some help. I am trying to get each item that is checked from a page that generates the list automatically from a query and get the associated textbox text with it. For example:
                        <!--- Start Get Data Hierarchy List--->
                                  <cfquery datasource="MyDatasource" name="qry_GetData">
                                            SELECT C.taxonomy_id, C.lvl, C.taxonomy_name, C.taxonomy_tree, C.taxonomy_guid, C.taxonomy_standard_name
                                            FROM dbo.taxonomy AS P
                                            JOIN dbo.taxonomy AS C
                                                      ON P.taxonomy_id = 21
                                                      AND C.hid.IsDescendantOf(P.hid) = 1
                                                      AND C.lvl = 3
                                  </cfquery>
                        <!--- Start Get Data Hierarchy List--->
    <cfloop query="qry_GetData">
    <input type="checkbox" name="cbox_PE_SelTax#taxonomy_id#" value="#taxonomy_name#"><font size="4" color="3399FF"> #taxonomy_name#</font>
    <br />
         - Details of experience with #taxonomy_name#:<input name="tbox_PE_SelTax#taxonomy_id#" id="tbox_PE_SelTax#taxonomy_id#" size="50%">
    <br />
    <br />
    </cfloop>

    Dave,
    Thank you for your help so far. I must not be asking the right question. Here is the whole breakdown. I am writing this page to collect the users information, Name, Title, Company, and technologies they are familiar with. I then want that information emailed to me upon submission. The point I am running into a problem (even with your last post) is how to write the action part of it that will email the checked items to me. I cannot figure out if I need to use CFLOOP (if so, how) or what the best method is. I am a very visual lerner and can understand how code works easily, but I have not found any examples for my situation. Again, I really appriciate all of your help thus far.
    Thank you!

  • How to send the alv list display to spool

    Hi all,
    I am executing a program in foreground. My requirement is sending alv list output to spool. When i execute the smae program in background mode the SAP is handling the spool output in hierarchial list display. How to get the same output in foreground also.
    Thanks and Regards,
    Vijay.

    Hi max,
    I think my question is not clear.
    when I execute my report in background mode, I can able to see the output in the spool.
    But when I execute the same report in foreground no spool output is getting generated.
    To handle this I am calling some function modules like RSPO_OPEN_SPOOLREQUEST , RSPO_WRITE_SPOOLREQUEST,  RSPO_WRITE_SPOOLREQUEST. But by using this i cannot able to get the desired output in alv list display format. what to do to get my desired output.
    Thanks and Regards,
    Vijay.

Maybe you are looking for