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).
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.
This was first published in October 2001