‎2014 Jan 24 5:42 PM
Hi all,
I am doing some analysing to find out why some data in SAP are wrong.
Data are coming from an external system to sap using the .Net Connector, RFC. A field in SAP has a wrong content. I have been told to check the BAPI BAPI_ACC_DOCUMENT_POST or BAPI_ACC_DOCUMENT_CHECK.We are writing our own BAPI using the existing one in them. I have found that the table "accountgl" has not been changed anywhere in any of theses BAPIs. My questions are:
- how does the transfer of data with BAPI actually work?
- Where should I look? I have not found any report in our sap system where data mapping have been done for this purpose, to fill the BAPI table? I think I need better understanding of how the connection with BAPI work. A few sentences to give me an idea will be fine. I have created a BAPI before just to learn how to create it. I have never connected 2 Systems.
Please help.
‎2014 Jan 25 9:08 AM
Hi Maria,
you created a remote functional module with the transaction SE37? In this modul you call the bapi BAPI_ACC_DOCUMENT_POST. You must create this own functional routine in both Systems (i think you made it). The rfc call is directly, without conversations (without ALE). Do you work with tables as importing / exporting parameters. In the past the rfc layer (it's old) need tables (multi arrays) as table (--> old style). I think you give all fields as value in the interface (sap check it, when you activate the functional modul as remote - on the first register).
When you set an external breakpoint in your target system with the rfc user, you can catch the call and it's possible, to see the incoming parameters. An other way to analyse is to work with the transaction st12. There you can activate the trace for your rfc user (in the target system) and for the user, which call the function module (in the sender system).
For further help i need the source of your customer functional module and the source, where you call the functional module.
Regards Thomas
‎2014 Jan 24 6:17 PM
If done correctly, your BAPI will be placing data in the interface fields and tables of the standard BAPI. My first step would be to get the data that is being presented to your BAPI and debug it in the foreground. Check to see that all of the standard BAPI fields are filled with appropriate data.
Neal
‎2014 Jan 24 6:40 PM
Thanks for your answer. The data coming from the external system are filled in the SAP tables. That is not the problem. The problem is that one field has a wrong value. I have to check where this error is coming. I would like to understand how the data from the external system come to fill the interface. My goal is to check if they have been changed somewhere. I used on the BAPI BAPI_ACC_DOCUMENT_POST the where used list to go back and check the origin of the data but I could find any. I explain it a little simplier: I just need to understand how the data get to the BAPI. I didnt find any report that read data from a file in an internal table or something. Please I am new to this. HELP!!!
‎2014 Jan 24 7:04 PM
‎2014 Jan 24 7:10 PM
Hi Maria
if its being remotely called you wont be able to check it via where used list. Which field is the issue
nabheeet
‎2014 Jan 24 10:48 PM
how does the data transfer works remotely. I need to understand the steps.
‎2014 Jan 24 9:25 PM
Hello Maria,
in the normal way it's not difficult.
You can look to this post and I think you'll find the solution.
http://scn.sap.com/thread/600962
Warm regards
Thomas
‎2014 Jan 24 10:52 PM
the code is already working but my problem is that i cannot find the mapping part anywhere. Is it possible that data are transfered directely without any change from one system to the other. I need to understand how this transfer work. Thanks
‎2014 Jan 25 9:08 AM
Hi Maria,
you created a remote functional module with the transaction SE37? In this modul you call the bapi BAPI_ACC_DOCUMENT_POST. You must create this own functional routine in both Systems (i think you made it). The rfc call is directly, without conversations (without ALE). Do you work with tables as importing / exporting parameters. In the past the rfc layer (it's old) need tables (multi arrays) as table (--> old style). I think you give all fields as value in the interface (sap check it, when you activate the functional modul as remote - on the first register).
When you set an external breakpoint in your target system with the rfc user, you can catch the call and it's possible, to see the incoming parameters. An other way to analyse is to work with the transaction st12. There you can activate the trace for your rfc user (in the target system) and for the user, which call the function module (in the sender system).
For further help i need the source of your customer functional module and the source, where you call the functional module.
Regards Thomas
‎2014 Jan 25 10:03 AM
Hi Thomas,
thanks. Everything is written and has worked for years. The problem is just that of field of the table accountgl has wrong value in it. You say that the rfc call is directly, without conversations (without ALE).Does it mean that the data coming from the external system cannot be changed? If yes, that mean that the mapping is happening in the external system. The external system is not an SAP System. I have no access to the external system. Does it mean that the data could have being wrong in the external system and just got transfered directly to SAP?
Thanks.
‎2014 Jan 25 10:17 AM
Hi Maria,
yes, that's right. When you work with rfc / webservice, - the communication is online / without changes, before the rfc function module start (in SAP). In the normal way the mistakes are in the sender system, before the rfc function module start or in sap, in the rfc function module - or later.
Some externel systems don't support the rfc communcation directly and go over an interface proxy. Here you can have mistakes also because often it's possible to make conversations / mappings in the Proxy. But this is not a SAP part.
In ALE / IDOC communcations there is an layer in SAP for conversation - bevor the function module start.
‎2014 Jan 25 2:30 PM
Thanks. I have the BAPIs FM. How can I find out which RFC Function modules are used?
‎2014 Jan 25 2:56 PM
The BAPI is also a RFC function module... you can call this function module with RFC from outsite. Sometimes it's necessary to make other thinks before the bapi work. In this way, you create a customer function module and in this call the bapi. Then the bapi doesn't work as RFC module, the new function module take this part.
‎2014 Jan 25 4:33 PM
Hi Thomas, thanks so much for your help. I have a customer function module that calls the BAPI_ACC_DOCUMENT_POST. In this customer function module the table accountgl is not changed. There is a report written and in this report there is two customers written function modules in example
ZBAPI_ACC_DOCUMENT_CHECK and ZBAPI_ACC_DOCUMENT_POST that called each respectively
BAPI_ACC_DOCUMENT_CHECK and BAPI_ACC_DOCUMENT_POST. In the report there are few testdata that are set at the beginning. If I understood well, the customer function module are connected to the external system and the data exchange happens when the are called. Do you have a link where I can read more about this? I see a lot of links to create the function module but none that explain how the data transfer work. Thanks.
‎2014 Jan 25 10:51 PM
Yes, that's right.
Look to
SAP Library - Components of SAP Communication Technology
go to "RFC in SAP Systems"
‎2014 Jan 27 10:28 AM
Hi,
thanks for your reply. I just read this
Transferring FI-Asset Master using BAPIs in Data Transfer Workbench - ABAP Development - SCN Wiki
I am a little bit confused because I cannot see the mapping of the external data to sap. I have read that LSWM used mapping rules for this.
I am confused.
‎2014 Jan 31 6:28 PM
Hi,
in LSMW you can make mapping rules. It's possible to use BAPIs in this. The workbench generate a Report for the conversation step. In the normal way you use it for data migrations and simple Interfaces.
‎2014 Jan 25 11:30 AM
Hi,
Hope you know how to pass input parameters to the BAPI. Using SE37 you can test the web service with your sample data. same time with the external party you can confirm same sample data passed particulate parameter field.
you can trace the web service using T-code SRT_UTIL. once you post the document can do testing using FB03 weather the document post or not properly.
for BAPI_ACC_DOCUMENT_POST need to commit also.
Regard,
Nawa
‎2022 May 12 12:21 PM
If you call the BAPI via RFC such as...
call function 'BAPI_ACC_DOCUMENT_POST' destination 'XXX' ...
...you MUST run the following function module afterwards:
call function 'BAPI_TRANSACTION_COMMIT' destination 'XXX'.
A simple "commit work" does not work since it does not reach the RFC system! Don't forget the destination.