I am working on a java application which need to connect to SAP R/3. Through my java code I am trying to call BAPI
functions. We are using JCO 1.1. While creating a salesorder I use BAPI_SALESORDER_CREATEFROMDAT1. I have set all the necessary input parameters like header, items and partner role. Before and after executing the function I am taking an HTML dump. In that HTML after execution it gives me an error in the return parameter(BAPIRETURN) "No customer master record exists for sold-to party" and since the function is not executed properly as usual it is not giving me a salesdocument number, since the order is not properly created. In the case above my document type was "ZOR1" . Then I tried creating another order (through java) using document type "TA" which is the german version for "OR". This time I didn't get any error and document number was also generated, but it was unable to set the sold-to-party and ship-to-party informations. The number generated for the document was also not similar to those for successfully created orders. But with the same input I could create a salesorder from SE37 function module (which also successfully sets the sold-to-party and ship-to-party info). Please enlighten me with the solution for the problems I am facing. As In case of "OR" I have used "TA". What are the other mappings for other document types like ZOR1, ZSH1, etc. Where do I get all these mappings? Also please tell me why the same parameters which successfully created an order in se37 are unable to create the same through BAPI call from java application. What changes need to be done? Can you elaborate on the German - English issue while passing the input parameters?
The BAPIs usually use the internal format (e.g., German codes, leading zeroes) for all fields. SE37 calls the GUI conversion exits, whereas the BAPIs themselves do not (see my article in www.sappro.com). My company offers a component (ARAsoft Java BAPI ObjectFactory) that helps with the necessary conversions (send email for trial version). Otherwise you have to study the conversion BAPIs and use them in your client code. Check the dictionary definitions for all fields you are using to see whether they have associated conversion exits.
Dig deeper on SAP ABAP
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.