2014 Nov 19 2:37 PM
Dear Friends,
Am trying to Create BOM with Sub items . while using Standard FM (CAD_CREATE_BOM_WITH_SUB_ITEMS) it shows the error
Please refer my code
REPORT ZTEST_ABAP1 .
data: bom_header like cad_bicsk,
bom_item like cad_bom_item occurs 0 with header line,
bom_sub_item like cssubitem occurs 0 with header line,
dms_class_data like cls_charac occurs 0 with header line,
sap_field_data like rfcdmsdata occurs 0 with header line,
e_return like cad_return-value,
e_message like message-msgtx,
e_message_len like cad_return-message_len.
clear: bom_header, bom_item, bom_sub_item.
refresh: bom_item, bom_sub_item.
* fill BOM header
bom_header-matnr = 'HBBT00006'.
bom_header-werks = '1001'.
bom_header-datuv = '19.11.2014'.
* bom_header-stlal = '02'.
bom_header-stlan = '1'.
* bom_header-cadkz = ' '.
* bom_header-bmeng = '1'.
* bom_header-stktx = 'BOM text'.
* bom_header-ztext = 'BOM textt'.
clear: bom_item, bom_sub_item.
refresh: bom_item, bom_sub_item.
* fill item
bom_item-upskz = 'X'.
bom_item-idnrk = 'RALW00003'.
bom_item-posnr = '10'.
bom_item-postp = 'L'.
bom_item-menge = '1'.
bom_item-meins = 'KG'.
append bom_item.
bom_item-upskz = 'X'.
bom_item-idnrk = 'RBOB00003'.
bom_item-posnr = '20'.
bom_item-postp = 'L'.
bom_item-menge = '1'.
bom_item-meins = 'NOS'.
append bom_item.
* fill sub item
bom_sub_item-posid = '0001'.
bom_sub_item-ebort = 'test'.
bom_sub_item-upmng = '1'.
bom_sub_item-uposz = '0001'.
bom_sub_item-uptxt = 'test'.
append bom_sub_item.
bom_sub_item-posid = '0002'.
bom_sub_item-ebort = 'left'.
bom_sub_item-upmng = '1'.
bom_sub_item-uposz = '0001'.
bom_sub_item-uptxt = 'left side'.
append bom_sub_item.
* Call function
call function 'CAD_CREATE_BOM_WITH_SUB_ITEMS'
exporting
i_bom_header = bom_header
* I_AUTO_POSNR = ' '
IMPORTING
E_RETURN = e_return
E_MESSAGE = e_message
E_MESSAGE_LEN = e_message_len
E_BOM_HEADER = bom_header
tables
bom_item = bom_item
bom_sub_item = bom_sub_item
dms_class_data = dms_class_data
sap_field_data = sap_field_data
exceptions
others = 1.
if anyone found mistake in my code.please suggest me.
Regards,
Thangam.P
2014 Nov 20 4:16 AM
Hi ,
Anyone Please suggest me. its quite urgent.
Regards,
Thangam.P