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

Change Master--CC01

Former Member
0 Likes
1,247

Hi All,

I have a requirement, where in now I have created the Material in Material Master and also created the BOM using the materials created. Now that I want to have the change in the structure of the BOM or in the quantity of materials used in BOM.

For this to happen I need to create a change number which I can do it in CC01, How do I link this change no with the BOM structure or the materials that under changes.

How can I handle this using the BAPI's. Is their a way I can create a change number using a BAPI.

I am using the BAPI_MATERIAL_SAVEDATA to create/change material and BAPI_BOM_UPLOAD_SAVE to create or change BOM. Which field in these BAPI's should be link to the change number which is created above.

Regards,

Nithiyanandam

1 ACCEPTED SOLUTION
Read only

0 Likes
1,032

Hello,

here is the answer, how you can link the change number to the material by using the function 'BAPI_MATERIAL_SAVEDATA' :

Please have a look inside the function 'BAPI_MATERIAL_SAVEDATA' :

The function 'BAPI_MATERIAL_SAVEDATA' passes the structure 'MARA_UEB' while calling the fonction 'MATERIAL_MAINTAIN_DARK'. The structure 'MARA_UEB' contains the field 'AENNR' for the change number.

You can fill this field by using the extension tables of the function 'BAPI_MATERIAL_SAVEDATA':

DATA: lt_bapiparex LIKE bapiparex OCCURS 0 WITH HEADER LINE,

lt_bapiparexx LIKE bapiparexx OCCURS 0 WITH HEADER LINE.

lt_bapiparex-structure = 'BAPI_TE_MARA'.

lt_bapiparex-valuepart1+0(18) = ls_mathead-material.

lt_bapiparex-valuepart1+18(12) = '000000001180'.

APPEND lt_bapiparex.

CLEAR lt_bapiparex.

lt_bapiparexx-structure = 'BAPI_TE_MARAX'.

lt_bapiparexx-valuepart1+0(18) = ls_mathead-material.

lt_bapiparexx-valuepart1+18(1) = 'X'.

APPEND lt_bapiparexx.

CLEAR lt_bapiparexx.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = ls_mathead

clientdata = ls_mara

clientdatax = ls_marax

plantdata = ls_marc

plantdatax = ls_marcx

forecastparameters = ls_mpop

forecastparametersx = ls_mpopx

planningdata = ls_mpgd

planningdatax = ls_mpgdx

storagelocationdata = ls_mard

storagelocationdatax = ls_mardx

valuationdata = ls_mbew

valuationdatax = ls_mbewx

warehousenumberdata = ls_mlgn

warehousenumberdatax = ls_mlgnx

salesdata = ls_mvke

salesdatax = ls_mvkex

storagetypedata = ls_mlgt

storagetypedatax = ls_mlgtx

IMPORTING

return = ls_bapiret2

TABLES

materialdescription = lt_makt

unitsofmeasure = lt_marm

unitsofmeasurex = lt_marmx

internationalartnos = lt_mean

materiallongtext = lt_mltx

taxclassifications = lt_mlan

returnmessages = lt_matreturn2

prtdata = lt_mfhm

prtdatax = lt_mfhmx.

extensionin = lt_bapiparex

extensioninx = lt_bapiparexx.

Best regards,

Holger

Hi All,

I have a requirement, where in now I have created the Material in Material Master and also created the BOM using the materials created. Now that I want to have the change in the structure of the BOM or in the quantity of materials used in BOM.

For this to happen I need to create a change number which I can do it in CC01, How do I link this change no with the BOM structure or the materials that under changes.

How can I handle this using the BAPI's. Is their a way I can create a change number using a BAPI.

I am using the BAPI_MATERIAL_SAVEDATA to create/change material and BAPI_BOM_UPLOAD_SAVE to create or change BOM. Which field in these BAPI's should be link to the change number which is created above.

Regards,

Nithiyanandam

5 REPLIES 5
Read only

Former Member
0 Likes
1,032

Hi Guys,

Please provide some suggestions.

Regards,

Nithiyanandam

Read only

0 Likes
1,032

Hi Guys,

Any clues... Please provide some lights to this.. I have not worked in ABAP.. I am working on XI.. So I dont really understand what will the exact way to handle these change number(ECN).

Regards,

Nithiyanandam

Read only

0 Likes
1,032

ECO number should be entered into IT_STKO-CHANGE_NO.

Read only

0 Likes
1,033

Hello,

here is the answer, how you can link the change number to the material by using the function 'BAPI_MATERIAL_SAVEDATA' :

Please have a look inside the function 'BAPI_MATERIAL_SAVEDATA' :

The function 'BAPI_MATERIAL_SAVEDATA' passes the structure 'MARA_UEB' while calling the fonction 'MATERIAL_MAINTAIN_DARK'. The structure 'MARA_UEB' contains the field 'AENNR' for the change number.

You can fill this field by using the extension tables of the function 'BAPI_MATERIAL_SAVEDATA':

DATA: lt_bapiparex LIKE bapiparex OCCURS 0 WITH HEADER LINE,

lt_bapiparexx LIKE bapiparexx OCCURS 0 WITH HEADER LINE.

lt_bapiparex-structure = 'BAPI_TE_MARA'.

lt_bapiparex-valuepart1+0(18) = ls_mathead-material.

lt_bapiparex-valuepart1+18(12) = '000000001180'.

APPEND lt_bapiparex.

CLEAR lt_bapiparex.

lt_bapiparexx-structure = 'BAPI_TE_MARAX'.

lt_bapiparexx-valuepart1+0(18) = ls_mathead-material.

lt_bapiparexx-valuepart1+18(1) = 'X'.

APPEND lt_bapiparexx.

CLEAR lt_bapiparexx.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = ls_mathead

clientdata = ls_mara

clientdatax = ls_marax

plantdata = ls_marc

plantdatax = ls_marcx

forecastparameters = ls_mpop

forecastparametersx = ls_mpopx

planningdata = ls_mpgd

planningdatax = ls_mpgdx

storagelocationdata = ls_mard

storagelocationdatax = ls_mardx

valuationdata = ls_mbew

valuationdatax = ls_mbewx

warehousenumberdata = ls_mlgn

warehousenumberdatax = ls_mlgnx

salesdata = ls_mvke

salesdatax = ls_mvkex

storagetypedata = ls_mlgt

storagetypedatax = ls_mlgtx

IMPORTING

return = ls_bapiret2

TABLES

materialdescription = lt_makt

unitsofmeasure = lt_marm

unitsofmeasurex = lt_marmx

internationalartnos = lt_mean

materiallongtext = lt_mltx

taxclassifications = lt_mlan

returnmessages = lt_matreturn2

prtdata = lt_mfhm

prtdatax = lt_mfhmx.

extensionin = lt_bapiparex

extensioninx = lt_bapiparexx.

Best regards,

Holger

Read only

0 Likes
1,032

I have forgotten to mention the following:

You have also to create an append structure of the structure BAPI_TE_MARA. You have to put the field AENNR with the data element AENNR in this append structure.

You have also to create an append structure of the structure BAPI_TE_MARAX. You have to put the field AENNR with the data element BAPIUPDATE in this append structure.