Fonction SAP CAD_CREATE_BOM_WITH_SUB_ITEMS - CAD: create BOM with sub-items (in background)

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
I_AUTO_POSNR DRAW-LOEDK C 1 ' ' X 'X' -> automatic allocation of item numbers
I_BOM_HEADER CAD_BICSK u 610 New BOM header data

Paramètre Reférence Type Long. Description
E_BOM_HEADER CAD_BICSK u 610 BOM header data for the created BOM
E_MESSAGE MESSAGE-MSGTX C 200 Message
E_MESSAGE_LEN CAD_RETURN-MESSAGE_LEN C 4 Length of message
E_RETURN CAD_RETURN-VALUE C 10 Return value

Paramètre Reférence Long. Facultatif Description
BOM_ITEM CAD_BOM_ITEM 604 New BOM items
BOM_SUB_ITEM CSSUBITEM 85 New BOM sub-items
DMS_CLASS_DATA CLS_CHARAC 99 Currently not in use
SAP_FIELD_DATA RFCDMSDATA 330 Currently not in use

Functionality
This function allows a BOM with sub-items to be created in thebackground. No SAP dialog screens are processed.
In the structure I_BOM_HEADER you must enter the BOM header data. Theitems and sub-items are trasnferred into the tables BOM_ITEM andBOM_SUB_ITEM.

Example
...
data: bom_header like bicsk,
bom_item like csrfcitem 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 = 'AH10'.
bom_header-stlal = '01'.
bom_header-stlan = '1'.
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 = 'AH20'.
bom_item-posnr = '10'.
bom_item-postp = 'L'.
bom_item-menge = '1'.
append bom_item.
bom_item-upskz = 'X'.
bom_item-idnrk = 'AH30'.
bom_item-posnr = '20'.
bom_item-postp = 'L'.
bom_item-menge = '1'.
append bom_item.
* fill sub item
bom_sub_item-posid = '1'.
bom_sub_item-ebort = 'test'.
bom_sub_item-upmng = '1'.
bom_sub_item-uposz = '1'.
bom_sub_item-uptxt = 'test'.
append bom_sub_item.
bom_sub_item-posid = '2'.
bom_sub_item-ebort = 'left'.
bom_sub_item-upmng = '1'.
bom_sub_item-uposz = '1'.
bom_sub_item-uptxt = 'left side'.
append bom_sub_item.
bom_sub_item-posid = '2'.
bom_sub_item-ebort = 'right'.
bom_sub_item-upmng = '1'.
bom_sub_item-uposz = '2'.
bom_sub_item-uptxt = 'right side'.
* 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.
...

Description
Table with BOM items
When a BOM item has the attribute UPSKZ set to "X" you can transfersub-items from the table BOM_SUB_ITEMS for this item
The table has the set-up structure CSRFCITEM.

Description
Not currently in use.

401467CAD: doubling the document BOM items