‎2007 Jan 16 10:29 PM
Hi,
I need to do a recursive call to 'CABM_READ_BOM' using different matnr each time. Data will be stored in i_exp_bom_head and i_exp_bom_item. Since this is a recursive call to the same routine and iterations depend on the level of BOM how can I keep track of the internal tables returned by its level?
FORM READ_BOM using p_matnr.
CALL FUNCTION 'CABM_READ_BOM'
EXPORTING
i_matnr = p_matnr
i_werks = i_bom_select-werks
i_vbeln = i_bom_select-vbeln
i_vbpos = i_bom_select-posnr
i_stlal = i_bom_select-stlal
i_stlan = i_bom_select-stlan
i_datuv = i_bom_select-erdat
TABLES
exp_bom_data = i_exp_bom_head
exp_itm_data = i_exp_bom_item
EXCEPTIONS
no_record_found = 1
OTHERS = 2.
LOOP AT i_exp_bom_item WHERE postp = 'N'.
PERFORM READ_BOM using i_exp_bom_item-idnrk.
ENDLOOP.
ENDFORM.
Points will be awarded.
Thanks!
‎2007 Jan 16 10:35 PM
Hi,
Why dont you try FM: PM_HIERARCHY_CALL_BOM_MARA?
I dont know if this would satisfy your requirement.
Regards
Subramanian
‎2007 Jan 16 10:53 PM
Hi Subramanian,
Thank you for your prompt reply.
I'm trying to create master BOM and sub BOM depending on how many levels it is.
IF i_exp_bom_item-POSTP = 'N' then I call the function module again to create sub BOM. I will call the function module recursively until i_exp_bom_item-POSTP <> 'N'. That will be the lowest level.
Message was edited by:
Alex Nguyen
‎2011 May 20 3:56 PM
Hi Alex,
Pls share the solution for your problem.
I am also facing the same problem.
Thanks,
SAtendra