‎2009 Mar 17 11:37 AM
hi all..
can anyone help me with documents or sample to upload data using BAPI for T-code CS01??
‎2009 Mar 17 11:40 AM
‎2009 Mar 17 11:45 AM
Hi,
I think there are no bapi's for uploading to transaction CS01, but there are some rfc's like 'RFC_CREATE_BILL_OF_MATERIAL', 'CAD_CREATE_BOM_WITH_SUB_ITEMS'.
For uploading data in to BOM transaction CS01 it is better to use BDC programs. There are some BDC function modules also for this :
CS_BI_BOM_CREATE_BATCH_INPUT
CS_BI_BOM_CREATE_BATCH_INPUT1
Regards,
Sankar
‎2009 Mar 17 11:55 AM
Hi Dude,
Use the BAPI CSAP_MAT_BOM_CREATE
for more info you can goo through the Link:[http://help.sap.com/saphelp_40b/helpdata/en/92/58b514417011d189ec0000e81ddfac/content.htm]
Sample code
i_item = icounter * 10.
WRITE i_item TO c_item.
c_item = c_item(4).
OVERLAY c_item WITH '0000' .
t_stpo-item_categ = zagile_bom-item_categ.
t_stpo-item_no = c_item.
t_stpo-component = zagile_bom-component.
t_stpo-valid_from = zagile_bom-eff_date.
t_stpo-comp_qty = zagile_bom-comp_qty.
t_stpo-comp_unit = zagile_bom-comp_uom.
* t_stpo-sortstring = zagile_bom-plm_eco.
t_stpo-item_text1 = zagile_bom-item_text1.
t_stpo-item_text2 = zagile_bom-item_text2.
t_stpo-document = zagile_bom-plm_eco.
t_stpo-change_no = aennr.
* t_stpo-DOC_TYPE = 'AGI'.
IF t_stpo-item_categ = 'N'.
t_stpo-rel_cost = space.
t_stpo-bulk_mat = 'X'.
ELSE.
t_stpo-rel_cost = 'X'.
t_stpo-bulk_mat = space.
ENDIF.
APPEND t_stpo.
CALL FUNCTION 'CSAP_MAT_BOM_CREATE'
EXPORTING
material = material
plant = plant
bom_usage = bom_usage
valid_from = valid_from
i_stko = i_stko
change_no = aennr
IMPORTING
bom_no = bom_no
TABLES
t_stpo = t_stpo
t_ltx_line = t_ltx_line
EXCEPTIONS
error = 1
OTHERS = 2.
‎2009 Mar 18 9:14 AM