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

help

Former Member
0 Likes
493

hi,

1)can we expect return value from asynchronous bapi,

2)can we commit asynchr., bapi

3) how to make bapi as aynchronous

4)what is object type and interface type in the initial screen of SWO1 (seen under category box)

points are assured.

ganesh

3 REPLIES 3
Read only

Former Member
0 Likes
457

Hi Ganesh,

A good doc to check regarding asynchronous BAPI's..

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2a1dd5d3-0801-0010-ed8d-bd7...

Hope it helps.

Br,

Sri

Award points for helpful answers

Read only

uwe_schieferstein
Active Contributor
0 Likes
457

Hello Ganesh

Here are a few short answers to your questions:

(1) Yes and no, depending if it is called with or without response

(2) I do not think so because of the asynchronous mode

(3) CALL 'BAPI_...' STARTING NEW TASK <task name>

For more details please refer to a very recent article about

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f078394a-4469-2910-c4bf-853c75674694">Master the five remote function calls (RFC) types in ABAP</a>

Regards

Uwe

Read only

Former Member
0 Likes
457

Hi ,

Yes you can expect return values from an asynchronous BAPI and you can call a BAPI asynchronously.

I will explain the process for the same , this is not just restricted to BAPI but is applicable for all RFC FM.

An asynch RFC FM can be called in two ways without result and with result.

The meaning of both are implied.

So how do you execute a FM as async without result , all you need to do is add the statement

<b>STARTING NEW TASK 'my_new_task'</b>

in the FM call e.g.

CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
STARTING NEW TASK 'my_new_task'   "asynch call without resposne
  EXPORTING
    DATE                             = sy-datum
    FACTORY_CALENDAR_ID              = '55'
    MESSAGE_TYPE                     = 'E'.

Where 'my_new_task' is just name of a task you create , if you call another FM in the same task then it is also executed in the same instance.

To call a RFC FM in async with response along with this statement you need to add <b>PERFORMING RESP1 ON END OF TASK </b>

so the calls looks like this

CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
STARTING NEW TASK 'my_new_task'   
PERFORMING RESP1 ON END OF TASK   "asynch call with response
  EXPORTING
    DATE                             = sy-datum
    FACTORY_CALENDAR_ID              = '55'
    MESSAGE_TYPE                     = 'E'

here RESP1 is a subroutine which is executed when wait statement is executed .

in the RSSP1 subroutine you need to add the code to retreive the result , the code will look some thinsg like

<b> RECEIVE RESULTS FROM FUNCTION 'DATE_CHECK_WORKINGDAY'</b> , after this you need to map the varaibles in which the data is ti be stored. it is smilar to the way you call the FM.

Regards

Arun