2013 Oct 07 10:37 AM
Hi guys,
I have search for this in the forum but could not find what I am doing wrong.
I'm using the BAPI_SALESORDER_CREATEFROMDAT2 to create a sales order, but it is not passing the Item Configuration.
This is what I'm filling in the tables:
* ITEMS
CLEAR gt_order_items_in.
gt_order_items_in-itm_number = g_posnr = '000001'.
gt_order_items_in-hg_lv_item = '000000'.
gt_order_items_in-po_itm_no = '1'.
gt_order_items_in-material = MATNR.
* gt_order_items_in-alt_to_itm = '000000'.
* gt_order_items_in-dlv_group = '000'.
gt_order_items_in-plant = 'ZCAA'.
gt_order_items_in-ref_1 = '8810997'.
*ITEM_CATEG
APPEND gt_order_items_in.
CLEAR gt_order_items_inx.
gt_order_items_inx-itm_number = g_posnr. "'000001'.
gt_order_items_inx-po_itm_no = 'X'.
APPEND gt_order_items_inx.
* INST
clear gt_order_cfgs_inst.
gt_order_cfgs_inst-config_id = '000001'.
gt_order_cfgs_inst-inst_id = '00000001'.
gt_order_cfgs_inst-obj_type = 'MARA'.
gt_order_cfgs_inst-class_type = '300'.
gt_order_cfgs_inst-obj_key = MATNR.
append gt_order_cfgs_inst.
* REF
clear gt_order_cfgs_ref.
gt_order_cfgs_ref-posex = '000001'.
gt_order_cfgs_ref-config_id = '000001'.
gt_order_cfgs_ref-root_id = '00000001'.
append gt_order_cfgs_ref.
*DEST
clear gt_order_cfgs_value.
gt_order_cfgs_value-config_id = '000001'.
gt_order_cfgs_value-inst_id = '00000001'.
gt_order_cfgs_value-charc = 'DEST'.
gt_order_cfgs_value-value = 'ES'.
append gt_order_cfgs_value.
The Item Configuration is not passed to the Sales Order.
Any Idea??
Tanks in advance.
Best Regards,
Francisco Coutinho
ToInovate
2013 Oct 07 5:01 PM
Solved my problem with SAP NOTE 549563.
There is a "higher" note that is 774346 .
But basically, when you fill like this:
ITEM:
po_itm_no = '000001'.
ITEMX:
po_itm_no = 'X'.
This will state that the itm_no will have configuration.
On the configuration:
clear gt_order_cfgs_inst.
gt_order_cfgs_inst-config_id = '000001'.
gt_order_cfgs_inst-inst_id = '00000001'.
gt_order_cfgs_inst-obj_type = 'MARA'.
gt_order_cfgs_inst-class_type = '300'.
gt_order_cfgs_inst-obj_key = matnr.
append gt_order_cfgs_inst.
clear gt_order_cfgs_ref.
gt_order_cfgs_ref-posex = item-po_itm_no. (000001)
gt_order_cfgs_ref-config_id = gt_order_cfgs_inst-config_id.
gt_order_cfgs_ref-root_id = gt_order_cfgs_inst-inst_id.
gt_order_cfgs_ref-kbname = znave_edp_mater-matnr.
unpack gt_order_cfgs_ref-root_id to gt_order_cfgs_ref-root_id.
append gt_order_cfgs_ref.
clear gt_order_cfgs_value.
gt_order_cfgs_value-config_id = gt_order_cfgs_ref-config_id.
gt_order_cfgs_value-inst_id = gt_order_cfgs_inst-inst_id.
gt_order_cfgs_value-charc = 'CARA'.
gt_order_cfgs_value-value = '0000'.
append gt_order_cfgs_value.
This will work.
Otherwise, try to see if the material is configurable and the CLASS_TYPE is correct as well.
Best Regards,
Francisco Coutinho
2013 Oct 07 5:01 PM
Solved my problem with SAP NOTE 549563.
There is a "higher" note that is 774346 .
But basically, when you fill like this:
ITEM:
po_itm_no = '000001'.
ITEMX:
po_itm_no = 'X'.
This will state that the itm_no will have configuration.
On the configuration:
clear gt_order_cfgs_inst.
gt_order_cfgs_inst-config_id = '000001'.
gt_order_cfgs_inst-inst_id = '00000001'.
gt_order_cfgs_inst-obj_type = 'MARA'.
gt_order_cfgs_inst-class_type = '300'.
gt_order_cfgs_inst-obj_key = matnr.
append gt_order_cfgs_inst.
clear gt_order_cfgs_ref.
gt_order_cfgs_ref-posex = item-po_itm_no. (000001)
gt_order_cfgs_ref-config_id = gt_order_cfgs_inst-config_id.
gt_order_cfgs_ref-root_id = gt_order_cfgs_inst-inst_id.
gt_order_cfgs_ref-kbname = znave_edp_mater-matnr.
unpack gt_order_cfgs_ref-root_id to gt_order_cfgs_ref-root_id.
append gt_order_cfgs_ref.
clear gt_order_cfgs_value.
gt_order_cfgs_value-config_id = gt_order_cfgs_ref-config_id.
gt_order_cfgs_value-inst_id = gt_order_cfgs_inst-inst_id.
gt_order_cfgs_value-charc = 'CARA'.
gt_order_cfgs_value-value = '0000'.
append gt_order_cfgs_value.
This will work.
Otherwise, try to see if the material is configurable and the CLASS_TYPE is correct as well.
Best Regards,
Francisco Coutinho