This website is not affiliated with, sponsored by, or approved by SAP AG.

Why could not commit work with BAPIs

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, Gothmog, YuriT

Why could not commit work with BAPIs

Postby bcdev on Sun Jun 29, 2003 10:33 pm

I want to create a planned order with Bapi crontrol, but I could not commit the work in VB platform below:

Dim obapi As Object
Dim plnnd As Object
Dim oreturn As Object
Dim oheader As Object
Dim oconnection As Object
Dim myfun As Object
Dim obapiservice As Object

Private Sub Form_Load()
Dim x As String
Dim oFunc As Object
Dim SAPFunction As Object

Set obapi = CreateObject("SAP.BAPI.1")
Set oconnection = obapi.connection


obapi.connection.System = "DVP"
obapi.connection.client = "300"
obapi.connection.user = "titan"
obapi.connection.password = ""
obapi.connection.language = "zh"
oconnection.logon

Set plnnd = obapi.getsapobject("PlannedOrder")
Set obapiservice = obapi.getsapobject("BapiService")

Set oheader = obapi.DimAs(plnnd, "create", "HeaderData")

oheader.Value("pldord_profile") = "LA"
oheader.Value("material") = "000000004000000001"
oheader.Value("prod_plant") = "PL01"
oheader.Value("plan_plant") = "PL01"
oheader.Value("total_plord_qty") = "4"
oheader.Value("order_fin_date") = "20030801"

plnnd.Create headerdata:=oheader, return:=oreturn

obapiservice.TransactionCommit

x = oreturn.Value("message")

If x = "" Then
MsgBox "Transcation complete"
Else
MsgBox x

End If

End Sub
______________________________

Could anybody tell me how to resolve this problem?
Thanks in advance.

Titan

bcdev
 
Posts: 33
Joined: Mon Mar 31, 2003 8:35 pm
Location: China

Postby JL on Mon Jun 30, 2003 3:36 am

See the Bapi documentation (SE37).
Don't you have to use 'BAPI_TRANSACTION_COMMIT' ?

JL
JL
 

Postby VenuKoganti on Mon Jun 30, 2003 7:44 pm

verify your assumption of x being space when transaction is successful.
thanks,
Venu
VenuKoganti
 
Posts: 185
Joined: Mon Nov 18, 2002 10:15 am

Postby bcdev on Mon Jun 30, 2003 7:51 pm

Thanks for your replay.
Need I call SAP function "BAPI_TRANSACTION_COMMIT"? Why not to use
bapiservice.TransactionCommit?


Thanks in advance.
bcdev
 
Posts: 33
Joined: Mon Mar 31, 2003 8:35 pm
Location: China

Postby bcdev on Mon Jun 30, 2003 10:17 pm

I have resolved this problem. I made a mistake in debugging the program,
the method BapiService.TransactionCommit could commit work.
bcdev
 
Posts: 33
Joined: Mon Mar 31, 2003 8:35 pm
Location: China


Return to ABAP

Who is online

Users browsing this forum: No registered users and 7 guests



This website is not affiliated with, sponsored by, or approved by SAP AG.