Posted: Fri May 15, 2009 10:27 am Post subject: BAPI_MATERIAL_BOM_GROUP_CREATE
BAPI_MATERIAL_BOM_GROUP_CREATE - Creation of a material BOM group
Code:
REPORT zsm_create_simplebom.
* This code will create a material BoM for the material
* MAINMATERIAL with the components COMPON1 and COMPON2.
* Data Declaration
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 = '5'. "YOU COULD CHANGE THE BOM USAGE
"TO YOUR needs
it_bomgroup-ltxt_lang = sy-langu.
it_bomgroup-technical_type = ' '.
it_bomgroup-bom_text = 'Simple BoM - FM'.
APPEND it_bomgroup.
* Details of the materials of the different variants
CLEAR it_matrel.
it_matrel-bom_group_identification = 'BAPI_SMP_COL1'.
it_matrel-material = 'MAINMATERIAL'.
it_matrel-bom_usage = '5'.
it_matrel-alternative_bom = '01'.
APPEND it_matrel.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.