‎2010 Oct 14 1:57 PM
Hi,
I am trying to over-write the component of a material BOM with another component in the same position. I am using FM CSAP_MAT_BOM_MAINTAIN for this. I am passing values to the the below parameters.
MATERIAL H.1013.2476
PLANT 3000
BOM_USAGE 1
ALTERNATIVE 1
VALID_FROM 01.01.2003
FL_COMMIT_AND_WAIT X
FL_DEFAULT_VALUES X
Values that I am passing in T_STPO
ITEM_CATEG L
ITEM_NO 0010
COMPONENT H.1013.4572
COMP_QTY 5.0
COMP_UNIT EA
Here initially the BOM component is H.1013.4570 and I am trying to change it to H.1013.4572. This should be like replacing H.1013.4570 with H.1013.4572 in the same position. This can be done by CS02. However when I am using the above FM and then checking CS03 i see 2 BOM components H.1013.4572 and H.1013.4572. So basically this is not a replacement.
I also tried FMs for the same activity but didn't get the desired result.
a. CSAP_MAT_BOM_OPEN
b. CSAP_BOM_ITEM_MAINTAIN
c. CSAP_MAT_BOM_CLOSE
Could anyone tell me how it can be done.
Regards,
Rakesh
‎2010 Nov 24 1:19 PM
I was looking into a possible solution for changing the BOM component. I tried to get the result with some other BAPIs however I found none to achieve the desired results.
However I found a possible solution with the original BAPI CSAP_MAT_BOM_MAINTAIN. After passing some possible combination of values I came to the conclusion that in table structure T_STPO type STPO_API03 we can use 2 fields u201CITEM_NODEu201D and u201CITEM_COUNTu201D to get the results (I see that these 2 fields have values in SAP Table STPO in fields u201CSTLKNu201D and u201CSTPOZu201D).
If we are passing the values to the below fields of the structure T_STPO, then the desired results can be achieved.
T_STPO (Mandatory Fields to get the result)
ITEM_CATEG L
ITEM_NO 0010
COMPONENT H.1013.4572 (New BOM component that would be replacing the old one)
COMP_QTY 4.0
COMP_UNIT EA
ITEM_NODE 00000016
ITEM_COUNT 00000032
Here, the only part that I am not sure of is whether ITEM_NODE and ITEM_COUNT can be passed from the 3rd party system. I believe that these are automatically generated numbers when a BOM component is created.
‎2010 Oct 14 3:19 PM
Hallo,
Try with below steps...
- Take the header and item records in internal tables.
- Delete the BOM with FM CSAP_MAT_BOM_DELETE.
- Now add your new line item and delete the old item and then create the bom again by CSAP_MAT_BOM_CREATE.
Thanks.
Rajesh
‎2010 Nov 24 7:30 AM
Hi,
I have the similar requirement, but i dont want to delete the BOM header only BOM components should be deleted.
my BOM header material is assigned to the additional material in tcode CS40. Becasue of this reason i couldn't delete the BOM header. Please advice how can i delete only BOM components.
Thanks and Regards
Syed Samdani
‎2010 Nov 24 1:19 PM
I was looking into a possible solution for changing the BOM component. I tried to get the result with some other BAPIs however I found none to achieve the desired results.
However I found a possible solution with the original BAPI CSAP_MAT_BOM_MAINTAIN. After passing some possible combination of values I came to the conclusion that in table structure T_STPO type STPO_API03 we can use 2 fields u201CITEM_NODEu201D and u201CITEM_COUNTu201D to get the results (I see that these 2 fields have values in SAP Table STPO in fields u201CSTLKNu201D and u201CSTPOZu201D).
If we are passing the values to the below fields of the structure T_STPO, then the desired results can be achieved.
T_STPO (Mandatory Fields to get the result)
ITEM_CATEG L
ITEM_NO 0010
COMPONENT H.1013.4572 (New BOM component that would be replacing the old one)
COMP_QTY 4.0
COMP_UNIT EA
ITEM_NODE 00000016
ITEM_COUNT 00000032
Here, the only part that I am not sure of is whether ITEM_NODE and ITEM_COUNT can be passed from the 3rd party system. I believe that these are automatically generated numbers when a BOM component is created.
‎2010 Nov 24 1:47 PM
‎2010 Nov 24 2:06 PM
Hi,
Try this function module i was successful in create BOM's using this,
DATA: BOM_HEADER TYPE CAD_BICSK ,"STRUCTURE FOR HEADER DATA
IT_BOM_ITEM TYPE TABLE OF CAD_BOM_ITEM,"INTERNAL TABLE FOR ITEM
WA_BOM_ITEM TYPE CAD_BOM_ITEM,"WORK AREA FOR ITEM
IT_BOM_SUB_ITEM TYPE TABLE OF CSSUBITEM ,"INTERNAL TABLE FOR SUB ITEM
WA_BOM_SUB_ITEM TYPE CSSUBITEM ,"WORK AREA FOR SUB ITEM
IT_DMS TYPE TABLE OF CLS_CHARAC,"INTERNAL TABLE FOR DMS_CLASS_DATA
WA_DMS TYPE CLS_CHARAC,"WORK AREA FOR DMS_CLASS_DATA
IT_SAP_FIELD TYPE TABLE OF RFCDMSDATA,"INTERNAL TABLE FOR SAP_FIELD_DATA
WA_SAP_FIELD TYPE RFCDMSDATA,"WORK AREA FOR SAP_FIELD_DATA
E_RETURN TYPE CAD_RETURN-VALUE,"STRUCTURE FOR RETURN
E_MESSAGE TYPE MESSAGE-MSGTX,"STRUCTURE FOR MESSAGE
E_MESSAGE_LEN TYPE CAD_RETURN-MESSAGE_LEN."STRUCTURE FOR MESSAGE LENGTH
CALL FUNCTION 'CAD_CREATE_BOM_WITH_SUB_ITEMS'
EXPORTING
I_BOM_HEADER = BOM_HEADER
IMPORTING
E_RETURN = E_RETURN
E_MESSAGE = E_MESSAGE
TABLES
BOM_ITEM = IT_BOM_ITEM
BOM_SUB_ITEM = IT_BOM_SUB_ITEM
DMS_CLASS_DATA = IT_DMS
SAP_FIELD_DATA = IT_SAP_FIELD.
WA_RET-MATNR = WA_DATA1-MATNR.
if e_return = 0 .
wa_ret-status = 'SUCCESS'.
ELSE.
wa_ret-status = 'ERROR'.
ENDIF.
Kindly check it.
Thanks & Regards,
Manesh.R