Application Development 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: 

update base quantity by BAPI_MATERIAL_SAVEDATA?

navdeep_thakur12
Explorer
0 Kudos

Hi all,

I am trying to update number of fields by BAPI_MATERIAL_SAVEDATA, but only base quantity (MARC-BASMG) is not getting update.

at the same time its getting update manually by MM02. (Work scheduling view > base qty.)

I have passed the value to bapi_marc-base_qty and bapi_marcx-base_qty tables correctly.

Regards,

11 REPLIES 11

Former Member
0 Kudos

Hi Navdeep,

Try using fm "bapi_transaction_commit" after your BAPI call. This will commit the changes by bapi.
Hope it helps.

Regards,
Pranav.

0 Kudos

Hi Pranav,

I have already used "bapi_transaction_commit"  after BAPI_MATERIAL_SAVEDATA.

Can you suggest what values should be passed in table HEADDATA that passed to BAPI_MATERIAL_SAVEDATA for mass updation?.

Regards

0 Kudos

Hi Navdeep,
According to my knowledge BAPI_MATERIAL_SAVEDATA. wont allow mass updation. You can try calling the bapi in loop. Try to find some related threads on scn.

regards,
Pranav.

0 Kudos

Hi Pranav,

actually I am updating approx. 49 fields using BAPI_MATERIAL_SAVEDATA and all are getting update except Base quantity (BASMG). although I am passing its value same way like others.

I wonder there may be some issue with HEADERDATA table .

Regards

0 Kudos

Hi,

Are you definitely passing the correct value?  Have you checked if that field has a conversion function attached to it?

Cheers,

G.

Former Member
0 Kudos

Hi Navdeep,

For to update BASMG field for material you needs to pass HEADDATA(Material Number) ,  CLIENTDATA(Material group),CLIENTDATAX,PLANTDATA(Plant,Base qty) and correspond fields in PLANTDATAX.

I just tried example it's working fine , Do the changes in your program and check.

Result

Check in table MARC

Regards

Mani

0 Kudos

Hi Nagamani,

thanks for your response.

Actually independently its getting update but when I am updating multiple fields (approx. 49 in my case) using this BAPI single time and passing the values to corresponding fields of HEADERDATA, CLIENTDATA,CLIENTDATAX,PLANTDATA,PLANTDATAX. base quantity is not getting update.

Regards

former_member209217
Active Contributor
0 Kudos

Hi Naveen,

Are you passing all the required key fields for base quantity updation like Plant, purchasing group  etc.,? There shouldn't be any  problem with HEADERDATA table unless we pass wrong information to BAPI. There are nearly 19 fields present in HEADERDATA parameter. Try to populate most of the fields with the information you have.

Best Regards,

Lakshman

0 Kudos

Hi Lakshman,

can you tell me what are the required key fields for base quantity updation?

Regards

0 Kudos

Hi Navdeep,

Please refer the Long text documentation of HEADDATA present in Import parameters of the BAPI.

I mean key fields are the one's which you enter in dialog screen of Material Maste while trying to change/create the material

Best Regards,

Lakshman

former_member185054
Active Participant
0 Kudos

hi,

i hope you may forgot to pass the unit.

With regards,

sampath kuamr