Hi Friends,
I want to copy a BOM material to another plant.
I am using FM CS_BOM_EXPL_MAT_V2, then use the
CSAP_MAT_BOM_READ for source plant,
CSAP_MAT_BOM_CREATE to create bom in target plant.
I am getting sy-subrc as 1 in the FM CSAP_MAT_BOM_CREATE. I am not sure why it is as I am passing the parametzers correctly I suppose.
Step 1 Use FM CS_BOM_EXPL_MAT_V2.
step 2: Loop at STB.
step 3: Inside the loop call FM CSAP_MAT_BOM_READ.
Step 4;
call function 'CALO_INIT_API'
exceptions
log_object_not_found = 1
log_sub_object_not_found = 2
other_error = 3
others = 4.
CALL FUNCTION 'CSAP_MAT_BOM_CREATE'
EXPORTING
material = lv_matnr
PLANT = lv_werks
bom_usage = '3'
VALID_FROM = lv_date
i_stko = i_stko1
IMPORTING
FL_WARNING = api_warning
BOM_NO = v_bom_no
TABLES
T_STPO = i_stpoi
EXCEPTIONS
ERROR = 1
OTHERS = 2 .
I get sy-subrc as 1.
Please correct me if I am wrong in my assumption.
Regards,
K.S