on 11-23-2009 6:22 AM
Dear all,
ter cal
iam working on webdynpro for java i want simple code for EDIT and SAVE after calling a rfc in for using NWDS webdynpro for java.
1)HOW TO SAVE AND EDIT THE FRONT WEBDYNPRO FOR JAVA APPLICATION
2)AFTER SAVING AND THE DATA THAT SHOULD BE SAVED IN PA30 ARE PA20 AND IN PARTICULAR TABLE ALSO.
PLEASE GIVE ME GOOD TIPS.
Hi Kishore,
Creating/Updating entries in tables through Bapis (RFC calls) work in the same way as it is done for other Bapis like those for returning values or even structures. All you have to do is
1. Import the model, create a model node in your context and bind it to the Input structure of the model under used models.
2.Create an istance of the Model input structure, like
Z_Test1_Input input = new Z_Test1_Input();
3. Set attibutes directly under the input structure
input.setAttr1("XYZ");
4. Set attributes under any other structure under Input Structure by first creating the instance of the sub-structure
Z_SubStruct1 subStrc1 = new Z_SubStruct1();
subStrc1.setSubAttr1("ABC");
5. Add all available instances of sub-structures to the instance of input structure
input.set<SubStruct1>(suStrc1);
6. Add all available instances of tables under Input Structure after setting attributes within using
for (int iCount = 0; iCount < wdContext.nodeVn_ContactInfo().size(); iCount++) {
Z_Table1 zTable1 = new Z_Table1();
IPublic<YourComponent>.IVn_Table1Element tab1Ele = wdContext.nodeVn_Table1().getVn_Table1ElementAt(iCount);
zTable1.set<TableAttr>(tab1Ele .getVa_Attr1());
input.add<Table1>(zTable1);
}
7. Bind the instance of input structure to the model node.
wdContext.nodeMn_TestModel().bind(input);
8. Execute the model object and then invalidate the output structure under model node (Put this code in try catch block)
wdContext.currentMn_TestModelElement().modelObject().execute();
wdContext.nodeMn_TestModel().nodeOutput().invalidate();
9. Retrieve values from the attributes, tables and structures under the Output Node of the Model Node (Mn_TestModel) as usual
and store wherever in context as required. In case of output tables, you need to use FOR loop to iterate through the tables and access elements within using index (using wdContext.node<YourRequiredNode>().get<YourRequiredNode>ElementAt(int index)).
Hope it is helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.