on 2010 Mar 27 1:18 PM
Hi Experts,
I have DC which needs to update backend table through RFC. In this RFC i have a structure in import tab which holds 2 fields.
From webDynpro Java code , i have to pass the those 2 fields as input before when i execute the model.
How can i write code for inputing the values for this structure fields ?
thanks in advance.
Regards,
suresh
Hello Suresh,
For passing the values to the import structure of an RFC,
You have to first import the RFC as a model to the web dynpro side and then it will create model nodes in the context.
Suppose your Model name is TestRFC having one import structure TESTSTR which has 2 fields Ta and Tb.
Then it will create a model node with the following structure.
-
Context
-
TestRFC_input (node)
-
TESTSTR (node)
-
Ta (attr)
-
Tb (attr)
-
then if you want to set the value of Ta and Tb write the following code before executing.
TSTR teststr = new TSTR(); //where TSTR is the reference type of structure TESTSTR
teststr.setTa("a");
teststr.setTb("b");
wdcontext.nodeTESTSTR.bind(teststr);
thanks ,
Sarbjeet Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh,
Steps to execute you Adaptive RFC Model:
1. Create an instance of the BAPI's input structure-
<Your BAPI Name>_Input input = new <Your BAPI Name>_Input();
2. Set the two input parameters to this input structure with desired parameter values-
input.set<Your Para 1>(<Desired Parameter Value>);
input.set<Your Para 2>(<Desired Parameter Value>);
3. Create and Bind a model node in context to the input structural node of Your BAPI using model binding. Now using code bind the instance of the input structute to the model nodel in conext as stated below-
wdConext.node<Your Custom created Model Node in Context>().bind(input);
4. Execute the model and invalidate the output node-
try{
wdContext.current<Your Model Node in Conext>().modelObject().execute();
wdConext.node<Output Node in the conext>().invalidate();
}catch(Exception){
}
5. Pick all the output parameters from the Output Node in the context.
Hope it helps!!
Regards,
Tushar S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
please refer the below pdf,
[http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/creating%20a%20web%20dynpro%20application%20accessing%20abap%20functions.pdf]
Regards,
ramesh
Edited by: Ramesh Babu V on Mar 29, 2010 11:05 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh
Create the structure obect and set input parameter and add to the model object before excuting your model.
it might you need to create abstruct object for your structure
Hope it helps
Regards
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.