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

HELP -HIERARCHICAL DISPLAY

Former Member
0 Likes
911

hi,

pls help me to know the mandatory fields in REUSE_ALV_HIERSEQ_LIST_DISPLAY.

if possible explain with an example.

thanks ,

ganesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
880

hi ganesh,

try this sample code.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = WA_REPID

I_CALLBACK_PF_STATUS_SET = 'STATUS'

I_CALLBACK_USER_COMMAND = 'UCOMMAND'

IS_LAYOUT = WA_LAYOUT

IT_FIELDCAT = IT_FIELDC

IT_EVENTS = IT_EVENT

I_TABNAME_HEADER = 'IT_HEAD'

I_TABNAME_ITEM = 'IT_ITEM'

IS_KEYINFO = WA_KEYINFO

TABLES

T_OUTTAB_HEADER = IT_HEAD

T_OUTTAB_ITEM = IT_ITEM.

FORM UCOMMAND USING R_COMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD .

endform.

look into functional documentation,u understand better.

shan

6 REPLIES 6
Read only

Former Member
0 Likes
880

Some good examples

BALVBT02

BALVHD01

BALVHT01

BCALV_TEST_HIERSEQ_LIST

Regards,

Ravi

Note - Please mark the helpful answers

Read only

Former Member
0 Likes
880

Have a look at below link.

<a href="http://www.sap-img.com/abap/how-to-use-alv-for-hierarchical-lists.htm">Hierarchical Display</a>

If you want to know what all are the mandatory fields, then just go to SE37, enter the name of the FM i. e. REUSE_ALV_HIERSEQ_LIST_DISPLAY and in IMPORT and EXPORT parameters there is one check box OPTIONAL in front of each parameter, if it is checked then that parameter is optional otherwise it is mandatory.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
881

hi ganesh,

try this sample code.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = WA_REPID

I_CALLBACK_PF_STATUS_SET = 'STATUS'

I_CALLBACK_USER_COMMAND = 'UCOMMAND'

IS_LAYOUT = WA_LAYOUT

IT_FIELDCAT = IT_FIELDC

IT_EVENTS = IT_EVENT

I_TABNAME_HEADER = 'IT_HEAD'

I_TABNAME_ITEM = 'IT_ITEM'

IS_KEYINFO = WA_KEYINFO

TABLES

T_OUTTAB_HEADER = IT_HEAD

T_OUTTAB_ITEM = IT_ITEM.

FORM UCOMMAND USING R_COMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD .

endform.

look into functional documentation,u understand better.

shan

Read only

Former Member
0 Likes
880

Hi Ganesh,

Please check this thread for sample codes.

https://forums.sdn.sap.com/click.jspa?searchID=301737&messageID=1848579

also you can check these demo programs as well.

BCALV_TEST_HIERSEQ_LIST

BCALV_TEST_HIERSEQ_LIST_EVENTS

Hope this will help.

Regards,

Ferry Lianto

Read only

former_member69765
Contributor
0 Likes
880

I assume that u know about the Hierarchical lists... so I am just telling u the details.

You just have to pass the 1) Field Catalog, 2) the 2 internal tables with output data, 3) the names of the header and the item table and 4) u have to define the relationship between the header and items details.

I'll put the example in a while....

*******************

Read only

former_member69765
Contributor
0 Likes
880

here is the sample code... Just copy paste and enjoy ..

&----


*& Report Z_ALV_TRAINING_LIST_HOTSPOT

*&

&----


*&

*&

&----


REPORT Z_ALV_TRAINING_LIST_HOTSPOT.

type-pools slis.

data : it_header type standard table of t001 initial size 0,

it_item type standard table of bkpf initial size 0,

fl_key_info type SLIS_KEYINFO_ALV,

it_field_cat TYPE slis_t_fieldcat_alv.

select * from t001 into table it_header where bukrs le '1000'.

select * from bkpf into table it_item for all entries in it_header where bukrs = it_header-bukrs.

    • Define the relation ship

fl_key_info-header01 = 'BUKRS'.

fl_key_info-item01 = 'BUKRS'.

      • Define the Field catalog ***

              • Fill field Catalog ***************

PERFORM fill_field_catalog USING:

***************Header****************

  • Row POS TABLE FIELD JUST REF TAB REF FIELD

'01' '01' 'IT_HEADER' 'BUTXT' 'C' ' ' ' '

*TEXT LENGTH DDIC TXT

'Company Name' '45' 'M',

'02' '01' 'IT_HEADER' 'BUKRS' 'C' ' ' ' ' ' ' '55' 'M',

**************Item***************

  • Row *POS TABLE FIELD JUST REF TAB REF FIELD

'01' '01' 'IT_ITEM' 'BUKRS' 'L' 'T001' 'BUKRS'

*TEXT LENGTH DDIC TXT

'' '10' 'M',

  • Row *POS TABLE FIELD JUST REF TAB REF FIELD

'01' '02' 'IT_ITEM' 'BELNR' 'L' 'BKPF' 'BELNR'

*TEXT LENGTH DDIC TXT

'' '10' 'M'.

*******

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_CALLBACK_PROGRAM =

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • IS_LAYOUT =

IT_FIELDCAT = it_field_cat

  • 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 = 'IT_HEADER'

i_tabname_item = 'IT_ITEM'

  • I_STRUCTURE_NAME_HEADER =

  • I_STRUCTURE_NAME_ITEM =

is_keyinfo = fl_key_info

  • 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 = it_header

t_outtab_item = it_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.

&----


*& Form fill_field_catalog

&----


  • Subroutine to populate the field catalog internal table

----


FORM fill_field_catalog USING pv_row_pos TYPE sy-curow

pv_position TYPE sycucol "COLUMN

"POSITION

pv_table TYPE tabname "INTERNAL

"TABLE NAME

pv_fieldname TYPE fieldname "FIELD NAME

pv_just TYPE char1 "JUSTIFIED

pv_ref_tab TYPE tabname "REF. TABLE

"NAME

pv_ref_field TYPE fieldname "REF. FIELD

"NAME

pv_seltext_m TYPE c "TEXT

pv_out_length TYPE i "OUTPUT

"LENGTH

pv_ddictxt TYPE ddictxt. "DDIC TEXT

*Structure for ALV field catalog

DATA: ls_fieldcat TYPE slis_fieldcat_alv.

CLEAR ls_fieldcat.

*Structure for field catalog is populated

ls_fieldcat-row_pos = pv_row_pos .

ls_fieldcat-col_pos = pv_position.

ls_fieldcat-tabname = pv_table.

ls_fieldcat-fieldname = pv_fieldname.

ls_fieldcat-just = pv_just.

ls_fieldcat-ref_tabname = pv_ref_tab.

ls_fieldcat-ref_fieldname = pv_ref_field.

ls_fieldcat-seltext_m = pv_seltext_m.

ls_fieldcat-outputlen = pv_out_length.

ls_fieldcat-ddictxt = pv_ddictxt.

*Structure is appended to the internal table INT_FIELDCAT

APPEND ls_fieldcat TO it_field_cat.

ENDFORM. "fill_field_catalog