cancel
Showing results for 
Search instead for 
Did you mean: 

Executing BAPI through Webdynpro

Former Member
0 Kudos

Hi All,

i'm trying to use the Bapi BAPI_SALES_ORDER_FROMDATA1 from webdynpro. When i'm executing the bapi from webdynpro side its getting executed but its not giving the same set of values as output as it is giving from the R3 side for same input. I'll give the codesample that i'm using to pass value from webdynpro.

Bapi_Salesorder_Createfromdat1_Input inp = new Bapi_Salesorder_Createfromdat1_Input();

wdContext.nodeBapi_Salesorder_Createfromdat1_Input().bind(inp);

Bapisdhead bp = new Bapisdhead();

bp.setSales_Org("S100");

bp.setDistr_Chan("DS");

bp.setDivision("D1");

bp.setDoc_Type("OR");

inp.setOrder_Header_In(bp);

Bapiitemin itm = new Bapiitemin();

itm.setMaterial("BL8");

itm.setReq_Qty("12");

inp.addOrder_Items_In(itm);

Bapipartnr bpart = new Bapipartnr();

bpart.setPartn_Numb("2330");

bpart.setPartn_Role("SP");

inp.addOrder_Partners(bpart);

After this when i execute the rfc its giving me the message

"Sales document type OR is not defined"

But when i gave the same input from the R3 side it gave the output and a sales order got created .

hope you guys understood the scenario. Any sort of help is very much appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As a practice, whenever we import/reimport the BAPI, It would be good to restart the ep server. We faced this kind of situations. the problem is the cached data would be creating the problems.

Hope u r problem would be solved once u restart the server.

Thanks & Regards,

Raghavendra Pothula

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ragavendra,

Thanks for your reply,

i tried restarting the server. but again its showing the same output. i tried to exceute another Bpai dealing with sales order, BAPI_SALEORDER_SIMULATE. its also having the same problem.

regards,

rahul.

Former Member
0 Kudos

Hello Rahul,

Try to debug/ test what you are sending to the SAP R/3. Check the following:

1. Check if the input is going to the same R3 client? What I mean is : where you actually tried in R3 and see if WD also goes to the same client.

I did had this kind of problem (not the same Bapi though)and found out that the Jco connection that I had created was for different client, I created for 100 and it should have been 800.

Hope the above is clear.

Regards,

Dharmi