Error in BAPI_MATERIAL_BOM_GROUP_CREATE.
Dear All,
I am trying to create BOM using BAPI : "BAPI_MATERIAL_BOM_GROUP_CREATE" in a Program.
Now the problem is that when I Execute this, after the BAPI, i get Following Error messages in the Return Table of BAPI:
1) Type W - Error when checking the data of the object type=ITM / Id= of group Id=
2) Type E - Bill of material is not valid
3) Type A - No instance of object type BOMGroup has been created. External reference:
Now the other thing is that When i execute the BAPI through SE37 with the same data that is passed through the Program to BAPI, it is successfully creating BOM without any error.
Can some one help on this please??
It is ugent.
Helpful answers will be rewarded.
Regards,
Tejas
Problem Solved...!
Instead of '1' as ALTERNATIVE_BOM in VARIANTS and MATERIALRELATIONS of BAPI, I passed '01'.
that Did it...Cheers.....
-Tejas
Similar Messages
-
BOM Cretion error with BAPI : BAPI_MATERIAL_BOM_GROUP_CREATE
Dear All,
Desc:
Here i am trying to create a BOM with differnet componants :
i am getting the below error while creating the BOM in varient alternative..
W BAPI1080 028
Error/warning when checking the structure of the BOM group with ID=BOMGROUP1
A BAPI1080 010
Variant/alternative 01 can only occur once with the function NEW
A BAPI1080 010
Variant/alternative 01 can only occur once with the function NEW
A BAPI1080 010
Variant/alternative 01 can only occur once with the function NEW
Please find the below code:
Code:
To get SC details
Get Plant details
SELECT * FROM y27d_dc_marc
INTO TABLE l_t_y27d_dc_marc
WHERE instnr = '552'. "instnr
IF sy-subrc = 0.
SORT l_t_y27d_dc_marc BY werks.
ENDIF.
IF l_t_y27d_dc_marc IS NOT INITIAL.
Get all Regions
SELECT * FROM y27d_dc_dt_plant
INTO TABLE l_t_y27d_dc_dt_plant
FOR ALL ENTRIES IN l_t_y27d_dc_marc
WHERE werks = l_t_y27d_dc_marc-werks.
ENDIF.
Read the SC Details
READ TABLE l_t_y27d_dc_dt_plant
INTO l_r_y27d_dc_dt_plant
WITH KEY werks_typ = g_c_sc. "SC
IF sy-subrc = 0.
Populate SC details
g_f_sc_plant = l_r_y27d_dc_dt_plant-werks.
ENDIF.
Material BoM Group Header Data
l_r_bomgroup-bom_group_identification = 'BOMGROUP1'.
l_r_bomgroup-object_type = 'BGR'.
l_r_bomgroup-object_id = 'BOMGROUP1'.
l_r_bomgroup-bom_usage = '1'. " YOU COULD CHANGE THE BOM USAGE TO YOUR needs
Plant assignment for the corresponding group
l_r_bomgroup-created_in_plant = g_f_sc_plant. "'0470'.
l_r_bomgroup-ltxt_lang = sy-langu.
l_r_bomgroup-technical_type = 'M'. " bomgroup-technical_type = wstzu-stlty.
l_r_bomgroup-bom_text = 'Test for BOM YSPR'.
APPEND l_r_bomgroup TO l_t_bomgroup.
CLEAR l_r_bomgroup.
DATA : l_f_var_alter TYPE stalt,
l_f_var_alter_cnt TYPE stalt.
Get BOM Item details
SELECT * FROM y27d_dc_bom
INTO TABLE l_t_bom_item
WHERE instnr = '552'.
IF sy-subrc = 0.
DESCRIBE TABLE l_t_bom_item LINES l_f_var_alter.
Populate item data
LOOP AT l_t_bom_item INTO l_r_bom_item.
Varient alternative for all the corresponding componants
l_f_var_alter = sy-tabix.
Details of the items of the variants
l_r_itemdata-bom_group_identification = 'BOMGROUP1'.
l_r_itemdata-object_type = 'ITM'.
l_r_itemdata-object_id = l_r_bom_item-bcomponant. "'MDTRAW2011'
l_r_itemdata-item_no = l_r_bom_item-bitemno."'0010'.
l_r_itemdata-item_cat = l_r_bom_item-bitemcat. "'L'.
l_r_itemdata-component = l_r_bom_item-bcomponant. "'MDTRAW2011'.
l_r_itemdata-comp_qty = l_r_bom_item-bquan."'2'.
l_r_itemdata-valid_from_date = sy-datum.
APPEND l_r_itemdata TO l_t_itemdata.
CLEAR l_r_itemdata.
Item componant assignment to a variant/alternative
l_r_variants-bom_group_identification = 'BOMGROUP1'.
l_r_variants-object_type = 'BOM'.
l_r_variants-object_id = l_r_bom_item-bcomponant. "'MDTRAW2011'. "'BOM1'.
l_r_variants-alternative_bom = '01'.
l_r_variants-bom_status = '01'.
l_r_variants-base_qty = '100'.
l_r_variants-valid_from_date = sy-datum.
l_r_variants-function = 'NEW'.
APPEND l_r_variants TO l_t_variants.
CLEAR l_r_variants.
Item componant assignment to linked items
Linking items to the corresponding variants
l_r_itemlink_to_var-bom_group_identification = 'BOMGROUP1'.
l_r_itemlink_to_var-sub_object_type = 'ITM'.
l_r_itemlink_to_var-sub_object_id = l_r_bom_item-bcomponant. "'MDTRAW2011'. "componant linked with varient
l_r_itemlink_to_var-super_object_type = 'BOM'.
l_r_itemlink_to_var-super_object_id = l_r_bom_item-bcomponant. "'MDTRAW2011'. "componant linked with varient
l_r_itemlink_to_var-valid_from_date = sy-datum.
l_r_itemlink_to_var-function = 'NEW'.
APPEND l_r_itemlink_to_var TO l_t_itemlink_to_var.
CLEAR l_r_itemlink_to_var.
ENDLOOP.
ENDIF.
Get the Header details
SELECT SINGLE * FROM y27d_dc_mara
INTO l_r_bom_head_mara
WHERE instnr = '552'. "instnr
IF sy-subrc = 0.
Populate header data
l_r_bom_head-bom_group_identification = 'BOMGROUP1'.
l_r_bom_head-material = l_r_bom_head_mara-matnr. "'MDT01022011'.
l_r_bom_head-plant = g_f_sc_plant. "'0470'.
l_r_bom_head-bom_usage = '1'. "'5'.
l_r_bom_head-alternative_bom = '01'.
APPEND l_r_bom_head TO l_t_bom_head.
CLEAR l_r_bom_head.
ENDIF.
Create BOM
CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
EXPORTING
all_error = 'X'
TABLES
bomgroup = l_t_bomgroup "BOM group
variants = l_t_variants "Varients
items = l_t_itemdata "Item details
materialrelations = l_t_bom_head "Header details
itemassignments = l_t_itemlink_to_var "Item lineked to Varient
return = l_t_return.
LOOP AT l_t_return INTO l_r_return WHERE type CA 'AEX'.
l_f_error = 'X'.
ENDLOOP.
IF l_f_error = space.
Processing successful --> Commit work on PDM system
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ELSE.
Error in processing --> Rollback work on PDM system
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF.
LOOP AT l_t_return INTO l_r_return.
WRITE:/ l_r_return-type, l_r_return-id, l_r_return-number,
l_r_return-message.
ENDLOOP.
could you please help me to come out of this problem.Hi,
Did you try creating manually through CS01 with the same data? There could be a customization setting to restrict like this.
Thanks,
Vinod. -
Hi all,
i am creating a BOM with item & sub item .
i am getting the error like BOM is not valid.
i am giving my coding below.plz suggest where i am doing mistake.
it's urgent.
can u plz give some sample coding where sub-item will be there in that BOM.
any idea will be highly appreaciated.
correct answers will be rewarded.
regards
pabitra
report z_bom_create
line-size 132
line-count 65.
no standard page heading.
*-- DATA DECLARATION--
include <icon> .
*---Tables
tables : s076, t100, marc .
*---Types
types : begin of t_upload, " Upload file data
col1(18),
col2(10),
col3(30),
col4(12),
col5(50),
end of t_upload,
begin of t_split,
location like stpu-ebort,
end of t_split.
*data:begin of i_return occurs 10.
*include structure bapiret2.
*data:end of i_return.
data:i_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
types:begin of t_item."occurs 10.
include structure BAPI1080_ITM_C.
types:end of t_item.
types:begin of t_subitem." occurs 10.
include structure BAPI1080_SUI_C.
types:end of t_subitem.
types:begin of t_header." occurs 10.
include structure BAPI1080_MBM_C.
types:end of t_header.
types:begin of t_bomgroup." occurs 10.
include structure BAPI1080_BGR_C.
types:end of t_bomgroup.
types:begin of t_variant." occurs 10.
include structure BAPI1080_BOM_C.
types:end of t_variant.
data:it_itemas LIKE bapi1080_rel_itm_bom_c OCCURS 0 WITH HEADER LINE,
it_subitemas LIKE BAPI1080_REL_SUI_ITM_C OCCURS 0 WITH HEADER LINE.
*--- Tables
data: i_upload type standard table of t_upload, " to hold data
i_upload1 type standard table of t_upload,
i_upload2 type standard table of t_upload,
i_split type standard table of t_split,
i_item type standard table of t_item,
i_subitem type standard table of t_subitem,
i_header type standard table of t_header,
i_bomgroup type standard table of t_bomgroup,
i_variant type standard table of t_variant.
data: wa_upload type t_upload, " to hold file data,
wa_upload1 type t_upload, " to hold plan data,
wa_upload2 type t_upload,
wa_split type t_split,
wa_item type t_item,
wa_subitem type t_subitem,
wa_header type t_header,
wa_bomgroup type t_bomgroup,
wa_variant type t_variant.
data:v_matnr like mara-matnr,
v_start like sy-index,
v_count(3) type c,
v_num(4) type c value '0000'.
*--Constants
data: c_dot type c value '.',
c_x type c value 'X',
c_comma type c value ','.
-------Selection Screen Design -
*Selection screen for input of upload file address
selection-screen skip 2.
selection-screen begin of block blk1 with frame.
parameters : p_file like rlgrap-filename obligatory .
parameters : p_matnr like mara-matnr obligatory,
p_werks like marc-werks obligatory memory id wrk,
p_stlan like afko-stlan obligatory default '1' .
selection-screen end of block blk1.
---AT SELECTION SCREEN -
*at selection-screen on value-request for p_file.
**--For popup to select file.
perform f_give_help.
*at selection-screen on p_matnr.
perform f_check_matnr.
-----START OF SELECTION -
*--Data upload using WS_Upload.
perform f_get_data.
perform f_get_bom_data.
perform f_get_bom_data1.
perform f_call_bapi.
perform f_error_display.
*& Form f_give_help
text
--> p1 text
<-- p2 text
*FORM f_give_help.
*call function 'WS_FILENAME_GET'
exporting
mask = ',.,..'
mode = 'O'
importing
filename = p_file
exceptions
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
others = 5.
if sy-subrc <> 0 and not sy-msgty is initial.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*ENDFORM. " f_give_help
*& Form f_check_matnr
text
--> p1 text
<-- p2 text
*FORM f_check_matnr.
*CALL FUNCTION 'BAPI_MAT_BOM_EXISTENCE_CHECK'
EXPORTING
MATERIAL = p_matnr
PLANT = p_werks
BOMUSAGE = '1'
VALID_FROM_DATE =
VALID_TO_DATE =
TABLES
RETURN = i_return.
*ENDFORM. " f_check_matnr
*& Form f_get_data
text
--> p1 text
<-- p2 text
FORM f_get_data.
call function 'WS_UPLOAD'
exporting
CODEPAGE = ' '
filename = p_file
filetype = 'DAT'
tables
data_tab = i_upload
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
others = 10
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
ENDFORM. " f_get_data
*& Form f_get_bom_data
text
--> p1 text
<-- p2 text
FORM f_get_bom_data.
delete i_upload where col1 is initial.
delete i_upload where col1 cs 'ITEM'.
i_upload2[] = i_upload[].
delete i_upload2 where col1 cs 'FINISHED GOOD'.
read table i_upload into wa_upload with key col1 = 'FINISHED GOOD:'.
if sy-subrc = 0.
v_matnr = wa_upload-col2.
if v_matnr <> p_matnr.
message e001(zl) with p_matnr.
endif.
else.
message e000(zl).
endif.
ENDFORM. " f_get_bom_data
*& Form f_get_bom_data1
text
--> p1 text
<-- p2 text
FORM f_get_bom_data1.
loop at i_upload into wa_upload where col1 CS 'FINISHED GOOD'.
v_start = sy-tabix + 1.
loop at i_upload into wa_upload1 from v_start .
if wa_upload1-col1 cs 'FINISHED GOOD'.
exit.
else.
perform f_split_upload_data.
endif.
endloop.
endloop.
ENDFORM. " f_get_bom_data1
*& Form f_split_upload_data
text
--> p1 text
<-- p2 text
FORM f_split_upload_data.
if not wa_upload1-col5 is initial.
if wa_upload1-col5 cs c_comma.
split wa_upload1-col5 at c_comma into table i_split.
loop at i_split into wa_split.
v_count = v_count + 1.
endloop.
if wa_upload1-col4 <> v_count.
wa_upload1-col4 = v_count.
endif.
clear wa_upload1-col5.
clear wa_split.
clear v_count.
loop at i_split into wa_split.
wa_upload1-col5 = wa_split-location.
append wa_upload1 to i_upload1.
endloop.
else.
append wa_upload1 to i_upload1.
endif.
else.
append wa_upload1 to i_upload1.
endif.
clear wa_upload1.
ENDFORM. " f_split_upload_data
*& Form f_call_bapi
text
--> p1 text
<-- p2 text
FORM f_call_bapi.
clear wa_upload1.
wa_header-material = p_matnr.
*wa_header-plant = p_werks.
wa_header-bom_group_identification = 'BAPI_SMP_COL1'.
wa_header-bom_usage = p_stlan.
wa_header-alternative_bom = '1'.
append wa_header to i_header.
wa_bomgroup-bom_usage = p_stlan.
*wa_bomgroup-created_in_plant = p_werks.
*wa_bomgroup-bom_group = ''.
wa_bomgroup-object_id = 'SIMPLE1'.
wa_bomgroup-bom_group_identification = 'BAPI_SMP_COL1'.
wa_bomgroup-object_type = 'BGR'.
append wa_bomgroup to i_bomgroup.
wa_variant-alternative_bom = '1'.
wa_variant-base_qty = '1.000'.
wa_variant-valid_from_date = sy-datum.
wa_variant-bom_group_identification = 'BAPI_SMP_COL1'.
wa_variant-object_type = 'BOM'.
wa_variant-object_id = 'VAR'.
wa_variant-bom_status = '1'.
wa_variant-valid_from_date = sy-datum.
wa_variant-function = 'NEW'.
append wa_variant to i_variant.
it_itemas-bom_group_identification = 'BAPI_SMP_COL1'.
it_itemas-sub_object_type = 'ITM'.
it_itemas-sub_object_id = 'SIM'.
it_itemas-super_object_type = 'BOM'.
it_itemas-super_object_id = 'VAR'.
it_itemas-valid_from_date = sy-datum.
it_itemas-function = 'NEW'.
append it_itemas.
it_subitemas-bom_group_identification = 'BAPI_SMP_COL1'.
it_subitemas-sub_object_type = 'SUI'.
it_subitemas-sub_object_id = 'SIMP'.
it_subitemas-super_object_type = 'ITM'.
it_subitemas-super_object_id = 'SIM'.
append it_subitemas.
loop at i_upload2 into wa_upload2.
*wa_item-item_id = v_num.
*v_num = v_num + 1.
wa_item-bom_group_identification = 'BAPI_SMP_COL1'.
wa_item-object_type = 'ITM'.
wa_item-object_id = 'SIM'.
wa_item-item_no = wa_upload2-col1.
wa_item-item_cat = wa_upload2-col2.
wa_item-component = wa_upload2-col3.
wa_item-comp_qty = wa_upload2-col4.
wa_item-valid_from_date = sy-datum.
append wa_item to i_item.
endloop.
loop at i_item into wa_item.
loop at i_upload1 into wa_upload1 where col1 = wa_item-item_no.
wa_subitem-bom_group_identification = 'BAPI_SMP_COL1'.
wa_subitem-object_type = 'SUI'.
wa_subitem-object_id = 'SIMP'.
IF not wa_upload1-col5 is initial.
on change of wa_upload1-col5.
v_num = v_num + 1.
wa_subitem-subitem_no = v_num.
wa_subitem-subitem_qty = '1'.
wa_subitem-installation_point = wa_upload1-col5.
append wa_subitem to i_subitem.
clear wa_subitem.
endon.
endif.
clear wa_upload1.
endloop.
clear v_num.
clear wa_upload.
endloop.
CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
EXPORTING
TESTRUN = ' '
ALL_ERROR = ' '
TABLES
BOMGROUP = i_bomgroup
VARIANTS = i_variant
ITEMS = i_item
SUBITEMS = i_subitem
MATERIALRELATIONS = i_header
ITEMASSIGNMENTS = it_itemas
SUBITEMASSIGNMENTS = it_subitemas
TEXTS =
RETURN = i_return.
*if i_return[] is initial.
*CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*write: /'BOM created:', stpo-stlnr.
*else.
*if not i_return[] is initial.
*loop at i_return.
WRITE:/ i_return-type, i_return-id, i_return-number,
i_return-message.
*ENDLOOP.
IF i_return-TYPE = 'E'.
errmsg-type = i_return-type.
errmsg-line = i_return-message.
append errmsg.
ULINE /1(108).
write:/ icon_led_RED as icon, i_return-MESSAGE.
ULINE /1(108).
ENDIF.
IF i_return-TYPE = 'W'.
errmsg-type = i_return-type.
errmsg-line = i_return-message.
append errmsg.
ULINE /1(108).
write:/ icon_led_YELLOW as icon, i_return-MESSAGE.
ULINE /1(108).
ENDIF.
ENDLOOP.
**write: / i_return-id, i_return-number, i_return-message(80).
**endloop.
**write: /'Error'.
**endif.
ENDFORM. " f_call_bapi
*& Form f_error_display
text
--> p1 text
<-- p2 text
FORM f_error_display.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
loop at i_return.
WRITE:/ i_return-type, i_return-id, i_return-number,
i_return-message.
ENDLOOP.
ENDFORM. " f_error_displayAre u sure That BAPI is the right one to use to create BOM , I think this Error is coming from BAPI itself So try to Debug the BAPI from where its throwing the error.
Regards
prabhu -
Error while creating BOM using BAPI (urgent)
Hi all,
Thanks for ur help. i am getting some error while creting a BOM using that BAPI
BAPI_MATERIAL_BOM_GROUP_CREATE.
errors are
1) Error/warning when checking the structure of the BOM group with ID =
2)Alternative does not exist for material assignment to material BAPIBOMFG1
is it mandatory to pass the bom group id to this bapi?
In bomgroup structure , i am not passing anything to BOM_GROUP field.
is it mandatory to pass this data? i am giving my coding below.plz suggest , where i am making mistake. it is urgent.
regards
pabitra
report z_bom_create
line-size 132
line-count 65
no standard page heading.
*-- DATA DECLARATION--
include <icon> .
*---Tables
tables : s076, t100, marc .
*---Types
types : begin of t_upload, " Upload file data
col1(18),
col2(10),
col3(30),
col4(12),
col5(50),
end of t_upload,
begin of t_split,
location like stpu-ebort,
end of t_split.
data:begin of i_return occurs 10.
include structure bapiret2.
data:end of i_return.
types:begin of t_item."occurs 10.
include structure BAPI1080_ITM_C.
types:end of t_item.
types:begin of t_subitem." occurs 10.
include structure BAPI1080_SUI_C.
types:end of t_subitem.
types:begin of t_header." occurs 10.
include structure BAPI1080_MBM_C.
types:end of t_header.
types:begin of t_bomgroup." occurs 10.
include structure BAPI1080_BGR_C.
types:end of t_bomgroup.
types:begin of t_variant." occurs 10.
include structure BAPI1080_BOM_C.
types:end of t_variant.
*--- Tables
data: i_upload type standard table of t_upload, " to hold data
i_upload1 type standard table of t_upload,
i_split type standard table of t_split,
i_item type standard table of t_item,
i_subitem type standard table of t_subitem,
i_header type standard table of t_header,
i_bomgroup type standard table of t_bomgroup,
i_variant type standard table of t_variant.
data: wa_upload type t_upload, " to hold file data,
wa_upload1 type t_upload, " to hold plan data,
wa_split type t_split,
wa_item type t_item,
wa_subitem type t_subitem,
wa_header type t_header,
wa_bomgroup type t_bomgroup,
wa_variant type t_variant.
data:v_matnr like mara-matnr,
v_start like sy-index,
v_count(3) type c.
*--Constants
data: c_dot type c value '.',
c_x type c value 'X',
c_comma type c value ','.
-------Selection Screen Design -
*Selection screen for input of upload file address
selection-screen skip 2.
selection-screen begin of block blk1 with frame.
parameters : p_file like rlgrap-filename obligatory .
parameters : p_matnr like mara-matnr obligatory,
p_werks like marc-werks obligatory memory id wrk,
p_stlan like afko-stlan obligatory default '1' .
selection-screen end of block blk1.
---AT SELECTION SCREEN -
at selection-screen on value-request for p_file.
*--For popup to select file.
perform f_give_help.
at selection-screen on p_matnr.
perform f_check_matnr.
-----START OF SELECTION -
*--Data upload using WS_Upload.
perform f_get_data.
perform f_get_bom_data.
perform f_get_bom_data1.
perform f_call_bapi.
*& Form f_give_help
text
--> p1 text
<-- p2 text
FORM f_give_help.
call function 'WS_FILENAME_GET'
exporting
mask = ',.,..'
mode = 'O'
importing
filename = p_file
exceptions
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
others = 5.
if sy-subrc <> 0 and not sy-msgty is initial.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
ENDFORM. " f_give_help
*& Form f_check_matnr
text
--> p1 text
<-- p2 text
FORM f_check_matnr.
CALL FUNCTION 'BAPI_MAT_BOM_EXISTENCE_CHECK'
EXPORTING
MATERIAL = p_matnr
PLANT = p_werks
BOMUSAGE = '1'
VALID_FROM_DATE =
VALID_TO_DATE =
TABLES
RETURN = i_return.
ENDFORM. " f_check_matnr
*& Form f_get_data
text
--> p1 text
<-- p2 text
FORM f_get_data.
call function 'WS_UPLOAD'
exporting
CODEPAGE = ' '
filename = p_file
filetype = 'DAT'
tables
data_tab = i_upload
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
others = 10
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
ENDFORM. " f_get_data
*& Form f_get_bom_data
text
--> p1 text
<-- p2 text
FORM f_get_bom_data.
delete i_upload where col1 is initial.
delete i_upload where col1 cs 'ITEM'.
read table i_upload into wa_upload with key col1 = 'FINISHED GOOD:'.
if sy-subrc = 0.
v_matnr = wa_upload-col2.
if v_matnr <> p_matnr.
message e001(zl) with p_matnr.
endif.
else.
message e000(zl).
endif.
ENDFORM. " f_get_bom_data
*& Form f_get_bom_data1
text
--> p1 text
<-- p2 text
FORM f_get_bom_data1.
loop at i_upload into wa_upload where col1 CS 'FINISHED GOOD'.
v_start = sy-tabix + 1.
loop at i_upload into wa_upload1 from v_start .
if wa_upload1-col1 cs 'FINISHED GOOD'.
exit.
else.
perform f_split_upload_data.
endif.
endloop.
endloop.
ENDFORM. " f_get_bom_data1
*& Form f_split_upload_data
text
--> p1 text
<-- p2 text
FORM f_split_upload_data.
if not wa_upload1-col5 is initial.
if wa_upload1-col5 cs c_comma.
split wa_upload1-col5 at c_comma into table i_split.
loop at i_split into wa_split.
v_count = v_count + 1.
endloop.
if wa_upload1-col4 <> v_count.
wa_upload1-col4 = v_count.
endif.
clear wa_upload1-col5.
clear wa_split.
loop at i_split into wa_split.
wa_upload1-col5 = wa_split-location.
append wa_upload1 to i_upload1.
endloop.
else.
append wa_upload1 to i_upload1.
endif.
else.
append wa_upload1 to i_upload1.
endif.
ENDFORM. " f_split_upload_data
*& Form f_call_bapi
text
--> p1 text
<-- p2 text
FORM f_call_bapi.
clear wa_upload1.
wa_header-material = p_matnr.
wa_header-plant = p_werks.
wa_header-bom_usage = p_stlan.
append wa_header to i_header.
wa_bomgroup-bom_usage = p_stlan.
wa_bomgroup-created_in_plant = p_werks.
append wa_bomgroup to i_bomgroup.
wa_variant-alternative_bom = 1.
wa_variant-base_qty = 1.
wa_variant-valid_from_date = sy-datum.
append wa_variant to i_variant.
loop at i_upload1 into wa_upload1.
wa_item-item_no = wa_upload1-col1.
wa_item-item_cat = wa_upload1-col2.
wa_item-component = wa_upload1-col3.
wa_item-comp_qty = wa_upload1-col4.
append wa_item to i_item.
wa_subitem-subitem_qty = '1'.
wa_subitem-installation_point = wa_upload1-col5.
append wa_subitem to i_subitem.
endloop.
CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
EXPORTING
TESTRUN = ' '
ALL_ERROR = ' '
TABLES
BOMGROUP = i_bomgroup
VARIANTS = i_variant
ITEMS = i_item
SUBITEMS = i_subitem
MATERIALRELATIONS = i_header
ITEMASSIGNMENTS =
SUBITEMASSIGNMENTS =
TEXTS =
RETURN = i_return.
if i_return[] is initial.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*write: /'BOM created:', stpo-stlnr.
else.
*if not i_return[] is initial.
loop at i_return.
IF i_return-TYPE = 'E'.
errmsg-type = i_return-type.
errmsg-line = i_return-message.
append errmsg.
ULINE /1(108).
write:/ icon_led_RED as icon, i_return-MESSAGE.
ULINE /1(108).
ENDIF.
IF i_return-TYPE = 'W'.
errmsg-type = i_return-type.
errmsg-line = i_return-message.
append errmsg.
ULINE /1(108).
write:/ icon_led_YELLOW as icon, i_return-MESSAGE.
ULINE /1(108).
ENDIF.
ENDLOOP.
*write: / i_return-id, i_return-number, i_return-message(80).
*endloop.
*write: /'Error'.
endif.
ENDFORM. " f_call_bapiHi shashi,
Thanks for ur help.i tried after passing the group but it is giving same error.
i am getting the error
"Error/warning when checking the structure of the BOM group with ID= test"
i am gettig the above error when i put bomgroup-bom_group_identification = 'TEST'.
whatever i am putting in this field, the same error is comming having different value.
if i put--- bomgroup-bom_group_identification = ' '. then i will get error
"Error/warning when checking the structure of the BOM group with ID=
if i omit that field, then also , i am getting same error.
plz suggest what r the fields i need to pass for BOMGROUP structure for that bapi?
regards
pabitra -
Error: item id=simple1 doesnt exist in assignment to variants id=simple1
Hi Experts,
I am getting error while i am creating Bill of Material (BOM) for negative values.
when ever i am creating negative bom by using bapi i am getting this error
select mandt reinr matnr werks stlal bmsch phflg ztext stktx postp idnrk menge sortf imein lgort posnr potx2 fmeng alprf ewahr alpgr rekri from zbomtemp into table it_final1 where reinr = p_reinr.
loop at it_final1 into wa_final1.
if wa_final1-menge < 0.
CLEAR it_bomgroup1.
it_bomgroup1-bom_group_identification = 'BAPI_SMP_COL1'.
it_bomgroup1-object_type = 'BGR'.
it_bomgroup1-object_id = 'SIMPLE1'.
it_bomgroup1-bom_usage = '6'." YOU COULD CHANGE THE BOM USAGE TO YOUR
it_bomgroup1-CREATED_IN_PLANT = '1001'.
it_bomgroup1-ltxt_lang = sy-langu.
it_bomgroup1-technical_type = ' '.
**it_bomgroup1-bom_text = wa_final-ztext. "'Simple BoM - FM'.
APPEND it_bomgroup1.
CLEAR it_variants1.
it_variants1-bom_group_identification = 'BAPI_SMP_COL1'.
it_variants1-object_type = 'BOM'.
it_variants1-object_id = 'SIMPLE1'.
it_variants1-alternative_bom = '06'. " 'wa_final-stlal. .
it_variants1-bom_status = '01'.
it_variants1-base_qty = wa_final1-bmsch ."_final-bmsch. ."'1.000'.
it_variants1-valid_from_date = sy-datum.
it_variants1-function = 'NEW'.
APPEND it_variants1.
CLEAR it_matrel1.
it_matrel1-bom_group_identification = 'BAPI_SMP_COL1'.
it_matrel1-material = wa_final1-idnrk ."'000000000200001342'.
it_matrel1-bom_usage = '1'.
it_matrel1-alternative_bom = wa_final1-stlal."'01'.
it_matrel1-PLANT = '1001'.
APPEND it_matrel1.
**********CLEAR it_subitemas.
**********it_subitemas-bom_group_identification = 'BAPI_SMP_COL1'.
**********it_subitemas-sub_object_type = 'SUI'.
**********it_subitemas-sub_object_id = 'SIM1'.
**********it_subitemas-super_object_type = 'ITM'.
**********it_subitemas-super_object_id = 'SIMPLE1'.
**********APPEND it_subitemas.
CLEAR it_itemas1.
it_itemas1-bom_group_identification = 'BAPI_SMP_COL1'.
it_itemas1-sub_object_type = 'ITM'.
it_itemas1-sub_object_id = 'SIMPLE1'.
it_itemas1-super_object_type = 'BOM'.
it_itemas1-super_object_id = 'SIMPLE1'.
it_itemas1-valid_from_date = sy-datum.
it_itemas1-function = 'NEW'.
APPEND it_itemas1.
***CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
***EXPORTING
***all_error = 'X'
***TABLES
***bomgroup = it_bomgroup
***variants = it_variants
***items = it_items1
***materialrelations = it_matrel1
***itemassignments = it_itemas
*****subitems = it_subitems
*****subitemassignments = it_subitemas
***return = return.
***if sy-subrc = 0.
***CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
EXPORTING
WAIT = 'X'.
IMPORTING
RETURN =.
LOOP AT return.
*****WRITE:/ return-type, return-id, return-number,
*****return-message.
*****ENDLOOP.
CALL FUNCTION 'ZBAPI_BOMCREATIONNEGATIVE'
EXPORTING ** here this fm is nothing but standrd bapi + standard bapi commit ..
P_REINR =
TABLES
BOM1 = it_bomgroup1
VAR1 = it_variants1
ITE1 = it_items1
MATR1 = it_matrel1
ITEA1 = it_itemas1
RET = return
**clear it_bomgroup.
clear it_matrel1.
**clear it_itemas.
**clear it_variants.
clear it_items1.
**LOOP AT return.
**WRITE:/ return-type, return-id, return-number,
**return-message.
**ENDLOOP.
**else.
**CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
IMPORTING
RETURN =
ELSE.
it_items1-bom_group_identification = 'BAPI_SMP_COL1'.
it_items1-object_type = 'ITM'.
it_items1-object_id = 'SIMPLE1'.
it_items1-item_no = wa_final1-posnr."'0010'.
it_items1-item_cat = wa_final1-postp.."'L'.
it_items1-component = wa_final1-idnrk."'000000000200001343'.
it_items1-comp_qty = wa_final1-menge.."'2'.
it_items1-valid_from_date = sy-datum.
APPEND it_items1.
endif.
endloop.
**CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
LOOP AT return.
WRITE:/ return-type, return-id, return-number,
return-message.
ENDLOOP.
ENDFUNCTION.
here i am using this and i am getting that error and any one reply to his
sry for u r distrubance
regards,
pradeep
Edited by: pradeep_546 on May 4, 2011 3:06 PM
Edited by: pradeep_546 on May 5, 2011 10:32 AM
Edited by: pradeep_546 on May 6, 2011 11:05 AMhi Kim,
Sorry for the mis-intepretation.
I was about to say that i facing the problem for another Apshell say 'Apshell2'
I was not able to find out the OLAP database for this Apshell2. But for Apshell the OLAP db does exist in Analysis server.
Any suggestions so that i can get the other apshell2 in the analysis server.
we have done a migration based on this given link.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/20a26f50-4252-2a10-8c97-a2c7058cd804
Regards,
chandru. -
Error in Creating a BOM / CSAP_MAT_BOM_MAINTAIN
hi,
i need to create multiple bom alternatives in my development. i try using CSAP_MAT_BOM_MAINTAIN for this purpose.
even after i give all the inputs and flags necessary for creating a new bom, i am getting an error stating that bom already exist for....when i go and check MAST table, for the same material, plant and bom usage... no such alternative exist.
i am unable to proceed further. can anyone help me in this regard? thanks in advance.friend... you are right.
CSAP_MAT_BOM_MAINTAIN is used to create only one alternative bom. but this can be any number from 01 to 99. if any alternative bom exist for the same combination of material, plant and bom usage... then you cannot create any more alternative bom for the above mentioned combination. this is because... this function module checks MAST table before proceeding with creation. while checking MAST, it considers only material, plant and bom usage. alternative bom is left out here. but the real fact is... alternative bom should be also considered for uniqueness of bom while checking MAST. all these issues are only during bom creation, but the same function module works perfect during bom maintenance.
CSAP_MAT_BOM_CREATE is also used to create only one alternative bom. but this can be only one number - 01 (default). but, you cannot maintain a bom using this function module. you need to use CSAP_MAT_BOM_MAINTAIN for bom maintenance.
to create any number of alternative bom for a material, plant and bom usage combination... you need to use the function module BAPI_MATERIAL_BOM_GROUP_CREATE. but... you cannot maintain any bom or create object dependencies for line items using this function module.
summary:
to create a bom.. use BAPI_MATERIAL_BOM_GROUP_CREATE
to read a bom.. use CSAP_MAT_BOM_READ
to maintain a bom.. use CSAP_MAT_BOM_MAINTAIN.
to create object dependency.. use CSAP_MAT_BOM_OPEN , CSAP_BOM_ITEM_MAINTAIN , CSAP_MAT_BOM_CLOSE. -
BAPI_MATERIAL_BOM_GROUP_CREATE
Hi
any step by step procedure of passing data to this function module BAPI_MATERIAL_BOM_GROUP_CREATE ???
I am geting errors:
Item ID= is not assigned to a variant/alternative
Cheers
ShakirHello,
Check this sample code:
EPORT ZTEST_CHIN message-id 01.
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,
it_subitems LIKE bapi1080_sui_c OCCURS 0 WITH HEADER LINE,
it_subitemas LIKE BAPI1080_REL_SUI_ITM_C 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
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 materials of the different variants
CLEAR it_matrel.
it_matrel-bom_group_identification = 'BAPI_SMP_COL1'.
it_matrel-material = 'BAPIBOMFG1'.
it_matrel-bom_usage = '1'.
it_matrel-alternative_bom = '01'.
APPEND it_matrel.
Linking subitems to the corresponding variants
CLEAR it_subitemas.
it_subitemas-bom_group_identification = 'BAPI_SMP_COL1'.
it_subitemas-sub_object_type = 'SUI'.
it_subitemas-sub_object_id = 'SIM1'.
it_subitemas-super_object_type = 'ITM'.
it_subitemas-super_object_id = 'SIMPLE1'.
APPEND it_subitemas.
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.
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 = 'BAPIBOMRW1'.
it_items-comp_qty = '2'.
it_items-valid_from_date = sy-datum.
APPEND it_items.
CLEAR it_subitems.
it_subitems-bom_group_identification = 'BAPI_SMP_COL1'.
it_subitems-object_type = 'SUI'.
it_subitems-object_id = 'SIM1'.
it_subitems-subitem_no = '0001'.
it_subitems-INSTALLATION_POINT = 'ab1'.
it_subitems-subitem_qty = '1'.
APPEND it_subitems.
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
subitems = it_subitems
subitemassignments = it_subitemas
return = it_return.
CLEAR it_subitems.
it_subitems-bom_group_identification = 'BAPI_SMP_COL1'.
it_subitems-object_type = 'SUI'.
it_subitems-object_id = 'SIM1'.
it_subitems-subitem_no = '0002'.
it_subitems-INSTALLATION_POINT = 'ab2'.
it_subitems-subitem_qty = '1'.
APPEND it_subitems.
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
subitems = it_subitems
subitemassignments = it_subitemas
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.
Cheers,
Vasanth -
Regarding BAPI_MATERIAL_BOM_GROUP_CREATE
Dear All,
Bom is created with given BAPI_MATERIAL_BOM_GROUP_CREATE. But the issue is while creating multiple subitems for each item. it is creating only one subitem for each item.
Please let me know regarding this.
Regards
AnilHello,
To create a BOM u can use "CSAP_MAT_BOM_CREATE" this FM.
CALL FUNCTION 'CSAP_MAT_BOM_CREATE'
EXPORTING
MATERIAL = MATERIAL
PLANT = N_PLANT
BOM_USAGE = '1'
VALID_FROM =
CHANGE_NO =
REVISION_LEVEL =
I_STKO = I_STKO
FL_NO_CHANGE_DOC = ' '
FL_COMMIT_AND_WAIT = ' '
FL_CAD = ' '
FL_DEFAULT_VALUES = 'X'
IMPORTING
FL_WARNING =
BOM_NO =
TABLES
T_STPO = T_STPO
T_DEP_DATA =
T_DEP_DESCR =
T_DEP_ORDER =
T_DEP_SOURCE =
T_DEP_DOC =
T_LTX_LINE =
T_STPU =
EXCEPTIONS
ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE I001 WITH 'BOM not Created for' MATERIAL.
elseif SY-SUBRC = 0.
MESSAGE I001 WITH 'BOM Created for' MATERIAL.
ENDIF.
Thanks & Regards,
Sayali Paradkar -
Hi there guys...
I'm creating BOM by using BAPI_MATERIAL_BOM_GROUP_CREATE.
I'm encoutering error such as:
Error in checking the data of the object type=BOM / Id=SIMPLE1 of group Id=BAPI_SMP_COL1.
Generation not Supported for change object
Generation not Supported for change object
No Instance of object type BOMGroup has been created. External Reference...
Can Anyone give me an idea on what is the error all about..
Thanks and God Bless.Hi,
Please have a look at the following thread:
Re: bapi for BOM
I noticed that you have posted the same question in this thread too. Didnt this FM help you?
Sudha
Message was edited by: Sudha Mohan -
About RFC creating EBOM using BAPI_MATERIAL_BOM_GROUP_CREATE
use BAPI_MATERIAL_BOM_GROUP_CREATE to create ebom in RFC function,when call this rfc from visual C++,rfc returned error message "Enter change number-BOM has history requirement".
But test this rfc in se37,not have any error.
how to solve this problem?
pls,help me.Hi,
An authorization object exists (C_STUE_NOH - authorization to edit bills of
material without change number). This authorization object has only one
field.
When you maintain a bill of material with history requirement, the system
checks whether the user has an authorization for which 'X' is entered in
this field of object C_STUE_NOH.If this is the case, the system just
displays a warning message saying that the bill of material has a history
requirement.
Otherwise, an error message is displayed.
have fun -
Error in change number creating BOM in Engineering Type.
Can anyone guys help me with my problem.
I'm creating Bom using BAPI_MATERIAL_BOM_GROUP_CREATE.
Every time I create BOM Using one bom only in engineering and all BOM for materials were created.
But every time i create rerun the program and have different change number on its components, the error occur,
"Generation not Supported for Change number"
Can anyone help me with this?
Thanks and God Bless.In case errors rollback.... I beleive the following logic would resolve your issue.
constants:c_error_type(1) type c value 'E'.
call function 'BAPI_MATERIAL_BOM_GROUP_CREATE'
exporting
testrun = l_testmode
tables
bomgroup = l_bomgroup
variants = l_variants
items = l_items
subitems = l_subitems
materialrelations = l_materialrelations
itemassignments = l_itemassignments
subitemassignments = l_subitemassignments
return = l_return.
if l_testmode is initial.
read table l_return with key type = c_error_type.
if sy-subrc = 0.
call function 'BAPI_TRANSACTION_ROLLBACK'.
else.
call function 'BAPI_TRANSACTION_COMMIT'.
endif.
Thanks
Anantha -
Warning and abort message for BAPI_MATERIAL_BOM_GROUP_CREATE
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 AMThanks 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 -
Error in starting Adobe Bridge in Photoshop CS2
I've just installed Photoshop CS2, however upon opening Adobe Bridge this error message appears " The application has failed to start because libagluc28.dll was not found. Reinstalling to application may fix the problem"
I have reinstalled and click repair but to no avail
I followed Adobe Support Knowledgebase solution and run CMD and this appears:
c:Documents and Settings/Jesus M Ferraris>
then i entered the command
cacls c:\windows\installer /T /E /C /G administrators:F
but an error message appears - 'cacls' is not recognized as an internal or external command, operable program or bathc file
I also entered the next command
cacls "c:\documents and setting\all users" /Y /E /C /G administrators:F
still the same error as above appears, Please help, have I miss something or was my procedure correct...
P4, 512ram, WXP 80gHDVery useful.
Good Luck.
My
Si
tes -
Windows Vista: Ipod Error Message, no longer read by PCs
Hello,
I have a 5th generation black ipod video with 30GB of memory.
The other day I hooked it up to my laptop (Toshiba, 4 months old) that it's been functioning on with no problems whatsoever. This weird error message flashed twice about it not being able to sync because of some software problem.
Eversince then, the only thing I can charge my ipod on is the family treadmill in the basement (~_~) as no other computer in the house recognizes it. I can't even charge it through the wall sockets, either.
I have changed the ipod cord, still no luck. I've also reset the device about 3 or 4 times and uninstalled, restarted the laptop then reinstalled itunes. I would like to reset it back to factory settings but that's impossible as computers/laptops don't pick it up. I live very far from a Mac store...
What's a girl to do? I can't live without my Busta Rhymes and Wu-Tang Clan!
Any advice would be greatly appreciated! Thanks!you have to update Vista go to this site and up-date http://windowsupdate.microsoft.com
-
Error while offsetting a variable
Hello Experts
I want to display the data for last 5 years in my query. So I tried using the SAP exit variable Current Calendar Year (0CYEAR) and the offset it by 5. However, I am getting the following error message for the query "System error in program SAPLRR12 and form REP_ASSIGN_INITIAL_OPT-01"
Any Help on this is appreciated and points will be assigned.
ThanksThanks Chetan for your prompt reply. I have assigned points.
But I would appreciate if you help me clear my understanding of offseting a variable.
Say if the Current Calendar Year variable returns 2008, then will offseting that variable by 5 return me the data for years 2008, 2007, 2006, 2005 , 2004. Or, will it just return me the data for 2008 - 5 = 2004 only.
Thanks
Rishi
Maybe you are looking for
-
I'm sure you have all had enough questions from me in the past few days! but you all are so helpful i can't stop my self from attempting to get as much help as i can :D its hard to read through documentation 50 pages long when you all usually have a
-
Hi, There was ios 4.1 in my iphone3gs.i have tried to update it through itunes but there is a problem.After installation through itunes,there is problem that it is not activating my iphone and shows a message that your iphone could not be activat
-
How do I automatically add a background/watermark to a PDF?
Hi! My name is mike and I am working on an invoice draft. The invoice is created within Microsoft Access and will be printed out on the Adobe PDF printer. I'd like to automatically add a background with some graphical details (which is not possible w
-
Flash Web Gallery large photo border erratic behavior
In Lightroom HTML Web Gallery one can define border styles for the displayed photos. I cannot find a similar future in the Flash Gallery however. Is there one??? In any case, the first 6 photos in my Flash Web Gallery appear with a black border aroun
-
Dividing a short value up to two byte values
Hi! I have small problem converting data between two types. I have a short value and want to divide it tto two bytes instead. For example if I have th short value 3096 (1100000110000000, little endian) I want to split that value into two bytes, byteH