on 09-02-2004 4:40 PM
Hy All,
we want to update a single dataset in a Backend-System over a RFC-Call. The input parameter of the RFC is only a table, no additional input-fields are neccessary.
From our WebDynpro the context of the view is mapped to the CustomController. The CustController is bind to the Model. (Input -> Table)
When we debug the application, on the WebDynpro-Side the Structure (Input -> Table) is filled. The current Node-Element is ok, i Think. On the ABAP-Side the RFC is callend, but the table is empty.
// fill fields of Z_TEST_HEADER
wdContext.currentZ_TEST_HEADERElement().setTest("1234567890");
// Calls remote function module Z_TEST wdContext.currentZ_TEST_INPUTElement().modelObject().execute();
Where is our fault ?
How do i have to fill or map the context of the Controller to the model ?
by Jürgen Berndt
Hi All,
Probably the issue is with the Transation management at the abap side. Some times it so happens that the values will be there in the node but while comiting the transation the bapi is not construted to do the transation well. this is just my perception.
Arun.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If your requirement is : sending table as input to BAPI and execute...
this will solve your problem
public void wdDoInit()
{
//@@begin wdDoInit()
Ybapi_Srma_Returns_Input input = new Ybapi_Srma_Returns_Input();
wdContext.nodeYbapi_Srma_Returns_Input().bind(input);
wdContext.currentYbapi_Srma_Returns_InputElement().setTable(table);
http://a setter method will come if you have a table as a importing parmater inthe model that you are using.
wdContext.currentYbapi_Srma_Returns_InputElement().modelObject().execute();
//@@end
}
check this links too..
regards,
Pradeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jürgen,
I am currently facing the same issue you posted here, can you help me out with your solution?
Thank you,
Jonathan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jürgen,
you didn't post all the code involved, therefore I can only guess...
Probably, you have not added the modelObject "Z_TEST_HEADER" of the newly created element to the modelObject of the Input Element "Z_TEST_INPUT".
Try the following:
wdContext.currentZ_TEST_INPUTElement().modelObject().setZ_TEST_HEADER(wdContext.currentZ_TEST_HEADERElement().modelObject)
This is only to see if it solves your problem.
In general, I would recommend creating, adding, and deleting objects directly in the model layer, and not in the context layer. The code is shorter and easier to understand. In addition, you must look at the context as being a view into the model. Keeping the context synchronized with the model is not always automated. Whenever you change relations (add an element in a table or add a structure) you must notify the context, that the model has been changed:
wdContext.nodeZ_TEST_HEADER().invalidate();
Ciao, Markus
PS: I'm not sure where a Table comes into play. The code you posted is only a single structure (1:1) not a table (1:N). Perhaps I misunderstood?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.