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

BAPI Problem

Karan_Chopra_
Active Participant
0 Likes
685

I am using a BAPi to update marc table

the code is

loop at int_table.

read table int_marc with key matnr = mara-matnr werks = t001w-werks.

ls_headdata-material = mara-matnr.

ls_headdata-storage_view = 'X'.

ls_plantdata-plant = t001w-werks.

ls_plantdatax-plant = t001w-werks.

ls_headdata-mrp_view = 'X'.

if int_table-fieldnm = 'DISMM'.

if not int_table-nvalue is initial.

ls_plantdata-mrp_type = int_table-nvalue.

ls_plantdatax-mrp_type = 'X'.

endif.

endif.

endloop.

call function 'BAPI_MATERIAL_SAVEDATA'

exporting

headdata = ls_headdata

plantdata = ls_plantdata

plantdatax = ls_plantdatax.

message s004(zbhi) with 'Saved Successfully'.

<b>ls_headdata, ls_plantdata, ls_plantdatax</b> all are getting properly populated

but marc is not getting updated with DISMM.

4 REPLIES 4
Read only

Karan_Chopra_
Active Participant
0 Likes
552

plz help

Read only

dev_parbutteea
Active Contributor
0 Likes
552

Hi,

do a bapi commit after function call:

call function 'BAPI_MATERIAL_SAVEDATA'

exporting

headdata = ls_headdata

plantdata = ls_plantdata

plantdatax = ls_plantdatax.

if sy-subrc = 0.

call function 'BAPI_TRANSACTION_COMMIT

EXPORTING

WAIT = 'X'.

if sy-subrc = 0.

message s004(zbhi) with 'Saved Successfully'.

endif.

endif.

Thanks and Regards,

Sooness.

Read only

Former Member
0 Likes
552

Hi!

Have you used the BAPI_TRANSACTION_COMMIT function module, after your BAPI?

Regards

Tamá

Read only

Karan_Chopra_
Active Participant
0 Likes
552

its still not working