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: 

BAPI_MATERIAL_MAINTAINDATA_RT not updating table

Former Member
0 Kudos

Hello Experts,

I have beeing trying to find the solution for this stange problem,

I have this BAPI : BAPI_MATERIAL_MAINTAINDATA_RT which i ma using  to update the table.

now the issues is when i run the IDOC that does this update, it is not updating the table every time, instead it does it at some random time.

But when I go into debug mode, it does updates the table every time.

I konw the debugg has something called implicit commit which updates it.

after the BAPI call I have call BAPI_TRANSCATION_COMMIT with wait = 'X' and once with wait = '5' as well.
also tried using wait up to 5 seconds insted of above call & tried commit and wait too

but its of no use.

It does not updates the table, it does but at very random time, but in dubug it always does.

Is that any soultion to this problem?

Any help is highly apreciated.

Thanks,

Abhijeet

5 REPLIES 5

Former Member
0 Kudos

Hello Abhijeet,

Are you catching any errors that may be returned from the BAPI?

The BAPI documentation states that the updates are done synchronously.  Therefore you should see no delay in the updates.  However, all changes will be "rolled-back" if any error occurs.

Are you checking the RETURN parameter from the BAPI?   Have you looked for messages in the Application Log (SLG1)?

From BAPI documentation:

"The data transferred is updated synchronously; that is, not using an update
task. This is necessary because this method is also used in distribution by Application Link
Enabling
(ALE), where asynchronous updating cannot be supported in

inbound processing because the processing status of the assigned IDocs cannot otherwise be set
reliably.

If a serious database error occurs during synchronous updating of the
application data, a rollback for all database changes made so far is triggered
in the method. If the method is called in a commit unit together with other
methods, the database changes of the previously executed method calls are also
rolled back as a result. The rollback is necessary to prevent database
inconsistencies due to only part of the application data being updated
correctly.

Any information or error messages that are issued while the data is being
processed are recorded in the application log. If you want to view these
messages, a commit must be performed after this method is called so that the
data in the application log is written to the database. Even if the structure
RETURN returns an E-type (error) message in field TYPE, a commit must be
performed so that the application log is written. In the event of an error, the
method itself ensures that the data is reset correctly. The commit is also
necessary to trigger the updating of the classification data because the update
module for the classification data is registered by means of PERFORM ON COMMIT
and is started only by a COMMIT WORK."

former_member223322
Active Participant
0 Kudos

Are you calling the BAPI with update task? Check the BAPI documentation that has the below statement.

The data transferred is updated synchronously; that is, not using an update task. This is necessary because this method is also used in distribution by Application Link Enabling (ALE), where asynchronous updating cannot be supported in inbound processing because the processing status of the assigned IDocs cannot otherwise be set reliably.

~Srini

Former Member
0 Kudos

Do you have 'X' in the proper X tables?

For example, if yo want to change something in CLIENTDATA, then you have to put X's in the right fields in CLIENTDATAX.

Also are you checking the value of RETURN?

If that's not it, you might want to let us see a snippet of the code.

Neal

Former Member
0 Kudos

Hello All,

Thank you for your suggestions,

finally the table is being updated,

used Wait upto 5 seconds.

I dnt know why it didnt worked before.

I commented the Commit work statement and then tried It worked.

Thank you once again.

Abhijeet

0 Kudos

Instead of issuing a wait, you might want to look into checking the locks.

Neal