on 07-27-2005 5:03 PM
Hi,
I'm trying to create salesorder in php with rfc BAPI_SALESORDER_CREATEFROMDAT2. I call it through webservice with php soap call. It works ok as I get response that order created with some number. However order is not created in sap. I also run BAPI_TRANSACTION_COMMIT but with no help.
I have found some description about the issue describing createTID or session locking in bc, but it didn't help.
Question is how can it be done in php? I'know it's possible to create z_rfc to run both but it should also be possible to run both create and commit in php as well.
(I have r/3 4.7/6.20)
I'd appreciate a lot any insight into this,
erki
Hi,
can someone help me with the parameters sintax for these bapis (bapi_salesorder_createfromdat2 and bapi_transaction_commit) in PHP?
thanks
-- sorry for my pour english --
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Erki,
You should be able to run both from PHP.
I have not used these BAPIs and do not have access to a system where I can run them.
Can you provide more detail on the createTID and session locking that you mention.
Essentially the calls from PHP are two distinct calls to the system. If you implemented this in Java instead of PHP you would have the same interaction with the R/3 system. I know this does not help much, but if we can get more details on the nature of the problem we may be able to determine what is happening.
Regards
JohnA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello John,
could not completely agree with you. If you're using Java you can do both calls in one session. Meaning that you get one connection (discrete or from session pool) and use that to call the BAPI.. and the commit. I think with SAPRFC it should be also possible. But how can you keep the session with SOAP?
Regards
Gregor
Hi Gregor,
I was referring to a Java Application, not running on a J2EE server. I should have been clearer.
In the context of a web service call, even from a J2EE server you are still running over SOAP and therefore would you not have the same problem?
Out of curiosity, why would being within a single session on the client end (calling side) have an effect on this?
How would this affect the BAPI calls?
Regards
JohnA
A simple way of testing a Web Service in Java is to use the WSDL2Java tool from Apache Axis. This will take a WSDL and generate Java classes to allow access/testing of the Service.
Using this it is feasible to create a small Java application to invoke the two BAPIs as web services. This would allow the cause of the problem to be identified as PHP or Web Service based.
Not really relevant to PHP, but Axis is a tool I keep available when all else fails and I want to try an approach in a different language.
In conjunction with Tomcat, Axis gives you the ability to test both ends of the service.
Cheers
JohnA
I found following but it does not help in php side:
>You can also try:
>1. pub.sap.client:createTID and assign created tid to >variable $tid
>2. INVOKE sap.map:outbound for your BAPI and assign >created tid in step 1 to parameter $tid
>3. pub.sap.client:confirmTID and assign created tid in >step 1 to parameter $tid
and
>You should try adding service pub.sap.client:lockSession >before you call the BAPI BAPI_BUPA_CREATE_FROM_DATA. Then >you call the BAPI_TRANSACTION_COMMIT and the last step is >to call pub.sap.client:releaseSession.
so do you know if it is possible to achieve similar result in php?
I have no java installed on server. I create new soap client with
$client = new SoapClient($wsdl,...
for both rfc-s and I then run these webservices. Is there a possibility to run two webservices with different wdsl in one soapclient? Possibly not but one can hope
br
erki
Hi Erik,
Hopefully Gregor can shed some more light on the need to maintain a session for the LUW. That is unfortunately not an area I have any expertise in.
We can then try to find a means to replicate this in a web service environment (if possible).
A link tot he business connector solution:
Regards
JohnA
Hi Erik,
If you were on a 6.40 system then you would be able to define a web service for your BAPIs and mark them as session oriented.
The tutorial "ABAP Web Service Definition in Web AS 6.40" (that you can find on SDN) and its 3 partners provide details on this.
In the 6.20 system it looks like you may either have to wrap the LUW in one RFC to be called as a Web Service, or use SAPRFC from PHP to make the calls.
Regards
JohnA
Thanks John for the pointer to ABAP Web Service Definition in Web AS 6.40:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webservices/... web service definition in web as 6.40.abst
ABAP Web Service Configuration in Web AS 6.40
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webservices/... web service configuration in web as 6.40.abst
and ABAP Web Service Virtual Interface in Web AS 6.40
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webservices/... web service virtual interface in web as 6.40.abst
A really nice set of simulations...
cheers,
Marilyn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.