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: 

Return Messages for a BAPI run in Background

Former Member
0 Kudos

Hi all,

I am running a BAPI( BAPI_SALESORDER_CHANGE ) in Background task, It works fine and updates the Sales order but i dont get any return messages.But based on the return messages i need to show up on the report which orders got updated and which are not.....

Can anyone help me how can i get the return messages when i run a BAPI in background task......

5 REPLIES 5

Former Member
0 Kudos

Hello,

After execution of BAPI, loop through the return internal table ' RETURN' and write the relevant messages as a report. After batch run, you can get the result in the spool.

Thanks,

Venu

0 Kudos

Thanks for the quick response....I think you got me wrong...I am not running the program as a background job....I am running only the bapi in background task as below.....

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

IN BACKGROUND TASK AS SEPARATE UNIT

EXPORTING

salesdocument = v_vbeln

order_header_in = it_bapisdh1

order_header_inx = it_bapisdh1x

TABLES

return = it_return

partnerchanges = it_bapiparnrc.

When the bapi runs as a background task i dont get any return messages in it_return but the sales order gets updated....

But i will have to capture the return messages as well....How can i achieve that ?

0 Kudos

Does anybdy have an idea how to do this ?

0 Kudos

Hi ,

why don't you write out the contents of i_return on the screen ...i understand that ur running this as background job ...if you writeout the contents ...that will be stored as spool ...once u have the spool no ...u can retrive tht output contents any time ...or else write in a piece of code to generate email ...which will contains the contents of i_return ...

Regards

Hemal

0 Kudos

The problem is i dont get any messages in IT_RETURN when i run the BAPI in Background as it runs as a different task....If i run the same BAPI in the foreground or in the normal mode i get the messages in IT_RETURN..But the problem is only when i run the BAPI as Background Task.....