03-12-2008 2:51 PM
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......
03-12-2008 3:00 PM
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
03-12-2008 3:07 PM
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 ?
03-12-2008 3:27 PM
03-12-2008 3:41 PM
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
03-12-2008 3:48 PM
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.....