2008 Jan 19 3:54 AM
Hi Experts
I am new to BAPI, my requirement is to create sales order in SAP through VB.
Please provide me the BAPI coding part which are needed and also suggest me the steps to be followed in SAP and VB.
Thanks in advance.
Regards
Rajaram
http://www.sap-img.com/fu036.htm
http://sap.ittoolbox.com/groups/technical-functional/sap-log-sd/bapi-sales-order-creation-609666
http://www.erpgenie.com/abap/bapi/example.htm
http://www.erpgenie.com/sapgenie/docs/BAPI%20JCO.pdf
http://www.sap-img.com/abap/bapi-step-by-step-guidance.htm
Vinodh Balakrishnan
2008 Jan 19 4:06 AM
Try using the IDoc Concept for creating the Sales Order through VB.
http://www.allsaplinks.com/idoc_sample.html
For creating sales documents (sales order) through IDOCS you will have to use the T code WE19. In that click basic type and enter order05(IDOC type) and select via message type then enter ORDERS(message type), click execute.
You will get to see many fields.here you have to enter the datas that you enter in the VA01 screen in order to create sales order. The datas such as material name, date, qty, P.O no etc. After entering all the datas, you click standard inbound the IDOC would be created by the system.You can see the created order by going in to VA03 screen.
Next time when you create the IDOC, in same tcode WE19 screen, click existing IDOC and enter the IDOC which you created in the above step and just change the P.O no.Sytem will create new sales order through new IDOC
Before doing all you need to maintain the partner profile in T code WE20. For this Discuss with EDI consultant.
Regards.
2008 Jan 19 4:18 AM
Hi Prakash
My requirement is to develope by BAPI only,
can you pls suggest me on this.
Regards
Rajaram
2008 Jan 19 4:17 AM
RajaRam,
Find below a Link for SAP BAPI - VB Active X Interface .
http://blogs.ittoolbox.com/visualbasic/munk/archives/sap-bapi-activex-interface-19603
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
http://visualbasic.ittoolbox.com/groups/technical-functional/activex-l/sap-bapi-activex-1115312
Hope this helps
Vinodh Balakrishnan
2008 Jan 19 4:25 AM
http://www.sap-img.com/fu036.htm
http://sap.ittoolbox.com/groups/technical-functional/sap-log-sd/bapi-sales-order-creation-609666
http://www.erpgenie.com/abap/bapi/example.htm
http://www.erpgenie.com/sapgenie/docs/BAPI%20JCO.pdf
http://www.sap-img.com/abap/bapi-step-by-step-guidance.htm
Vinodh Balakrishnan
2008 Jan 19 4:38 AM
Hi Vinodh
thanks for your links, but still am not getting the exact coding part with clear guidelines.
Can you pls give me the coding part in VB and clear guidelines.
Regards
Rajaram
2008 Jan 19 4:51 AM
Hi Vinodh
I tried this coding as part of your link, but it contains Run-time error as Object Required.
Anything needs to be added in my VB Project, i have already added the BAPI ActiveX contol in my project.
Pls sugges me.
Dim boOrder As Object 'Business object SalesOrder
Dim oPartners As Object 'Parameter OrderPartners of BAPI method
Dim oHeader As Object 'Parameter OrderHeaderIn of BAPI method
Dim oItemsIn As Object 'Parameter OrderItemsIn of BAPI method
Dim oReturn As Object 'Parameter Return of BAPI method
Private Sub Form_Load()
'Connect to business object SalesOrder
'(this creates an anonymous object with an empty key field):
Set boOrder = oBAPICtrl.GetSAPObject("SalesOrder")
'Get structure/table objects:
Set oPartners = oBAPICtrl.DimAs(boOrder, "CreateFromData", "OrderPartners")
Set oHeader = oBAPICtrl.DimAs(boOrder, "CreateFromData", "OrderHeaderIn")
Set oItemsIn = oBAPICtrl.DimAs(boOrder, "CreateFromData", "OrderItemsIn")
'Fill header:
oHeader.Value("DOC_TYPE") = "TA" 'Standard order
oHeader.Value("SALES_ORG") = "0001" 'Sales organization
oHeader.Value("DISTR_CHAN") = "01" 'Sales channel
oHeader.Value("DIVISION") = "01" 'Division
oHeader.Value("PO_NUMBER") = "" 'Customer purchase orderNumber
oHeader.Value("PRICE_DATE") = Now 'Date
'Fill partners:
oPartners.Rows.Add
oPartners.Value(1, "PARTN_ROLE") = "AG" 'PartnerRoll: Person posting the order
oPartners.Value(1, "PARTN_NUMB") = "0000010096" 'Customer number
'Fill items:
oItemsIn.Rows.Add
oItemsIn.Value(1, "REQ_QTY") = "0000000010000" 'Quantity
oItemsIn.Value(1, "MATERIAL") = "BERLINER" 'Product ID
oItemsIn.Value(1, "COND_VALUE") = "1432" 'Rate
'Call the method:
boOrder.CreateFromData OrderHeaderIn:=oHeader, _
OrderPartners:=oPartners, _
OrderItemsIn:=oItemsIn, _
Return:=oReturn
'Free the business objects:
Set boOrder = Nothing
End Sub
Regards
Rajaram
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |