2011 Aug 22 1:25 PM
Hi to all,
i am creating BOM using FM BAPI_MATERIAL_BOM_GROUP_CREATE , i have passed all necessary parameters, but
waring and abort message are coming with creating bom for BAPI_MATERIAL_BOM_GROUP_CREATE .
W BAPI1080 028
Error/warning when checking the structure of the BOM group with ID=BOMGROUP1
A BAPI1080 018
Item ID=BOM1 is not assigned to a variant/alternative
A BAPI 001
No instance of object type BOMGroup has been created. External reference:
please can any one tell me what will be the soultion for that.
Regards
Pavneet Rana
Edited by: pavneet rana on Aug 23, 2011 6:27 AM
Hi to all,
i am creating BOM using FM BAPI_MATERIAL_BOM_GROUP_CREATE , i have passed all necessary parameters, but
waring and abort message are coming with creating bom for BAPI_MATERIAL_BOM_GROUP_CREATE .
W BAPI1080 028
Error/warning when checking the structure of the BOM group with ID=BOMGROUP1
A BAPI1080 018
Item ID=BOM1 is not assigned to a variant/alternative
A BAPI 001
No instance of object type BOMGroup has been created. External reference:
please can any one tell me what will be the soultion for that.
Regards
Pavneet Rana
Edited by: pavneet rana on Aug 23, 2011 6:27 AM
2011 Aug 23 6:05 AM
Hi Pavneet,
The BAPI is specifically giving you the Abort Message. Contact your Functional (MM Consultant) about the abort error. If this error is resolved the other warnings will be automatically handled.
Regards,
Pranav.
2011 Aug 23 6:31 AM
thanks for reply,
the example code : wich is giving warning and abort message.
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 = 'INTERNAL'.
it_bomgroup-bom_usage = '1'. " YOU COULD CHANGE THE BOM USAGE TO YOUR NEEDS
it_bomgroup-ltxt_lang = sy-langu.
it_bomgroup-technical_type = 'M'.
it_bomgroup-created_in_plant = '2000'.
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 = 'INTERNAL'.
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.
*INTERNAL
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 = 'INTERNAL'.
it_items-item_no = '0010'.
it_items-item_cat = 'L'.
it_items-component = '300201001'.
it_items-comp_qty = '10'.
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 = 'COMPON2'.
*it_items-comp_qty = '3'.
*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 = '1020007'.
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 = 'INTERNAL'.
it_itemas-super_object_type = 'BOM'.
it_itemas-super_object_id = 'INTERNAL'.
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.
if i am using CS01 to create BOM for the following material is is creating, but this code is giving warning and abort message.
please can any one tell me what is wrong, any solution.
regards
pavneet rana
2011 Aug 23 7:01 AM
Hi Pavneet,
Check this link:
http://wiki.sdn.sap.com/wiki/display/ABAP/ToCreateaMaterialBOMalongwiththeAlternateNousingBAPI_MATERIAL_BOM_GROUP_CREATE!
Regards,
Pranav.
2011 Aug 23 7:50 AM
Thanks for reply ,
yes i have used that link, and i am using same value , except for matnr and plant.
but warning and abort message are coming, and no BOM is creating in MAST.
W BAPI1080 029
Error when checking the data of the object type=BOM / Id=BOM1 of group Id=BOMGROUP1
A BAPI 001
No instance of object type BOMGroup has been created. External reference:
please can any one provide me the solution for that.
code:
DATA: BOMGROUP TYPE TABLE OF BAPI1080_BGR_C,
wa_BOMGROUP LIKE LINE OF BOMGROUP,
variant TYPE TABLE OF BAPI1080_BOM_C,
wa_variant LIKE LINE OF variant,
ITEM TYPE TABLE OF BAPI1080_ITM_C,
WA_ITEM LIKE LINE OF ITEM,
MATERIALRELATIONS TYPE TABLE OF BAPI1080_MBM_C,
WA_MATERIALRELATIONS LIKE LINE OF MATERIALRELATIONS,
RETURN TYPE BAPIRET2_T.
DATA: wa_return LIKE LINE OF RETURN .
wa_BOMGROUP-BOM_GROUP_IDENTIFICATION = 'BOMGROUP1'.
wa_BOMGROUP-OBJECT_TYPE = 'BGR'.
wa_BOMGROUP-OBJECT_ID = 'BOMGROUP1' .
wa_BOMGROUP-TECHNICAL_TYPE = 'M'.
wa_BOMGROUP-BOM_USAGE = '1'.
wa_BOMGROUP-BOM_GROUP = 'BOMGROUP1' .
wa_BOMGROUP-CREATED_IN_PLANT = '2000'.
wa_BOMGROUP-LTXT_LANG = sy-langu .
wa_BOMGROUP-BOM_TEXT = 'Created Using BAPI_MATERIAL_BOM_GROUP_CREATE'.
APPEND wa_BOMGROUP to BOMGROUP.
VARIANTS
wa_variant-BOM_GROUP_IDENTIFICATION = 'BOMGROUP1'.
wa_variant-OBJECT_TYPE = 'BOM'. "= 'BGR'. "
wa_variant-OBJECT_ID = 'BOM1' .
wa_variant-ALTERNATIVE_BOM = '2'.
wa_variant-BOM_STATUS = '1'.
wa_variant-BASE_QTY = '100'.
wa_variant-BASE_UNIT = wa_bom_header-BASE_UOM.
wa_variant-LTXT_LANG = sy-langu .
WA_VARIANT-LANGU_ISO = SY-LANGU.
wa_variant-ALT_TEXT = 'BAPI_MATERIAL_BOM_GROUP_CREATE'.
wa_variant-VALID_FROM_DATE = wa_bom_header-VALID_FROM.
wa_variant-CHANGE_NO = 'ECN1'.
wa_variant-FUNCTION = 'NEW'.
APPEND wa_variant TO VARIANT.
ITEM
WA_ITEM-BOM_GROUP_IDENTIFICATION = 'BOMGROUP1'.
WA_ITEM-OBJECT_TYPE = 'ITM'.
WA_ITEM-OBJECT_ID = 'BOM1' .
*WA_ITEM-ITEM_ID = 'BOM1'.
WA_ITEM-ITEM_NO = '0010'.
WA_ITEM-ITEM_CAT = 'L'.
WA_ITEM-COMPONENT = '300201001'.
WA_ITEM-COMP_QTY = '100'.
*WA_ITEM-COMP_UNIT = 'KGK'.
WA_ITEM-VALID_FROM_DATE = SY-DATUM.
APPEND WA_ITEM TO ITEM.
MATERIAL
WA_MATERIALRELATIONS-BOM_GROUP_IDENTIFICATION = 'BOMGROUP1'.
WA_MATERIALRELATIONS-MATERIAL = '1020007'. "lv_matnr. "
WA_MATERIALRELATIONS-PLANT = '2000'.
WA_MATERIALRELATIONS-BOM_USAGE = '1'.
WA_MATERIALRELATIONS-ALTERNATIVE_BOM = '2'.
APPEND WA_MATERIALRELATIONS TO MATERIALRELATIONS.
data: ITEMASSIGNMENTS TYPE TABLE OF BAPI1080_REL_ITM_BOM_C,
wa_ITEMASSIGNMENTS like LINE OF ITEMASSIGNMENTS .
wa_ITEMASSIGNMENTS-BOM_GROUP_IDENTIFICATION = 'BOMGROUP1'.
wa_ITEMASSIGNMENTS-SUB_OBJECT_TYPE = 'ITM'.
wa_ITEMASSIGNMENTS-SUB_OBJECT_ID = 'BOM1'.
wa_ITEMASSIGNMENTS-SUPER_OBJECT_TYPE = 'BOM'.
wa_ITEMASSIGNMENTS-SUPER_OBJECT_ID = 'BOM1'.
*wa_ITEMASSIGNMENTS-VALID_FROM_DATE
*wa_ITEMASSIGNMENTS-CHANGE_NO
wa_ITEMASSIGNMENTS-FUNCTION = 'NEW'.
APPEND wa_ITEMASSIGNMENTS to ITEMASSIGNMENTS.
CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
EXPORTING
TESTRUN = ' '
ALL_ERROR = 'X'
TABLES
bomgroup = BOMGROUP
variants = VARIANT
ITEMS = ITEM
SUBITEMS =
materialrelations = MATERIALRELATIONS
ITEMASSIGNMENTS = ITEMASSIGNMENTS
SUBITEMASSIGNMENTS =
TEXTS =
return = RETURN
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
.
ENDIF.
loop at RETURN INTO wa_return.
write:/ wa_return-type, wa_return-id, wa_return-number,
wa_return-message.
endloop.
regards
pavneet rana
Edited by: pavneet rana on Aug 23, 2011 8:57 AM
2011 Aug 23 10:47 AM
Hi Pavneet,
If you see the error and the code you've written, I see a possible error:
wa_BOMGROUP-BOM_GROUP_IDENTIFICATION = 'BOMGROUP1'.
wa_BOMGROUP-OBJECT_TYPE = 'BGR'.
wa_BOMGROUP-OBJECT_ID = 'BOMGROUP1' .
wa_BOMGROUP-TECHNICAL_TYPE = 'M'.
VARIANTS
The error should be in this variant code as the error says: object type=BOM / Id=BOM1 of group Id=BOMGROUP1
wa_variant-BOM_GROUP_IDENTIFICATION = 'BOMGROUP1'.
wa_variant-OBJECT_TYPE = 'BOM'. "= 'BGR'. "
wa_variant-OBJECT_ID = 'BOM1' .
APPEND wa_variant TO VARIANT.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |