on 09-25-2009 5:22 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.