on 08-22-2007 7:00 PM
Hi Experts,
I have made a application in the webdynpro for java.
I uesd BAPI_SALESORDER_GETLIST , and i have selected filds as
1-Customer Name
2-Sales Organisation
when i depoly my application i got connected but my input field for customer name and sales orga is inactive thta time (<b>I have given hardcoded</b> ) , when i click button i got the result with out putting and input.
I have given hardcoded to get the result and i m getting the list with the defined user as
<b>public void Bapi_Salesorder_Getlist( )
{
//@@begin Bapi_Salesorder_Getlist()
Bapi_Salesorder_Getlist_Input bapi_obj = new Bapi_Salesorder_Getlist_Input ();
wdContext.nodeBapi_Salesorder_Getlist_Input(). bind(bapi_obj);
try{
bapi_obj.setCustomer_Number("0000000001");
bapi_obj.setSales_Organization("0001");
bapi_obj.execute();
wdContext.nodeOutput().invalidate();
}
catch (Exception e)
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(e.toString());
e.getStackTrace();
}
//@@end</b>
Now , I want that i give any customer name like 2,3,4 , and i got the desired result.
so, where should i do the coding and what shoul be the coding as I have not the Java Background.
Thanks & regards,
Iqbal Ahmad
Hi Iqbal,
May be data is not available for the sales organization0001 and Customer Number 0000000001. Go to the ECC System that you are using and execute your BAPI from there in result you will see 0 entries if no data available. You can try this with
Customer Number : 100010
And Sales_Organization : BB02
public void Bapi_Salesorder_Getlist( )
{
//@@begin Bapi_Salesorder_Getlist()
Bapi_Salesorder_Getlist_Input bapi_obj = new Bapi_Salesorder_Getlist_Input ();
wdContext.nodeBapi_Salesorder_Getlist_Input(). bind(bapi_obj);
try{
bapi_obj.setCustomer_Number("100010");
bapi_obj.setSales_Organization("BB02");
wdContext.currentBapi_Salesorder_Getlist_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
}
catch (Exception e)
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(e.toString());
e.getStackTrace();
}
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Iqbal,
First in order to bind your context to UI element so that they are not in the disabled state you need to change the cardinality of the input node from 0:n to 1:n and then bind those context values to your UI elements.
The values that you have hard coded below will now be taken from what you have entered in the text box.
Rest of the procedure that you follow remains the same.
Just comment those 2 lines where you are setting the values once you follow the above steps.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Please use get insread of set in getting value of context element.
Regards,
sid.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Iqbal,
U can pass user dynamic values in the bapi follow these steps .
1.according to your requirement create input boxes . set the properties .
2. create context elements of type string or int (according to your requirement).
3.Bind the context elements to input boxes by setting the Value attribute in the properties of input boxes.
4.and now u can pass the value like this.
bapi_obj.setCustomer_Number(wdContext.currentContextElement().set<contextelementname>);
Regards,
Siddharth
Message was edited by:
Armin Reichert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.