on 10-20-2005 2:32 PM
Dear All,
I need to pass the the data from the input table of the webdynpro to IMPORT parameter of the RFC. Means i have an UI element(table) and if user enters entry,i have to pass them to my rfc so it can be taken to R/3. Can any body seuggest/send me the code??
Regards,
Anup.
Hi Anup,
There is a very similar thread at
Pasting the same reply here :
Assume that BAPI uses a table MyTable of some type 'ZTAB' .
<BAPI_name>_Input input = new <BAPI_name>_Input () // create an instance of the Input class;
ZTAB table = new ZTAB();
//if you do not know table type of 'MyTable , check the function 'input.add<MyTable> (<table type>)'
table.set<property1>(<your-value>);
.
.
table.set<propertyN>(<your-value>););
input.add<MyTable>(table);
wdcontext.node<BAPI_name>_Input().bind(input);
Now execute the BAPI using the following line
wdContext.current<BAPI_Name>_InputElement().modelObject().execute();
wdContext.nodeOutput.invalidate()
// clears the old value in the output node
So if you are reading the value from a value node you can change your code like :
Assume that BAPI uses a table MyTable of some type 'ZTAB' .
<BAPI_name>_Input input = new <BAPI_name>_Input () // create an instance of the Input class;
ZTAB table;
IPrivate<view>.I<table_node>Element elmt;
//if you do not know table type of 'MyTable , check the function input.add<MyTable> (<table type>)
for(int i=0;i<wdContext.node<table_node>().size();i++)
{
table = new ZTAB();
elmt = wdContext.node<table_node>().get<table_node>ElementAt(i);
table.set<property1>(elmt.get<corresponding property1>);
.
.
table.set<propertyN>(elmt.get<corresponding propertyN););
input.add<MyTable>(table);
}
wdcontext.node<BAPI_name>_Input().bind(input);
Now execute the BAPI using the following line
wdContext.current<BAPI_Name>_InputElement().modelObject().execute();
wdContext.nodeOutput.invalidate()
// clears the old value in the output node
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anup,
Sorry if I have been rude in my earlier posting. I was just pointing out the need to close the threads & award appropriate points.
I'm deleting my previous post and I am extremely sorry if I have hurt you. I didn't mean to do that
Do keep posting and let us all learn better !
Best regards,
Nibu.
hi anup,
to do that u need to do the following..
1. import the BAPI
2. get into the code of action handler
3. create the input node say..
Z_XXXX_Input xyz=new Z_XXX_Input();
4. this is the node which we would get once u import the BAPI.
5. now add the values which u need to execute the BAPI. ex. xyz.setVBLEN("XCXC");
xyz.addKunnrTable(kunnrtable);
6. now call the following code
wdcontext.nodeZ_XXX_Input().bind(xyz);
wdcontext.currentZ_XXX_InputeElement().modelobject.execute();
7. so for the table data you need to put line 5.
8. say i have a table of employee UI Table with coloumns name, empid
9.
Zsv_EmpTable emptable=new Zsv_EmplTable();
for (int i=0;i<wdContext.nodeEmployees().size;i++) {
emptable.setEmpName(wdcontext.nodEmployees().getEmpoyeesAt(i).getName();
emptable.setEmpId(wdcontext.nodEmployees().getEmpoyeesAt(i).getId();
}
now add the input parameter like table/values to the input node of BAPI.
Call the Bind();
call the execute();
Thanks & Regards,
Raghavendra Pothula
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.