cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_SALESORDER_GETLIST Problem

Former Member
0 Kudos

I am unable to understand whats going wrong, when I runs BAPI BAPI_SALESORDER_GETLIST from SAP Frontend with parameters

CUSTOMER_NUMBER = "9994310"

SALES_ORGANIZATION = "3000"

MATERIAL = ""

DOCUMENT_DATE = ""

DOCUMENT_DATE_TO = ""

PURCHASE_ORDER = ""

TRANSACTION_GROUP = "0"

PURCHASE_ORDER_NUMBER = ""

It gives me 5 results in to SALES_ORDER table, but when I passes same parameter to this BAPI via .Net application it gives me 0 records in the SALES_ORDER table.

I tried passing DOCUMENT_DATE, DOCUMENT_DATE_TO in yyyyMMdd format in .net still no result.

Here is my .Net source code.

Dim conn As String = ConfigurationSettings.AppSettings("SAPConnectionString")

SalesOrder1.ConnectionString = conn

Dim vBAPIReturn As New SAP.Connector.BAPIRETURN

Dim sales_Orders As New BAPIORDERSTable

SalesOrder1.GetList("9994310", "", "", "", "", "", "3000", "0", vBAPIReturn, sales_Orders)

DataGrid2.DataSource = sales_Orders.ToADODataTable

DataGrid2.DataBind()

What could be possible reason?

Help will we greatly appriciated.

Regards,

Nitin

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

A little more info on this topic after I struggled with it also...

Here is some sample code that works:

SalesOrder proxyorders= new SalesOrder(SAPConnString);

BAPIRETURN Return0=new BAPIRETURN();

BAPIORDERSTable Sales_Orders=new BAPIORDERSTable();

proxyorders.GetList(null, null, null, strDate, null, null, null, null, out Return0, ref Sales_Orders);

-


Note that arguments to the BAPI call must be null - not "*" as described elsewhere in these threads.

This call allows you to get all customer orders for a date in the form of a strongly-typed Sales_Orders object.

Any argument in the BAPI call can be null.

With this information you can then also get specific customer details with another BAPI call:

string strSalesOrg = Sales_Orders[c].Sales_Off;

string strCustomerID = Sales_Orders[c].Sold_To;

Customer proxycustomer = new Customer(SAPConnString);

BAPIRETURN Return1=new BAPIRETURN();

BAPIKNA101 Customer_Details = new BAPIKNA101();

proxycustomer.GetDetail(strSalesOrg,out Customer_Details,out Return1,null,null,null,strCustomerID);

Took me a bit to sort it out but hope it helps...

Former Member
0 Kudos

Thanks guys, your inputs helped me to get rid of this problem.

Customer Number is 10 char field I just provided some zeros previous to my customer nuumber and got the result.

reiner_hille-doering
Active Contributor
0 Kudos

I think this thread and the referenced one can help you:

BTW: Better databind the SAP table directly instead of converting it to a DataTable:

DataGrid2.DataSource = sales_Orders

Former Member
0 Kudos

The customer number is defined as 10 characters. You can check this in se37, look at the function module, look at the input... So unlike the Sap Gui which adds the extra characters, you pass these characters.. I had to zero fill the customer number to get it to work.