on 12-15-2005 7:24 PM
Hi..
I have scenario..which will post the data into R/3 side.
My source system is JDBC(SQlDatabase) ,and target system is BAPI(R/3).. after successfully insert the data into R/3, the return code should check success and failure message and based on that i should call commit and rollback BAPIs.
Please let me know let it be possible in XI?
Its appriciated and honour to eligible for points if you provide logical steps about this scenrio.
Thank you...
Regards..Rambarki!
Rambarki-
BAPI Commit needs to happen in the same LUW (Logical Unit of Work) as the main BAPI.
Hence, you need to have a wrapper module where in you will call the BAPI first, check the return parameter and then based of success you will call BAPI commit.
Here is a sample for creating customer master.
- Create a wrapper module 'Z_BAPI_WRAPPER'. Make sure the import, export etc. parameters are the same as customer master create BAPI.
- Inside this BAPI, call the customer master create BAPI. Check the Return structure for any errors
- If no error, call BAPI_COMMIT
From XI, you will call the wrapped module.
Additionally check SAP note 730870.
Let me know if you need more info.
KK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rambarki,
Which service pack you are working on ?
If you are on SP14 then you need not create a wrapper, you can use standar SAP feature to do this.
**********************
http://help.sap.com/saphelp_nw04/helpdata/en/c8/e80440a832e369e10000000a155106/content.htm
Commit Control for Individual BAPI Calls
If you want to use this communication channel to call BAPIs as remote-enabled function modules that change data in the database, set the indicator.
If executed successfully, the transaction is written to the database by calling the function module BAPI_TRANSACTION_COMMIT explicitly. If an error occurs, the transaction is rolled back by BAPI_TRANSACTION_ROLLBACK.
The result is determined by the value of the field TYPE in parameter RETURN. If successful, the tables are empty and the values , S, I, and W are displayed. All other values are regarded as errors.
To change this setting, set the indicator BAPI Advanced Mode.
In the Successful RETURN-TYPE Values table, enter the values that should lead to a successful execution.
**************************
If your working on service pack <SP14 then refer the link below...this will help you in creating a wrapper..
https://websmp203.sap-ag.de/~sapdownload/011000358700000328352005E/HowtouseBAPandccBPM.pdf
Regards
Anand
Thanks Anand,
Yes we are using SP14, and if you dont mind please give clear clarity of your words.of follwing..!
"The result is determined by the value of the field TYPE in parameter RETURN. If successful, the tables are empty and the values , S, I, and W are displayed. All other values are regarded as errors."
Thank you for timely response..
Regards..Rambarki
Hi Rambarki,
Check SAP note note 730870 - Question 10 for more information..
As of SP 14 support for commit handling for single BAPI calls was added to the RfcAdapter receiver channel. If activated in the receiver channel setting, the received XI message will be executed as synchronous RFC (sRFC) in the receiving system. This is also true for asynchronous (QoS EO) XI messages to receive and analyze the execution result by the RfcAdapter.
The received response is parsed by the RfcAdapter to get the BAPI return parameter with name "RETURN". This return parameter can be of BAPIRETURN, BAPIRET1 or BAPIRET2 types. The "RETURN" parameter is checked for the response status (field TYPE) which can take following values:
1. 'S' : Success
2. 'I' : Information
3. 'W' : Warning
4. '' : Empty String
5. 'A' : Abort
6. 'E' : Error
If the response contains one amongst the first four response status then it implies that the BAPI was successful. If the response contains one amongst the last two response then the BAPI failed. If the BAPI "RETURN" parameter is of not of type ABAP structure rather of type ABAP table, a empty table is also considered as successful execution result.
In case of a successful execution the BAPI function module "BAPI_TRANSACTION_COMMIT" is called within the same context to trigger the commit of the BAPI. In case of a failure the BAPI function module "BAPI_TRANSACTION_ROLLBACK" is executed by RFC Adapter which rolls back the changes.
If the XI request message was of QoS BE, the result of the BAPI execution is send back as XI response. In case of a QoS EO request message nothing is send back as response.
Regards
Anand
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.