Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI FOR UPLOADING BOM - URGENT

former_member574106
Participant
0 Likes
682

Could anybody tell me the BAPI for uploading BOM and WORK

CENTER ? Please, it is extremely urgent.

Regards,

SAURAV LAHIRY

Could anybody tell me the BAPI for uploading BOM and WORK

CENTER ? Please, it is extremely urgent.

Regards,

SAURAV LAHIRY

3 REPLIES 3
Read only

Former Member
0 Likes
622

BAPI_MATERIAL_BOM_GROUP_CREATE to create Material BOM

CSAI_BOM_CREATE

CSAP_MAT_BOM_MAINTAIN

BAPI_MAT_BOM_EXISTENCE_CHECK Check whether BOM for material exists

BAPI_BOM_UPLOAD_SAVE Main Module for BOM Update (Upload from CRM)

you can use this FM /ISDFPS/PM_BOM_GETDETAIL. You need to pass the material and plant concatenated into single field.

This FM will retrrive all the BOM /ISDFPS/PM_BOM_GETLIST and CABM_READ_BOM

Reward points..

Read only

Former Member
0 Likes
622

Hi Saurav,

Try the following Code.


REPORT  ZTEST_BOM_BAPI.
DATA:
   it_bomgroup LIKE bapi1080_bgr_c OCCURS 0 WITH HEADER LINE,
   it_variants LIKE bapi1080_bom_c OCCURS 0 WITH HEADER LINE,
   it_items LIKE bapi1080_itm_c OCCURS 0 WITH HEADER LINE,
   it_matrel LIKE bapi1080_mbm_c OCCURS 0 WITH HEADER LINE,
   it_itemas LIKE bapi1080_rel_itm_bom_c OCCURS 0 WITH HEADER LINE,
   it_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

* Fill the data
* Material BoM Group Header Data
CLEAR it_bomgroup.
it_bomgroup-bom_group_identification = 'BAPI_SMP_COL1'.
it_bomgroup-object_type = 'BGR'.
it_bomgroup-object_id = 'SIMPLE1'.
it_bomgroup-bom_usage = '1'.  " YOU COULD CHANGE THE BOM USAGE TO YOUR
*nEEDS
*it_bomgroup-created_in_plant = '0001'.
it_bomgroup-ltxt_lang = sy-langu.
it_bomgroup-technical_type = ' '.
it_bomgroup-bom_text = 'Simple BoM - FM'.
APPEND it_bomgroup.

* Header Details of the different variants
CLEAR it_variants.
it_variants-bom_group_identification = 'BAPI_SMP_COL1'.
it_variants-object_type = 'BOM'.
it_variants-object_id = 'SIMPLE1'.
it_variants-alternative_bom = '01'.
it_variants-bom_status = '01'.
it_variants-base_qty = '1.000'.
it_variants-valid_from_date = sy-datum.
it_variants-function = 'NEW'.
APPEND it_variants.

* Details of the items of the variants
CLEAR it_items.
it_items-bom_group_identification = 'BAPI_SMP_COL1'.
it_items-object_type = 'ITM'.
it_items-object_id = 'SIMPLE1'.
it_items-item_no = '0010'.
it_items-item_cat = 'L'.
it_items-component = '000000000000000078'.
it_items-comp_qty = '1'.
it_items-valid_from_date = sy-datum.
APPEND it_items.

CLEAR it_items.
it_items-bom_group_identification = 'BAPI_SMP_COL1'.
it_items-object_type = 'ITM'.
it_items-object_id = 'SIMPLE1'.
it_items-item_no = '0020'.
it_items-item_cat = 'L'.
it_items-component = '000000000000000076'.
it_items-comp_qty = '2'.
it_items-valid_from_date = sy-datum.
APPEND it_items.


* Details of the materials of the different variants
CLEAR it_matrel.
it_matrel-bom_group_identification = 'BAPI_SMP_COL1'.
it_matrel-material = '000000000000000077'.
*it_matrel-plant = '0001'.
it_matrel-bom_usage = '1'.
it_matrel-alternative_bom = '01'.
APPEND it_matrel.

* Linking items to the corresponding variants
CLEAR it_itemas.
it_itemas-bom_group_identification = 'BAPI_SMP_COL1'.
it_itemas-sub_object_type = 'ITM'.
it_itemas-sub_object_id = 'SIMPLE1'.
it_itemas-super_object_type = 'BOM'.
it_itemas-super_object_id = 'SIMPLE1'.
it_itemas-valid_from_date = sy-datum.
it_itemas-function = 'NEW'.
APPEND it_itemas.

* Create variants
CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
 EXPORTING
   all_error         = 'X'
 TABLES
   bomgroup          = it_bomgroup
   variants          = it_variants
   items             = it_items
   materialrelations = it_matrel
   itemassignments   = it_itemas
   return            = it_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

LOOP AT it_return.
 WRITE:/ it_return-type, it_return-id, it_return-number,
         it_return-message.
ENDLOOP. 

reward if useful.

Thanks and Regards,

Maddineni Bharath.

Read only

former_member574106
Participant
0 Likes
622

Thanks for the reply