Hierarchial display alv

hi friendz
i am new to abap.i tried executing the hierarchial display alv, but i did not get the output.though i got the field names in the output but there are no contents displayed.i am including the code here.please help me out.
rg
sandeep
REPORT  ZVV_ALV_HIERARCHIAL .
*--type pools
TYPE-POOLS: slis.
*--tables declaration
TABLES: SFLIGHT,SPFLI.
*--types declaration
DATA: BEGIN OF i_SFLIGHT OCCURS 0,
      CARRID LIKE SFLIGHT-CARRID,
      CONNID LIKE SFLIGHT-CONNID,
      FLDATE LIKE SFLIGHT-FLDATE,
       END OF i_SFLIGHT.
DATA: BEGIN OF i_SPFLI OCCURS 0,
      CARRID LIKE SPFLI-CARRID,
      CONNID LIKE SPFLI-CONNID,
     AIRPFROM LIKE SPFLI-AIRPFROM,
     AIRPTO LIKE SPFLI-AIRPTO,
       DISTANCE LIKE SPFLI-DISTANCE,
      END OF i_SPFLI.
*--variables
DATA: i_repid LIKE sy-repid.
i_repid = sy-repid.
DATA: i_field TYPE  slis_t_fieldcat_alv.
DATA: G_TABNAME_HEADER TYPE SLIS_TABNAME.
DATA: G_TABNAME_ITEM TYPE SLIS_TABNAME.
DATA: G_KEYINFO TYPE SLIS_KEYINFO_ALV.
*--select options
SELECT-OPTIONS :  S_CARRID FOR SFLIGHT-CARRID .
*--initialosation
INITIALIZATION.
*--selection screen on
AT SELECTION-SCREEN .
*--start of selection
START-OF-SELECTION.
  SELECT CARRID
         CONNID
         FLDATE
         FROM SFLIGHT INTO TABLE i_SFLIGHT
         WHERE CARRID IN S_CARRID.
IF NOT i_SFLIGHT IS INITIAL.
    SELECT CARRID
           CONNID
           DISTANCE
           INTO TABLE i_SPFLI FROM SPFLI
           FOR ALL ENTRIES IN I_SFLIGHT
           WHERE CARRID = i_SFLIGHT-CARRID.
  ENDIF.
  PERFORM fill_fieldcatalog1.
  PERFORM fill_fieldcatalog2.
  PERFORM HIERARCHY_ALV.
PERFORM alv_events.
G_KEYINFO-header01 = 'CARRID'.
G_KEYINFO-item01   = 'CONNID'.
G_TABNAME_HEADER = 'I_SFLIGHT'.
G_TABNAME_ITEM  = 'I_SPFLI'.
*&      Form  fill_fieldcatalog
FORM fill_fieldcatalog1 .
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
                   i_program_name               = i_repid
                   i_internal_tabname           = 'I_SFLIGHT'
                  i_structure_name             = EKPO
                 I_CLIENT_NEVER_DISPLAY       = 'X'
                   i_inclname                   = i_repid
                 I_BYPASSING_BUFFER           = 'X'
                 I_BUFFER_ACTIVE              = ''
    CHANGING
                   ct_fieldcat                  = i_field
               EXCEPTIONS
                 INCONSISTENT_INTERFACE       = 1
                 PROGRAM_ERROR                = 2
                 OTHERS                       = 3
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " fill_fieldcatalog
*&      Form  fill_fieldcatalog2
form fill_fieldcatalog2 .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
                   i_program_name               = i_repid
                   i_internal_tabname           = 'I_SPFLI'
                  i_structure_name             = EKPO
                 I_CLIENT_NEVER_DISPLAY       = 'X'
                  i_inclname                   = i_repid
                 I_BYPASSING_BUFFER           = 'X'
                 I_BUFFER_ACTIVE              = ''
    CHANGING
                   ct_fieldcat                  = i_field
               EXCEPTIONS
                 INCONSISTENT_INTERFACE       = 1
                 PROGRAM_ERROR                = 2
                 OTHERS                       = 3
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
endform.                    " fill_fieldcatalog2
*&      Form  HIERARCHY_ALV
form HIERARCHY_ALV .
               CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
                 EXPORTING
                 I_INTERFACE_CHECK              = ' '
                  I_CALLBACK_PROGRAM             = I_REPID
                 I_CALLBACK_PF_STATUS_SET       = ' '
                 I_CALLBACK_USER_COMMAND        = ' '
                 IS_LAYOUT                      =
                  IT_FIELDCAT                    = I_FIELD
                 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                         = 'A '
                 IS_VARIANT                     =
                 IT_EVENTS                      = I_EVENTS
                 IT_EVENT_EXIT                  =
                   i_tabname_header               = G_TABNAME_HEADER
                   i_tabname_item                 = G_TABNAME_ITEM
                 I_STRUCTURE_NAME_HEADER        =
                 I_STRUCTURE_NAME_ITEM          =
                   is_keyinfo                     = G_KEYINFO
                 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                = I_SFLIGHT
                   t_outtab_item                  = I_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.                    " HIERARCHY_ALV

The program works fine if there is no data in the I_SPFLI. But if the table I_SPFLI is populated it shows an error like 'Unable to interpret "AA " as a number' where AA is the CARRID.
If the header01 is changed to CONNID the program works well. Here is the program.
TYPE-POOLS: slis.
*--tables declaration
TABLES: SFLIGHT,SPFLI.
*--types declaration
DATA: BEGIN OF i_SFLIGHT OCCURS 0,
CARRID LIKE SFLIGHT-CARRID,
CONNID LIKE SFLIGHT-CONNID,
FLDATE LIKE SFLIGHT-FLDATE,
END OF i_SFLIGHT.
DATA: BEGIN OF i_SPFLI OCCURS 0,
CARRID LIKE SPFLI-CARRID,
CONNID LIKE SPFLI-CONNID,
* AIRPFROM LIKE SPFLI-AIRPFROM,
* AIRPTO LIKE SPFLI-AIRPTO,
DISTANCE LIKE SPFLI-DISTANCE,
END OF i_SPFLI.
*--variables
DATA: i_repid LIKE sy-repid.
i_repid = sy-repid.
DATA: i_field TYPE slis_t_fieldcat_alv.
DATA: i_field2 TYPE slis_t_fieldcat_alv.
DATA: G_TABNAME_HEADER TYPE SLIS_TABNAME.
DATA: G_TABNAME_ITEM TYPE SLIS_TABNAME.
DATA: G_KEYINFO TYPE SLIS_KEYINFO_ALV.
*--select options
SELECT-OPTIONS : S_CARRID FOR SFLIGHT-CARRID .
*--initialosation
INITIALIZATION.
*--selection screen on
AT SELECTION-SCREEN .
*--start of selection
START-OF-SELECTION.
SELECT CARRID
CONNID
FLDATE
FROM SFLIGHT INTO TABLE i_SFLIGHT
WHERE CARRID IN S_CARRID.
IF i_SFLIGHT[] IS NOT INITIAL.
SELECT CARRID
CONNID
DISTANCE
INTO TABLE i_SPFLI FROM SPFLI
FOR ALL ENTRIES IN I_SFLIGHT
WHERE CARRID = i_SFLIGHT-CARRID.
IF sy-subrc NE 0.
  MESSAGE e001(z538msg).
ENDIF.
ENDIF.
PERFORM fill_fieldcatalog1.
PERFORM fill_fieldcatalog2.
PERFORM HIERARCHY_ALV.
* PERFORM alv_events.
G_KEYINFO-header01 = 'CARRID'.
G_KEYINFO-item01 = 'CONNID'.
G_TABNAME_HEADER = 'I_SFLIGHT'.
G_TABNAME_ITEM = 'I_SPFLI'.
*& Form fill_fieldcatalog
FORM fill_fieldcatalog1 .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = i_repid
i_internal_tabname = 'I_SFLIGHT'
* i_structure_name = EKPO
* I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = i_repid
* I_BYPASSING_BUFFER = 'X'
* I_BUFFER_ACTIVE = ''
CHANGING
ct_fieldcat = i_field
* EXCEPTIONS
* INCONSISTENT_INTERFACE = 1
* PROGRAM_ERROR = 2
* OTHERS = 3
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " fill_fieldcatalog
*& Form fill_fieldcatalog2
form fill_fieldcatalog2 .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = i_repid
i_internal_tabname = 'I_SPFLI'
* i_structure_name = EKPO
* I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = i_repid
* I_BYPASSING_BUFFER = 'X'
* I_BUFFER_ACTIVE = ''
CHANGING
ct_fieldcat = i_field
* EXCEPTIONS
* INCONSISTENT_INTERFACE = 1
* PROGRAM_ERROR = 2
* OTHERS = 3
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " fill_fieldcatalog2
*& Form HIERARCHY_ALV
form HIERARCHY_ALV .
<b>*G_KEYINFO-header01 = 'CARRID'.</b>
<b>G_KEYINFO-header01 = 'CONNID'.</b>
G_KEYINFO-item01 = 'CONNID'.
G_TABNAME_HEADER = 'I_SFLIGHT'.
G_TABNAME_ITEM = 'I_SPFLI'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = I_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IS_LAYOUT =
IT_FIELDCAT = I_FIELD
* 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 = 'A'
* IS_VARIANT =
* IT_EVENTS = I_EVENTS
* IT_EVENT_EXIT =
i_tabname_header = G_TABNAME_HEADER
i_tabname_item = G_TABNAME_ITEM
* I_STRUCTURE_NAME_HEADER =
* I_STRUCTURE_NAME_ITEM =
is_keyinfo = G_KEYINFO
* 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 = I_SFLIGHT
t_outtab_item = I_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. " HIERARCHY_ALV

Similar Messages

  • Need a sample program for hierarchial oops ALV report

    Hello experts,
                     I Need a sample program for hierarchial oops ALV report.

    Hi,
       Check the following sample code...
    T A B L E S
    tables : ekko.
      data definition
    types : begin of ty_ekko,
              ebeln type ekko-ebeln,
              lifnr type ekko-lifnr,
              bsart type ekko-bsart,
              aedat type ekko-aedat,
              ernam type ekko-ernam,
            end of ty_ekko.
    types : begin of ty_eket,
               ebeln type ekpo-ebeln,
               ebelp type ekpo-ebelp,
               werks type ekpo-werks,
               matnr type ekpo-matnr,
               menge type eket-menge,
               wamng type eket-wamng,
               netpr type ekpo-netpr,
            end of ty_eket.
    data : it_ekko type table of ty_ekko,
           it_eket type table of ty_eket.
    data: ob_hieralv type ref to cl_salv_hierseq_table.
    data: it_binding type salv_t_hierseq_binding,
          is_binding type salv_s_hierseq_binding.
    S E L C T O P T I O N S
    select-options : s_ebeln for ekko-ebeln.
    S T A R T O F S E L E C T I O N
    start-of-selection.
    select ebeln
           lifnr
           bsart
           aedat
           ernam from ekko
    into corresponding fields of table it_ekko
    where ebeln in s_ebeln.
    if sy-subrc eq 0.
    select aebeln aebelp
           awerks amatnr
           bmenge bwamng
           a~netpr from ekpo as a join eket as b
                     on  amandt = bmandt
                     and aebeln = bebeln
                     and aebelp = bebelp
                   into corresponding fields of table it_eket
                  where a~ebeln in s_ebeln.
    endif.
    is_binding-master = 'EBELN'.
    is_binding-slave = 'EBELN'.
    append is_binding to it_binding.
    *TRY.
    call method cl_salv_hierseq_table=>factory
    exporting
    t_binding_level1_level2 = it_binding
    importing
    r_hierseq = ob_hieralv
    changing
    t_table_level1 = it_ekko
    t_table_level2 = it_eket .
    *CATCH cx_salv_data_error .
    *CATCH cx_salv_not_found .
    *ENDTRY.
    call method ob_hieralv->display( ).
    Cheers,
    Ram

  • Help needed Displaying ALV  Secondary list without using oops concept

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

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

  • WebI issue with hierarchy display and aggregation

    Trying to wrangle what looks like a defect in WebI's handling of hierarchy display and aggregation. We just completed an update cycle and are running BOBJ 4.1 SP4.
    The hierarchy is a standard FM Commitment Item hierarchy in which both the nodes and leaves are Commitment Items (i.e. it uses InfoObject nodes, not text nodes). An example of one of these nodes looks like this in BW:
    Cmmt_Item A - Node
        Cmmt_Item B - Leaf
        Cmmt_Item C - Leaf
    Let's pretend Commitment Item A has $50 posted to it, B has $20 and C has $30. Analysis for OLAP handles this by adding a virtual leaf line to distinguish postings that are on the parent node like so:
    Cmmt_Item A - Node       $100
        Cmmt_Item A - Leaf    $50
        Cmmt_Item B - Leaf    $20
        Cmmt_Item C - Leaf    $30
    So you see both the total for the node ($100) and a line for each Commitment Items with KFs posted to them. Our users like this. They can easily see the aggregation and the breakdown.
    WebI, on the other hand, will display it like this:
    Cmmt_Item A - Node       $150
        Cmmt_Item B - Leaf    $20
        Cmmt_Item C - Leaf    $30
    It doesn't create a separate line for the value of the parent node, but it does add it's value into the aggregate. Twice. Modifying the table with the 'avoid duplicate row aggregation' checkbox yields output like this:
    Cmmt_Item A - Node       $100
    Cmmt_Item A - Node        $50
        Cmmt_Item B - Leaf    $20
        Cmmt_Item C - Leaf    $30
    We're about halfway there. While the top row now shows the correct aggregation and it creates a new line to show the distinct amount on the parent node, that new line appears on the same level as the parent. It's no longer clear that there's an aggregate and a breakdown. And attempting to expand or contract a node will now crash the report with one of those 'Error 16' messages.
    Has anyone encountered this issue with hierarchies in WebI? This report was built from scratch in 4.1, so I'm not sure if this affects older versions or not. Or if it would affect any hierarchy that uses InfoObject nodes instead of text nodes.

    Without a fix, the simplest workaround I can think of would be to restructure the hierarchy. It can't use postable nodes, so Cmmt_Item A  - Node from my example would need to be converted into a text node and the postable characteristic added as a child on the same level as the B and C leaves.
    This looks like it would affect anyone using hierarchies with postable nodes in a WebI report.
    Another oddity in WebI's behavior here - even though the postable nodes show incorrect sums the sum at the root node is correct. So extending my examples from the original post:
    Root Node                    $100
        Cmmt_Item A - Node       $150
            Cmmt_Item B - Leaf    $20
            Cmmt_Item C - Leaf    $30

  • Error in BO Webi using Authorization analysis in Bex with hierarchy display

    Hi Experts ,
    When we run the WEBI report created on bex query which has 0comp_code restricted with characteristic variable  of processing type Authorization and Not ready for input.
    The hierarchy display is active in Bex (as we want to see L01, L02.... in webi)
    The authorization analysis is working perfectly when I test in Bex analyser (at any drill down level).
    But in BO webi, I get below error
    The database error text is: The supplied XML is not valid. [char name & Level].
    I dont get this error when I deactivate hierarchy display in Bex.
    Also I dont get this error for user ids having 0BI_ALL
    Please help me to resolve this.
    Thanks
    Savio

    Hi Atul,
    You can achieve this by dragging these two fields in the filter bar section of the webi. then apply variables on these fields.
    hope it helps
    Regards,
    Rathy

  • Reg. can we display alv grid using field groups (extracts)

    Hi,
    can we display alv grid using field groups (extracts). is this possible. i have to develop a blocked alv.
    tnks
    Yerukala Setty

    No, you will need the data in an internal table to use ALV.
    Cheers
    Allan

  • 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.

  • Displaying ALV as in standard Tcode FBL5N

    Hi Experts,
    My requirement is to display ALV list sorted on company code, Customer number and currency fields. Then it should be subtotaled based on the currency field and sum up payment amount field as displayed in standard transaction FBL5N.
    I have done till this part by making the it_sort-subtotal field = 'X' In currency field. And field fieldcat-do_sum = 'X' on Payment amount field.
    Now the ALV list should display separate totals for each currency after every customer. Then the grand total for every currency after every company code for all the customers in that company code. And in the end of ALV grand total should be displayed based on adding all the subtotals for each currency.
    For example :
    COMPANY CODE   ||     CUSTOMER   ||   PAYMENT AMOUNT  ||   CURRENCY
    2030                       ||            6             ||           5.00                  ||        USD
    2030                       ||            6             ||          1.00                   ||        USD
                                      TOTAL                         6.00                             USD
    2030                     ||            6               ||       4.00                      ||          SGD
                                  ||            6               ||       3.00                      ||          SGD
                                     TOTAL                        7.00                               SGD
                                                                       6                                      USD
                                                                       7                                      SGD
    2030                  ||              6318          ||            1.00                  ||       NZD
    2030                  ||              6318          ||         2.00                     ||       NZD
                                          TOTAL                     3.00                              NZD
      2030                 ||                 6318          ||         4.00                    ||       USD
      2030                 ||                   6318        ||              1.00               ||       USD
                                        TOTAL                    5.00                                  USD
                                                                      3.00                                  NZD
                                                                      5.00                                  USD
    ============================================================
                         11.00                                 USD
                                                                       7.00                                 SGD
                                                                      3.00                                   NZD
    I Hope I made myself clear. Please help on the issue.
    Edited by: Sunanda05 on Apr 13, 2011 9:08 AM
    Edited by: Sunanda05 on Apr 13, 2011 9:14 AM
    Edited by: Sunanda05 on Apr 13, 2011 10:08 AM

    Note Still Valid in Market place.
    "SAP Note 1111155 - FSCM-DM: Termination "Open SQL
    statement is too large."
    Note Language: English Version: 10 Validity: Valid Since 07-28-2010
    Summary
    Symptom
    When you access dispute case using the integration (creating dispute case
    using FI transactions (for example, FBL5N), clearing items to which dispute
    case have been assigned), the system issues the dump "Open SQL statement is
    too large".
    The error occurs if there are many (more than 1000) dispute cases for a
    customer.
    Other terms
    FBL5N, FBZ1, F-32, integration
    Reason and Prerequisites
    This problem is due to a very large dispute case volume.
    Solution
    Import the relevant Support Package or implement the attached correction
    instructions.
    Header Data
    Release Status: Released for Customer
    Released on: 07-28-2010 08:02:45
    Master Language: German
    Priority: Correction with medium priority
    Category: Program error
    Primary Component: FIN-FSCM-DM Dispute Management
    Valid Releases
    Software Component Release From
    Release
    To
    Release
    and
    Subsequent
    SAP_APPL 600 600 600
    SAP_APPL 602 602 602
    SAP_APPL 603 603 603
    SAP_APPL 604 604 604
    SAP_APPL 605 605 605
    PI 2004.1 2004_1_47"

  • Problem in displaying Alv grid output  using oops........

    hi,
    i have two problems in displaying ALV grid output Using Oops.
    1) How to modify the fieldcatalog after we getting a field catalog using general FM.
    2) initialy it is displaying 13 fields but there are 63 fields .
       eventhough we chage the layout to 63 fields it is displaying only 13 fields , these 13 fields may be different based on our selection but count  of displayed fileds are same . how can display 63 fields at a time .

    Hi,
    You can chnage using below code:
    loop at gt_fieldcat.
    if <gt_fieldcat-field_name> = 'FIELDNAME'.
    endif.
    modify gt_fieldcat.
    clear gt_fieldcat.
    endloop.
    Make sure that all the field should not have no_out = 'X' and tech = 'X'.
    Thanks,
    Sriram Ponna.

  • BEx Hierarchy Display

    In a report we are using orgunit hierarchy and we have another field in the report Manager name (manager of the orgunit).  Currently at the top level of the hierarchy all managers are displayed for every node under it. Example
    Level 1
    Org 1----Manager 3
    Manager 2
    Manager 1
    Level 2
    Org 2-----Manager 2
    Manager 1
    Level 3
    Org 3----Manager 1
    Is there a way to only display Manager 3 for Org 1 and Manager 2 for Org 2? We thought about compounding orgunit with manager but we could run into an issue with time dependency.  Any other suggestions without removing the hierarchy display?

    Not sure if this fits your situation or not, but look in orgunit and see if there is a manager in there already (if not you can customize it and add it in).  Then you can display the orgunit on your report and then also display the orgunit's manager attribute.
    You are displaying the manager and orgunit from transaction data.  This manager could be the employee's manager, cost center manager, orgunit manager, etc... 
    Brian

  • Need class name to display ALV list (not Grid) in objects..

    hi,
    i need to display ALV list ( not ALV Grid ) in objects.. i dont the class name for tat.. so plz can anyone help me out for the same..
    thanks in advance..

    With cl_salv_table you can have both grid or list, depending what you want.
          cl_salv_table=>factory(
             EXPORTING
               list_display   = 'X'  "when space then GRID, when 'X' then LIST
             IMPORTING
               r_salv_table  = ref_table
             CHANGING
               t_table       = gt_sflight ).
    Regards
    Marcin

  • Flush displayed ALV and display normal posting messages on same screen

    Hi,
    I have a requirement wherein i have displayed ALV with execute button on same screen with FI data displayed in ALV.
    Now when user select one particular row and excute it , the requirement is to flush that ALV displayed and display normal
    message such as POSTING DONE
    How can i achieve it ? I am using REUSE_ALV_LIST

    What do you mean by "Now when user select one particular row and excute it "???
    Meaning you do some event like double clicking on that particular row or after selecting it, you will trigger some button?
    For 1st condition, make sure you've created an ALV event.
    If 2nd one, either you create/modify the ALV toolbar.
    Then you can do a simple call screen to exit from that ALV. Or a simple pop up message.

  • Erro in Hierarchy Display in Crystal Report 2008

    HI Experts,
    I have connected MDX Query with Crystal Reports 2008. In my MDX Query, I took G/L Account as an Info-object Hierarchy in which there are more than 10 nodes and each nodes having G/L accounts range. When i tried to create  a crystal report from MDX query, in G/L account field i am not getting hierarchy but all G/L accounts comes together.
    How to get hierarchy of an infoobject in crystal report ?
    Regards,
    Rishit Kamdar

    HI,
    to get or find an answer/solution about your question/problem?
    I planning also to use Hierarchy Display in CR. And it is very interessting for me to know if that is working.
    Thanks
    Andreas

  • Hiding few columns before displaying alv grid output

    Hi All,
    I struck up at hiding few columns before displaying alv output. I have used used FM: REUSE_ALV_GRID_DISPLAY. By using this i am displaying 29 fields to the output. But before displaying the output i want to hide few columns among them, and also those fields have to be avialable for further selection by the user by using layout.
    Kindly help me in this,
    Regards
    Srinivas K

    Hi,
    In field catalog set NO_OUT='X' for all the columns you want to hide. They will be available when changing layout for ALV, so you can show them at any time.
    Regards
    Marcin

  • Hierarchy in ALV Table

    Hello everyone!
    Could anybody advise good article about hierarchy in ALV? I saw some example on help.sap.com, but it's too short and useless.
    I can't figure out whether ALV has the same flexibility as Table component in terms of hierarchy. I need to present hierarchy from BW, based on parent-child relationship.
    Edited by: Konstantin Milutin on Jul 26, 2010 8:35 AM

    Hi , Check out this article about hierarchy in ALV
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f
    Regards
    Chinnaiya P

Maybe you are looking for

  • Which O/S upgrade is recommended for a MAC Book Pro17 with Intel Core Duo 2.16 GHz

    Which O/S upgrade is recommended for a MAC Book Pro17 with Intel Core Duo 2.16 GHz I am using os x 10.4.11. Do I need to upgrade to 10.5.xx? Will this platform suport 10.6.xx? If 10.6 will work do I need to install 10.5 first? Thanks...

  • A different error every time I sync my iPod Touch 64GB

    I have an iPod Touch 64GB. After iOS4 upgrade and iTunes update, at least half of the times I connect it to my pc (Windows 7 64bit) some error comes up like, the ipod is disconnected (when it's not), a duplicate file has been created, the requested f

  • Jdbc-odbc java error using SQL adapter in o9iASWireless

    I've used the SQL adapter in the previous releases of wireless without any problem. Most of the time I would use it for all the wireless PLSQL applications in the Oracle database and it works very OK. I have also used it to connect with a SQLserver d

  • Airport Utility

    I have a Powerbook G4 and just purchased the new airport extreme (802.11n). I have been able to connect to the internet with it, but when I go into the Airport Utility, I recieve an alert that states my version doesnt support this one. When searching

  • [SOLVED] Error in journalctl after replacing netctl wth NetworkManager

    Following the Archlinux installation wiki, I installed netctl and configured a new wifi profile (I called it "my-network"), some time ago I replaced netctl with NetworkManager and I think I deleted the wifi profile I created (I can't find it anywhere