on 06-22-2007 7:51 AM
Hi all,
I have a small doubt. In my application I have two screens.
1st Screen have the drop downs which will be populated by BAPIONE.
2nd Screen is having a table which will be populated by BAPITWO.
I am populating screen 1 with the help of BAPI ONE and after selecting the values in the dropdowns, these values in the dropdowns will go to input (import parameters) of BAPI TWO and screen will navigate to 2nd screen, where table should be populated by out put of BAPI TWO.
Now my doubt is, I am able to populate the drop downs, and getting the values of drop downs and setting it in ONACTION SEARCH() method (search is the button in first screen)
String str=wdcontext.currentXXX1.getXXX(); // getting the selected values from dropdown
wdcontext.currentXXX2.setXXX(str); //setting it to bapi 2 (table)
wdThis.wdgetXXcontroller.excuteXXX();
But I am not able to populate the table. Is it correct what I am doing? or else please guide me how to populate the table
Hi
1) Create a context mapping between view and component controller for value attribute XXX
2) In the controller
xx mthd
{
String getvalue=wdcontext.currentcontextelement.getXXX();
Z<bapi name> zb=new Z<bapi name>();
wdContext.nodeZ<bapi name>. bind(zb);
Zb.set<import parameters>=xxx;
.... execute the model
// codes for populating the data to the table from export
}
Thanks and Regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks guys,
As of now it is working fine with the same old code, may be there was no data in the BAPI 2 itself. So sorry for taking your precious time.
I am not closing the post now because i think I may need more clarifications on same issue in next 1-2 days. If it solved permanently then I will close the post and give rewards to you.
Thank you very much....
Hi Pradeep,
The getter and setter can be written in the component controller method just before executing the BAPI. domodifyview is for entirely different purposes.
Are you binding the model node directly to the table? If yes, you wont have to loop through for retreiving the values. Check the following:
1. Have you created element for the Node properly before executing the Bapi?
2. Have you invalidated the output node after executing the Bapi?
3. Have you missed any mandatory parameters for executing the particular Bapi?
You can also try to debug the application by inserting an external debugger in the particular RFC in the backend.
Add the following piece of code in the catch part of the method that executes the Bapi:
catch (WDDynamicRFCExecuteException ce) {
MessageManager manager = wdComponentAPI.getMessageManager();
IWD
manager.reportException(ce.getMessage(), false);
}
Regards,
Shyam.
problem was with BAPI data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pradeep,
According to context structure.
Bapi_Employee_Getdata_Input
|--- Output
| -
Personal_Data(under Output node )
|--- Employee_Id
Take a method say GetEmployeeDetailsByNo inside component controller with parameter empid of type string.
Use this implementation.
public void GetEmployeeDetailsByNo( java.lang.String empid )
{
//@@begin GetEmployeeDetailsByNo()
IWDMessageManager msg = wdComponentAPI.getMessageManager();
try {
Bapi_Employee_Getdata_Input input = new Bapi_Employee_Getdata_Input();
input.setEmployee_Id(empid);
wdContext.nodeBapi_Employee_Getdata_Input().bind(input);
wdContext.currentBapi_Employee_Getdata_InputElement().modelObject().execute();
wdContext.nodePersonal_Data().invalidate();
} catch (Exception e) {
// TODO Auto-generated catch block
msg.reportSuccess(e.getMessage());
e.printStackTrace();
}
//@@end
}
Now go to the view and bind the Model node (Bapi_Employee_Getdata_Input
) in the view layout.
And inside on action event of Searchbutton uses this code.
public void onActionGoEmpSearch(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionGoEmpSearch(ServerEvent)
wdThis.wdGetEmployeeCompController().GetEmployeeDetailsByNo(wdContext.currentBapi_Employee_Getdata_InputElement().getEmployee_Id());
//@@end
}
public void wdDoInit()
{
//@@begin wdDoInit()
Bapi_Employee_Getdata_Input bapiInput = new Bapi_Employee_Getdata_Input();
wdContext.nodeBapi_Employee_Getdata_Input().bind(bapiInput);
//@@end
}
Use the code according to your BAPI name.
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,
if u want to fire some value from 1 view to other view,u have to create parameter for particular outbound plug.....
for eg. u creating Value as parameter to outbound plug
write code like this,
wdThis.wdgetXXcontroller.excuteXXX(Value);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.