02-22-2010 12:54 PM
Hi experts,
I try to change material description using the BADI BAPI_MATERIAL_SAVEDATA.
For header data I enter the material number, then MATERIALDESCRIPTION with the new text + language.
When I try to execute, i got the following Retunr Message:
MK 102 Trying to create: 6694 ____ ____ ____ __________ ____ __ ___ ___
MG 160 The material cannot be maintained since no maintainable data transferred
MK 103 Trying to change: 6694 ____ ____ ____ __________ ____ __ ___ ___
M3 810 No changes made
What is wrong here?
02-23-2010 1:04 PM
along with material no, you also give material description, material group, unit of measure, werks(plant), material type. u pass these minimum parameters in bapi and it will work fine. I faced a similar issue.
02-22-2010 1:00 PM
Hi,
Can you check whether the material has any views avaliable..I think if no views are maintained for the material you may not able to provide the data.
Regards,
Aditya
02-22-2010 1:03 PM
Hi,
sorry, forget to mention:
In the HEADDATA I fill this fields:
MAETERIAL 6694
BASIC_VIEW X
MATERIALDESCRIPTION
LANGU D
MATL_DESC TEST
02-22-2010 1:10 PM
Hi,
You should also fill below three parameters in HEADDATA structure.
MATERIAL
IND_SECTOR
MATL_TYPE
Regards,
Ganga
02-22-2010 1:15 PM
Hi Ganga,
i tried with filling MATERIAL, IND_SECTOR, MATL_TYPE - nothing happened, exactly the same return message:
H MK 102 Trying to create: 6694 ____ ____ ____ __________ ____ __ ___ ___
S MG 160 The material cannot be maintained since no maintainable data transferred
H MK 103 Trying to change: 6694 ____ ____ ____ __________ ____ __ ___ ___
S M3 810 No changes made
02-22-2010 1:20 PM
Did you fill below three fields in MAKT table?
LANGU
LANGU_ISO
MATL_DESC
It worked fine for me. You were showing messages of type 'S'. Check if change has been reflected in material master.
Regards,
Ganga
02-22-2010 1:24 PM
Sure, I filled all fileds:
LANGU DE
LANGU_ISO DE
MATL_DESC TEST
Tried also with D...nothing happens, everytime the same error...
02-22-2010 1:27 PM
Pass some other text as description and check if the change is reflected in MAKT. It worked perfectly fine for me. It seems like you were passing the same text which is currently in DB as description.
Remember that this BAPI returns success messages as well. Check whether you are getting success or error message finally.
Regards,
Ganga
02-22-2010 1:33 PM
No change, nothing happens!
I can enter whatever I want - the text won't be changed.
But there's something curious:
The first time I tried using this BADI, chaning works fine (I can see in the changes, last one by MM01(BAPI)).
But since the second run of the BADI I got this retunr messages as posted before.
I tried it with another material - but the same...
Can't believe
02-22-2010 2:03 PM
02-22-2010 2:09 PM
02-22-2010 2:16 PM
Plz can you post how you are filling structures and tables and also your BAPI calling, specially if it's in a loop.
thanks
02-22-2010 2:20 PM
Here's my coding:
Here I made a loop over my ALV where I can change the MAKTX:
FORM verbuchen .
LOOP AT t_out_daten INTO t_int_daten.
SELECT SINGLE * FROM makt
WHERE matnr = t_int_daten-matlg
AND spras = 'DE'.
IF sy-subrc = 0.
CHECK t_int_daten-maktx NE makt-maktx.
PERFORM kurztext_aendern.
ENDIF.
ENDLOOP.
ENDFORM.
And here I try to update it:
FORM kurztext_aendern .
data: i_client like bapi_mara,
i_clientx like bapi_marax.
clear: i_return, i_headdata.
refresh: it_returnmessages.
i_headdata-material = t_int_daten-matlg.
i_headdata-basic_view = 'X'.
wa_bapimakt-langu = sy-langu.
wa_bapimakt-MATL_DESC = t_int_daten-maktx.
append wa_bapimakt to it_bapimakt.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = i_headdata
CLIENTDATA = i_client
CLIENTDATAX = i_clientx
* PLANTDATA =
* PLANTDATAX =
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA =
* VALUATIONDATAX =
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA =
* SALESDATAX =
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
* FLAG_ONLINE = 'X'
* FLAG_CAD_CALL = ' '
* NO_DEQUEUE = ' '
* NO_ROLLBACK_WORK = ' '
IMPORTING
RETURN = i_return
TABLES
MATERIALDESCRIPTION = it_bapimakt
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
RETURNMESSAGES = it_returnmessages.
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
ENDFORM.
I tried with filled IND_SECTOR and MATL_TYPE and this way - everytime the same result
02-22-2010 2:24 PM
Hi,
Don't pass client and clientx parameters. Make sure to fill the 6 fields which I mentioned in my earlier posts.
Regards,
Ganga
02-22-2010 2:26 PM
I will try once more - I only added this to test...
I will give it a try
02-22-2010 2:28 PM
OK.... I can see your problem is not Material Description. You are calling that BAPI and you are passing CLIENTDATA and CLIENTDATAX, both structures are empty that's why your error says that cannot change anything because anything has been passed.
Glück!!!
02-22-2010 2:35 PM
Last try:
I made a new program, this is the coding:
REPORT ztest_bapi.
DATA: i_client LIKE bapi_mara,
i_clientx LIKE bapi_marax.
DATA: wa_bapimakt TYPE bapi_makt.
DATA: it_returnmessages TYPE STANDARD TABLE OF bapiret2,
i_return TYPE bapiret2,
i_headdata TYPE bapimathead,
it_bapimakt TYPE STANDARD TABLE OF bapi_makt.
CLEAR: i_return, i_headdata.
REFRESH: it_returnmessages.
i_headdata-material = '6694'.
UNPACK i_headdata-material TO i_headdata-material.
i_headdata-basic_view = 'X'.
i_headdata-ind_sector = 'M'.
i_headdata-matl_type = 'FERT'.
wa_bapimakt-langu = sy-langu.
wa_bapimakt-matl_desc = 'NEW TEXT'.
APPEND wa_bapimakt TO it_bapimakt.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = i_headdata
* clientdata = i_client
* clientdatax = i_clientx
* PLANTDATA =
* PLANTDATAX =
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA =
* VALUATIONDATAX =
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA =
* SALESDATAX =
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
* FLAG_ONLINE = 'X'
* FLAG_CAD_CALL = ' '
* NO_DEQUEUE = ' '
* NO_ROLLBACK_WORK = ' '
IMPORTING
return = i_return
TABLES
materialdescription = it_bapimakt
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
returnmessages = it_returnmessages.
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
You can see I only fill the 2 tables (HEADDATA and MATERIALDESCRIPTION) and then call the BAPI.
The same return message...what am I doing wrong??
02-22-2010 2:38 PM
02-22-2010 2:40 PM
This I got:
1 H MK 102 Trying to create: 6694 ____ ____ ____ __________ ____ __ ___ ___
2 S MG 160 The material cannot be maintained since no maintainable data transferred
3 H MK 103 Trying to change: 6694 ____ ____ ____ __________ ____ __ ___ ___
4 S M3 810 No changes made
It is a success-message, but nothing changed
02-22-2010 2:41 PM
02-22-2010 2:45 PM
Absolut sure, checked it 2 times now...
Can I say - everything in the coding is correct?
02-22-2010 2:48 PM
Seems like every thing is fine.
Pass LANGU_ISO as well and check once.
02-22-2010 2:52 PM
Tried it with ISO-Langu also - but nothing happens...
I will try to debug the BAPI, maybe I will find the error
02-22-2010 3:00 PM
Hallo Michael,
Why don't you use the leading zeroes in Material Number???
02-23-2010 6:11 AM
Hi Dimar,
sorry for my late response.
I work with leading zeros:
UNPACK i_headdata-material TO i_headdata-material.
So this can't be the problem...
05-17-2011 2:26 AM
Hi Guys,
I'm encountering almost same error, but for the custom field. I've already done the configuration in SPRO and extended the table MARA, BAPI_TE_MARA and the BAPI_TE_MARAX.
On my return message I'm having an error "The material cannot be maintained since no maintainable data transferred".
I have the following code below....
REPORT zp601931_test_004.
DATA: ls_headdata TYPE bapimathead,
lt_extensionin TYPE STANDARD TABLE OF bapiparex,
ls_extensionin LIKE LINE OF lt_extensionin,
lt_extensioninx TYPE STANDARD TABLE OF bapiparexx,
ls_extensioninx LIKE LINE OF lt_extensioninx,
lt_messages TYPE bapiret2_t,
ls_bapi_te_mara TYPE bapi_te_mara,
ls_bapi_te_marax TYPE bapi_te_marax.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = '100-2520'
IMPORTING
output = ls_headdata-material.
ls_headdata-basic_view = 'X'.
ls_bapi_te_mara-material = ls_headdata-material.
Here I want to write 4 in my Append Field !!!!!
ls_bapi_te_mara-zzmar_field1 = '4'.
ls_bapi_te_marax-material = ls_headdata-material.
ls_bapi_te_marax-zzmar_field1 = 'X'.
ls_extensionin-structure = 'BAPI_TE_MARA'.
ls_extensionin-valuepart1+0(18) = ls_bapi_te_mara-material.
ls_extensionin-valuepart1+18(1) = ls_bapi_te_mara-zzmar_field1.
APPEND ls_extensionin TO lt_extensionin.
ls_extensioninx-structure = 'BAPI_TE_MARAX'.
ls_extensioninx-valuepart1+0(18) = ls_bapi_te_mara-material.
ls_extensioninx-valuepart1+18(1) = ls_bapi_te_marax-zzmar_field1.
APPEND ls_extensioninx TO lt_extensioninx.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = ls_headdata
TABLES
returnmessages = lt_messages
extensionin = lt_extensionin
extensioninx = lt_extensioninx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Thanks and Regards,
Jay
Edited by: jhayyy on May 17, 2011 3:58 AM
02-22-2010 1:03 PM
Hi,
I guess you are not passing data to the import paramter HEADDATA or change structures properly. (CLIENTDATAX etc).
Please read the documentation and get back in case of any issues.
Regards,
Ganga
02-23-2010 1:04 PM
along with material no, you also give material description, material group, unit of measure, werks(plant), material type. u pass these minimum parameters in bapi and it will work fine. I faced a similar issue.
02-23-2010 1:05 PM
02-23-2010 1:26 PM
OK, now I filled these fields:
i_client-matl_group = '313'.
i_client-base_uom = 'ST'.
i_plantdata-plant = '0001'.
and got this error:
1 E MM 360 Key fields for use data PLANTDATA and checkbox structure PLANTDATAX are different
Just a small issue now...
02-23-2010 1:27 PM
02-23-2010 1:29 PM
Sorry I meant you have to do also
i_plantdatax-plant = 'X'.
and pass it to BAPI.
anyway, I think plant is not necessary, clientdata and clientdatax are necessary, i made a sample and it works.
02-23-2010 1:30 PM
02-23-2010 1:33 PM
As i told in my prevous message plantdata is not necessary... you have to pass clientdata and clientdatax.
02-23-2010 1:35 PM
I don't use Plantdata and plantdatax.
Result:
1 H MK 102 Trying to create: 6694 ____ ____ ____ __________ ____ __ ___ ___
2 S MG 160 The material cannot be maintained since no maintainable data transferred
3 H MK 103 Trying to change: 6694 ____ ____ ____ __________ ____ __ ___ ___
4 S M3 810 No changes made
Client & ClientX is filled as you described...
02-23-2010 1:37 PM
02-23-2010 1:38 PM
here it is:
REPORT ztest_bapi.
DATA: i_client LIKE bapi_mara,
i_clientx LIKE bapi_marax,
i_plantdata TYPE bapi_marc,
i_plantdatax TYPE bapi_marcx.
DATA: wa_bapimakt TYPE bapi_makt.
DATA: it_returnmessages TYPE STANDARD TABLE OF bapiret2,
i_return TYPE bapiret2,
i_headdata TYPE bapimathead,
it_bapimakt TYPE STANDARD TABLE OF bapi_makt.
CLEAR: i_return, i_headdata.
REFRESH: it_returnmessages.
i_headdata-material = '6694'.
UNPACK i_headdata-material TO i_headdata-material.
i_headdata-basic_view = 'X'.
i_headdata-ind_sector = 'M'.
i_headdata-matl_type = 'FERT'.
wa_bapimakt-langu = sy-langu.
wa_bapimakt-langu_iso = 'DE'.
wa_bapimakt-matl_desc = 'NEW TEXT'.
APPEND wa_bapimakt TO it_bapimakt.
i_client-matl_group = '313'.
i_client-base_uom = 'ST'.
i_clientx-matl_group = 'X'.
i_clientx-base_uom = 'X'.
*i_plantdata-plant = '0001'.
*i_plantdatax-plant = '0001'.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = i_headdata
clientdata = i_client
clientdatax = i_clientx
* plantdata = i_plantdata
* PLANTDATAX = i_plantdatax
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA =
* VALUATIONDATAX =
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA =
* SALESDATAX =
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
* FLAG_ONLINE = 'X'
* FLAG_CAD_CALL = ' '
* NO_DEQUEUE = ' '
* NO_ROLLBACK_WORK = ' '
IMPORTING
return = i_return
TABLES
materialdescription = it_bapimakt
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
returnmessages = it_returnmessages.
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
02-23-2010 1:44 PM
Give me a chance to see what can be happening there... even if you are not using plantdata I want to correct that you cannot tell
i_plantdatax-plant = '0001'. but i_plantdatax-plant = 'X'.
I will try to figure out what's happening here... I write you back soon.
02-23-2010 1:46 PM
Sure, I thought the same - plant must be a 'X'
I tried it this way, then checked the sturucture. And there you can see that plant is a character field with the lenght of 4. This is why I tried it this way...
OK, check if you can find out what's wrong, thanks a lot so long
02-23-2010 1:59 PM
Below code is working fine for me.
i_headdata-material = '000006949900858600'.
UNPACK i_headdata-material TO i_headdata-material.
i_headdata-basic_view = 'X'.
i_headdata-ind_sector = 'C'.
i_headdata-matl_type = 'Z001'.
wa_bapimakt-langu = sy-langu.
wa_bapimakt-langu_iso = 'EN'.
wa_bapimakt-matl_desc = 'NEW TEXT'.
APPEND wa_bapimakt TO it_bapimakt.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = i_headdata
* clientdata = i_client
* clientdatax = i_clientx
* plantdata = i_plantdata
* PLANTDATAX = i_plantdatax
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA =
* VALUATIONDATAX =
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA =
* SALESDATAX =
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
* FLAG_ONLINE = 'X'
* FLAG_CAD_CALL = ' '
* NO_DEQUEUE = ' '
* NO_ROLLBACK_WORK = ' '
IMPORTING
return = i_return
TABLES
materialdescription = it_bapimakt
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
returnmessages = it_returnmessages.
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
A quick question here. Did you log in with 'DE' or 'EN'? LANGU_ISO should be related to LANGU. Check in MAKT table for the language you are passing to the BAPI
Regards,
Ganga
Edited by: Ganga Bhavani R on Feb 23, 2010 7:30 PM