This website is not affiliated with, sponsored by, or approved by SAP AG.

Issue with CSAP_MAT_BOM_CREATE

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Issue with CSAP_MAT_BOM_CREATE

Postby Mordeb » Fri Dec 19, 2008 9:18 am

System 4.6C patch level 44

When creating BOMS with BOM usage 1. The relevant for costing flag is defaulted "X".

When I call CSAP_MAT_BOM_CREATE with the appropriate component t_stpo-rel_cost = space and t_stpo-bulk_mat = 'X' I get an error that you can view in tcode: SLG1. The error is essentially: u cannot set bulk material and rel_cot = 'X' at same time. I understand this restriction, but I passed rel_cost = space and system treated that as no data and changed to = 'X'.

The only solution I can find is to change config for BOM usage "Users do not want to do this" or some sort of mod/exit to not default rel_cost = 'X' when creating the BOM via RFC.

The material master BAPIs avoid this issue by having a corresponding structure with flags to identify field changes so a space is not treated as no entry.

The BOM RFCs do not seem to have any sort of functionality to work around this issue.

Anyone encountered this issue before, and what was your approach to work around it?

Thanks

Partial example code block:
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.
Mordeb
 
Posts: 30
Joined: Wed Feb 25, 2004 1:22 pm

Re: Issue with CSAP_MAT_BOM_CREATE

Postby ttkk1024 » Sat Oct 14, 2017 12:13 am

you need add the code:

if t_stpo-bulk_mat is not initial.
t_stporel_prod = 'X'.
endif.
ttkk1024
 
Posts: 1
Joined: Sat Oct 14, 2017 12:05 am


Return to ABAP

Who is online

Users browsing this forum: Google [Bot] and 10 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.