Application Development 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: 

Query regarding FM: K_Hierarchy_Display(used in CK13 trsnction)

Former Member
0 Kudos

Hi All,

My reqiurement is to display the BOM details for multiple materials.

For that I am using the function module 'K_HIERARCHY_DISPLAY'.

I am passing the table(I_MAT) having the data to be displayed , the program name and the fieldcat table, which are the mandatory parameters.(Please refer the FM below).

The output which I get is just the hierarchical structure without any header/itemdata(Its only the lines).

Anyone knows which other parameters should be passed and if yes how?

Know any other FM for displaying muliple materials with their muliple levels.

CALL FUNCTION 'K_HIERARCHY_DISPLAY'

EXPORTING

i_tabname = 'I_MAT'

i_callback_prg = sy-repid

  • i_ucomm_form = ' '

  • i_top_of_page_form = ' '

  • i_display_form = ' '

  • i_node_insert_form = ' '

  • i_node_move_form = ' '

  • i_status_form = ' '

  • i_f1_help_form = ' '

  • i_start_column = 5

  • i_start_row = 0

  • i_end_column = 75

  • i_end_row = 20

i_tabulator = 0

i_length_opti = 'X'

  • i_compressed = ' '

i_header = 'X'

  • I_TITLE =

  • T_FIELDCAT_VIEWS =

  • T_FIELDCAT_VIEWS2 =

  • I_VARIANT =

TABLES

i_table = i_mat

i_field_cat = t_fieldcat[]

  • T_EXPAND =

  • T_VIEW_NAMES =

  • T_VIEW_TABULATORS =

  • T_FIELDGROUPS =

  • EXCEPTIONS

  • TOO_MANY_VIEWS = 1

  • KEY_TOO_LONG = 2

  • NO_LEVEL_DEFINED = 3

  • WRONG_TREE_STRUCTURE = 4

  • WRONG_NUMBER_OF_ALTERNATIVES = 5

  • OTHERS = 6

Thanks in advance,

Neethu Mohan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi neethu,

Instead of using the FM, U can use the class CL_STRUCTURE_EXPLOSION_TREE. It directly displays the BOM tree.

  • Get the KEKO key.

SELECT BZOBJ KALNR KALKA KADKY TVERS BWVAR KKZMA

UP TO 1 ROWS

FROM KEKO

INTO L_KEKOKEY

WHERE KADKY = U_KADKY

AND MATNR = U_MATNR

AND WERKS = U_WERKS

AND ALDAT = U_ALDAT

AND KLVAR = U_KLVAR

AND TVERS = U_TVERS

AND FEH_STA = U_FESTA.

ENDSELECT.

IF SY-SUBRC NE 0.

MESSAGE S244(25).

LEAVE LIST-PROCESSING.

ENDIF.

  • Create the BOM Tree - ( WITH CONTAINER )

CREATE OBJECT C_TREE

EXPORTING

IS_KEKOKEY = L_KEKOKEY

IX_EXPLODE_RAW = SPACE

IX_EXPLODE_BPO = TRUE

IX_EXPLODE_KF = TRUE

I_VIEW = U_SICHT (type CK_SICHT)

I_PARENT = U_CNTNR ( Container where u want to display the tree)

I_NO_TOOLBAR = SPACE

I_NO_HTML_HEADER = TRUE

I_OBJW = L_OBJ_CUR

I_ONLY_M = TRUE

I_ALLOW_REP_CALLS = TRUE

EXCEPTIONS

KEKO_NOT_FOUND = 1

others = 2.

IF SY-SUBRC NE 0.

MESSAGE I809(K/).

LEAVE PROGRAM.

ENDIF.

1 REPLY 1

Former Member
0 Kudos

Hi neethu,

Instead of using the FM, U can use the class CL_STRUCTURE_EXPLOSION_TREE. It directly displays the BOM tree.

  • Get the KEKO key.

SELECT BZOBJ KALNR KALKA KADKY TVERS BWVAR KKZMA

UP TO 1 ROWS

FROM KEKO

INTO L_KEKOKEY

WHERE KADKY = U_KADKY

AND MATNR = U_MATNR

AND WERKS = U_WERKS

AND ALDAT = U_ALDAT

AND KLVAR = U_KLVAR

AND TVERS = U_TVERS

AND FEH_STA = U_FESTA.

ENDSELECT.

IF SY-SUBRC NE 0.

MESSAGE S244(25).

LEAVE LIST-PROCESSING.

ENDIF.

  • Create the BOM Tree - ( WITH CONTAINER )

CREATE OBJECT C_TREE

EXPORTING

IS_KEKOKEY = L_KEKOKEY

IX_EXPLODE_RAW = SPACE

IX_EXPLODE_BPO = TRUE

IX_EXPLODE_KF = TRUE

I_VIEW = U_SICHT (type CK_SICHT)

I_PARENT = U_CNTNR ( Container where u want to display the tree)

I_NO_TOOLBAR = SPACE

I_NO_HTML_HEADER = TRUE

I_OBJW = L_OBJ_CUR

I_ONLY_M = TRUE

I_ALLOW_REP_CALLS = TRUE

EXCEPTIONS

KEKO_NOT_FOUND = 1

others = 2.

IF SY-SUBRC NE 0.

MESSAGE I809(K/).

LEAVE PROGRAM.

ENDIF.