Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in hierarchical ALV.

arindam_samanta
Participant
0 Likes
915

Hi Experts,

I have created one report hierarchical ALV. My header table contains records like below:

and item table contains records like below:

and pass these two tables into FM REUSE_ALV_HIERSEQ_LIST_DISPLAY. Here one material ( 18461317 ) is two times but its BENUM and LQNUM are different.

But in output, for this MATNR two extra rows generated based on charg. I doubt this happen inside the FM.

Output is like below:

The strike-through records are unwanted. These two generated after execution of the ALV FM.

What is the reason behind this?

Thanks in advance,

Regards,

Arindam Samanta.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
866

All items will be displayed under each header that meet IS_KEYINFO links, if unique identifiers are not part of these links, you may and will generate duplicate records.

Can you try to add BENUM and LQNUM fields to item records and add those fields to IS_KEYINFO links.

Regards,

Raymond

3 REPLIES 3
Read only

RaymondGiuseppi
Active Contributor
0 Likes
867

All items will be displayed under each header that meet IS_KEYINFO links, if unique identifiers are not part of these links, you may and will generate duplicate records.

Can you try to add BENUM and LQNUM fields to item records and add those fields to IS_KEYINFO links.

Regards,

Raymond

Read only

0 Likes
866

Hi Raymond,

You have given exact solution. I changed code as you suggested. It's working fine.

Thanks & Regards,

Arindam Samanta.

Read only

Former Member
0 Likes
866

hi,

  g_key TYPE slis_keyinfo_alv.

  g_key-header01 = 'matnr'.
   G_KEY-ITEM01   = 'matnr

g_layout-expand_FIELDNAME = 'FOLD'.

  GS_FIELDCAT-FIELDNAME = 'MATNR'.
   GS_FIELDCAT-TABNAME = 'ITAB_H'. [ INTERNAL TABLE FOR HEADER]
   GS_FIELDCAT-row_pos = '1'.
   GS_FIELDCAT-REPTEXT_DDIC = 'MATERIAL NO'.


APPEND GS_FIELDCAT TO GT_FIELDCAT.

'.

CREATE antother fieldcatalog for item.

pass internal table gor item.


CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
     EXPORTING
*     I_INTERFACE_CHECK              = ' '
      I_CALLBACK_PROGRAM             = SY-REPID
*     I_CALLBACK_PF_STATUS_SET       = ' '
*     I_CALLBACK_USER_COMMAND        = ' '
      IS_LAYOUT                      = G_LAYOUT
      IT_FIELDCAT                    = GT_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                         = 'A'
*     IS_VARIANT                     =
*     IT_EVENTS                      =
*     IT_EVENT_EXIT                  =
       I_TABNAME_HEADER               = 'ITAB_H'
       I_TABNAME_ITEM                 = 'ITAB_L'
*     I_STRUCTURE_NAME_HEADER        =
*     I_STRUCTURE_NAME_ITEM          =
       IS_KEYINFO                     = G_KEY
*     IS_PRINT                       =
*     IS_REPREP_ID                   =
*     I_BYPASSING_BUFFER             = 'X'
*     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                = ITAB_H[]
       T_OUTTAB_ITEM                  = ITAB_L[]
*   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.

thanks

Sabyasachi