Question:
Hello, I am trying download a document with the bapi BAPI_DOCUMENT_CHECKOUTVIEW2. If I do this with a GUI, it's work; but when I call the bapi BAPI_DOCUMENT_CHECKOUTVIEW2 from a JAVA Application the function donīt download anything.
I think that the problem is that when I call from Java I donīt GUI and the bapi need a GUI.
Anybody can help me?.
Thanks.
Answer:
Hi
with all BAPIs you must be aware of the German field conversion that could be done - see this in debugging mode via sapgui to determine which fields are converted to German (eg Sales Order type OR is TA in German).
Also I found that the bapi_simulate_salesorder does not work either with JCO 2.0.4 ...fixed some problems with JCO 2.0.6...but still does not work - and when called from JCO (outside SAP) some optional type fields seemed to be required.
The only way I got around it was to write a wrapper module to call the BAPI and then it worked.
regards
Peter
Answer:
Hi,
your problem might be that saphttp or sapftp could not be started locally on your computer. JCO itself does not allow to start any programs. You have to permit every program to be started from SAP.
Normally you can see in the trace something like "start of program saphttp not allowed"
Try the following code:
JCO.setMiddlewareProperty("jco.middleware.allow_start_of_programs", "saphttp;sapftp");