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_MATERIAL_SAVEDATA cannot update MARA and MARC thru batch input (CS07)

Former Member
0 Likes
566

HI ABAP Gurus,

I am doing a batch input program (using CS07) to update the AUSME of table MARC and VABME of table MARA using the BAPI : BAPI_MATERIAL_SAVEDATA.

It seems that the program does not update the tables though I do not receive any error. Also, the sy-subrc after BAPI_MATERIAL_SAVEDATA is 0.

Below is my code for this:

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = e_mathead

clientdata = e_mara

clientdatax = e_marax

plantdata = e_marc

plantdatax = e_marcx

IMPORTING

return = e_bapiret.

IF sy-subrc EQ 0

AND e_bapiret-type EQ c_e.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

ENDIF.

Can you please tell me if there's something lacking in my code?

Thank you.

Regards,

Onyx

HI ABAP Gurus,

I am doing a batch input program (using CS07) to update the AUSME of table MARC and VABME of table MARA using the BAPI : BAPI_MATERIAL_SAVEDATA.

It seems that the program does not update the tables though I do not receive any error. Also, the sy-subrc after BAPI_MATERIAL_SAVEDATA is 0.

Below is my code for this:

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = e_mathead

clientdata = e_mara

clientdatax = e_marax

plantdata = e_marc

plantdatax = e_marcx

IMPORTING

return = e_bapiret.

IF sy-subrc EQ 0

AND e_bapiret-type EQ c_e.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

ENDIF.

Can you please tell me if there's something lacking in my code?

Thank you.

Regards,

Onyx

1 REPLY 1
Read only

Former Member
0 Likes
431

Hi Onyx,

I am facing same problem, kindly suggest me the solution.

Thanks in Advance...

Devendra Meshram