cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Order Creation Using Web Dynpro java

Former Member
0 Kudos

hi

i am new to webdynpro java.

Can anybody provide me the solution for creating sales order using bapi's .if possible with code snippets

if possible pls provide me some links for this.

Regards

kiran

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi kiran_mareedu,

To create sales Order use bapi Bapi_salesorder_createfromdat2.

Consume this Bapi in webdynrpo using Adfaptive RFC Model.

Bind the appropiate context like Header , Items..to component controller and to view.

Pass the input values and execute the bapi.

Go thorugh the Article which descibes step by step procedure to consume bapi into Webdynpro

[Article|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a00f7103-6790-2a10-ac9c-fcac7c5b18a3&overridelayout=true]

Revert back if you have any furthur queries

Regards,

Srikanth

Former Member
0 Kudos

hi,

i imported the bapi u mentioned in to model , i selected service context mapping ,ans i mapped the parametrs to view

and i added submit button to that view and added the following code

public void onActionsubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionsubmit(ServerEvent)

wdThis.wdGetSalesorderController().executeBapi_Salesorder_Createfromdat2_Input();

//@@end

}

but its not working

Regards

kiran

Former Member
0 Kudos

Hi Kiran,

These are the mandatory fields to create sales order. While Service Context Mapping you select these fields and bind these attributes to input fields.

Order_header_in

Doc_type

Sales_org

Distr_chan

Division

Incoterms1

Pmnttrms

Order_items_in

Material

Plant

Target_qty

Target_qu

Gross_wght

Net_weight

Untof_wght

Ship_point

Order_partners

partn_role

Partn_numb

Order_schedules_in

Itm_number

Sched_line

Req_Date

Req_qty

Regards,

Sunaina Reddy T

Former Member
0 Kudos

hi Sunaina Reddy ,

i binded the parameters u mentioned in the view.

and i run the application,but the entire screen is in disable. i am unable to enter the values in to those fields u mentioned.

Regards

kiran

Former Member
0 Kudos

These fields are only disabled when they are not properly initialized or bound. Go through the guide again and see how these nodes are initialized.

Regards,

Jan

Former Member
0 Kudos

Hi kiran,

write this code in wdDoInit(), input fields will be enabled.

Bapisdhd1 head=new Bapisdhd1();

IPrivate<viewname>.IOrder_Header_InElement ele=wdContext.createOrder_Header_InElement(head);

wdContext.currentBapi_Salesorder_Createfromdat2_InputElement().modelObject().setOrder_Header_In(head);

Regards,

Sunaina Reddy T

Former Member
0 Kudos

hi

i crated component controller and i selected apply template in that i selected service controller and selected the bapi and required parameters.

then i created a view and did context mapping for the parameters u provided .

and created submit button.

and added following code for onaction submit:

wdThis.wdGetSalesorderController().executeBapi_Salesorder_Createfromdat2_Input();

wdThis.wdGetSalesorderController().executeBapi_Transaction_Commit_Input();

this is what i did in my application.

i tried the code u provided in the implementation of component controller but its throughing nullpointer exception

Regards

kiran