on 08-14-2008 11:28 AM
Hi All,
I need help solving the following problem. My Context looks as follows:
Context
-> Z_Customer_Front_Controller_Input
-->I_Customer
---> value1
---> value2
---> value ...
-> Z_Read_Infoobject_Input
--> Output
---> E_Customer
-
> value1
-
> value2
-
> value ...
for( int i=0; i < wdContext.nodeE_Customer().size(); i++ ){
wdContext.currentI_CustomerElement().set__Bic__Epskufuer(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Epskufuer());
wdContext.currentI_CustomerElement().set__Bic__Rbampisbr(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbampisbr());
wdContext.currentI_CustomerElement().set__Bic__Rbwwrpnkz(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbwwrpnkz());
wdContext.currentI_CustomerElement().setChanged(wdContext.nodeE_Customer().getE_CustomerElementAt(i).getChanged());
// etc....
}
This code leads me to a single object being filled into the context, namely the last one in the list...
But I need all of them. I guess I need to add coding similar to
wdContext.nodeI_Customer().addElement(??);
but i just don't get it running...
Please help! I am desperate!!
Thanks, Johannes
if I_Customer can have 0..n instances, you can go for instantiating it and bind to parent node.
e.g.
I_Customer customer;
for(int i=0; i < wdContext.nodeE_Customer().size(); i++ ){
customer = new I_Customer(//new Model Object()); customer.set__Bic__Epskufuer(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Epskufuer());
customer.set__Bic__Rbampisbr(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbampisbr());
customer.set__Bic__Rbwwrpnkz(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbwwrpnkz());
customer.setChanged(wdContext.nodeE_Customer().getE_CustomerElementAt(i).getChanged());
wdContext.nodeI_Customer().bind(customer);
}
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I need to get this running.
I have tried
customerElement = wdContext.nodeI_Customer().createAndAddI_CustomerElement();
leads me to
com.sap.tc.webdynpro.progmodel.context.ContextException:
NodeElement(.InfoObjectCust.Z_Customer_Front_Controller_Input):
model node element cannot be created without a model instance
the function
customerElement = wdContext.nodeI_Customer().createI_CustomerElement();
does not exist in 7.1.
customer = new I_Customer(//new Model Object()); ...
does not work for me neither...
Does Anybody have another idea?
Pleaede help, I am working on this since days and I NEED to get it working!! Thanks, Johannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Allright Buddies, I got I...
here my coding for 7.1...
public void onActionValidateChangesCustomer(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionValidateChangesCustomer(ServerEvent)
for( int i=0; i < wdContext.nodeE_Customer().size(); i++ ){
wdContext.currentI_CustomerElement().set__Bic__Epskufuer(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Epskufuer());
wdContext.currentI_CustomerElement().set__Bic__Rbampisbr(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbampisbr());
wdContext.currentI_CustomerElement().set__Bic__Rbbrand(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbbrand());
wdContext.currentI_CustomerElement().set__Bic__Rbcustgrp(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbcustgrp());
wdContext.currentI_CustomerElement().set__Bic__Rbgroup(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbgroup());
wdContext.currentI_CustomerElement().set__Bic__Rbkunde(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbkunde());
wdContext.currentI_CustomerElement().set__Bic__Rbprod(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbprod());
wdContext.currentI_CustomerElement().set__Bic__Rbsubgrp1(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbsubgrp1());
wdContext.currentI_CustomerElement().set__Bic__Rbsubgrp2(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbsubgrp2());
wdContext.currentI_CustomerElement().set__Bic__Rbwwrpnkz(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbwwrpnkz());
wdContext.currentI_CustomerElement().setChanged(wdContext.nodeE_Customer().getE_CustomerElementAt(i).getChanged());
wdContext.currentI_CustomerElement().setDatefrom(wdContext.nodeE_Customer().getE_CustomerElementAt(i).getDatefrom());
wdContext.currentI_CustomerElement().setObjvers(wdContext.nodeE_Customer().getE_CustomerElementAt(i).getObjvers());
wdContext.nodeI_Customer().addElement(new __Bic__Mrbkunde());
wdContext.nodeI_Customer().moveNext();
}
// trigger the RFC
wdThis.wdGetInfoObjectCustController().executeZ_Customer_Front_Controller();
//@@end
}
Thanks, Johannes
Hi ,
try the below code
II_CustomerNode i_CustomerNode=wdContext.nodeII_Customer();
II_CustomerElement i_CustomerElement
for( int i=0; i < wdContext.nodeE_Customer().size(); i++ ){
i_CustomerElement = wdContext.nodeI_Customer().createI_CustomerElement()
i_CustomerElement .set__Bic__Epskufuer(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Epskufuer());
i_CustomerElement .set__Bic__Rbampisbr(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbampisbr());
i_CustomerElement .set__Bic__Rbwwrpnkz(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbwwrpnkz());
i_CustomerElement .setChanged(wdContext.nodeE_Customer().getE_CustomerElementAt(i).getChanged());
// etc....
wdContext.nodeII_CustomerNode().addElement(i_CustomerElement);
wdContext.nodeII_CustomerNode().moveNext();
}
Thanks,
Ramesh.
Edited by: Ramesh Babu V on Aug 14, 2008 4:27 PM
Edited by: Ramesh Babu V on Aug 14, 2008 4:34 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I adapted my coding to:
II_CustomerNode customerNode = wdContext.nodeI_Customer();
II_CustomerElement customerElement;
for( int i=0; i < wdContext.nodeE_Customer().size(); i++ ){
customerElement = wdContext.nodeI_Customer().createI_CustomerElement(new __Bic__Mrbkunde());
//customerElement = wdContext.nodeI_Customer().createAndAddI_CustomerElement();
customerElement.set__Bic__Epsflags(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Epsflags());
customerElement.set__Bic__Epskufuer(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Epskufuer());
customerElement.set__Bic__Rbampisbr(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbampisbr());
customerElement.set__Bic__Rbbrand(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbbrand());
customerElement.set__Bic__Rbcustgrp(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbcustgrp());
customerElement.set__Bic__Rbgroup(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbgroup());
customerElement.set__Bic__Rbkunde(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbkunde());
customerElement.set__Bic__Rbprod(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbprod());
customerElement.set__Bic__Rbsubgrp1(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbsubgrp1());
customerElement.set__Bic__Rbsubgrp2(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbsubgrp2());
customerElement.set__Bic__Rbwwrpnkz(wdContext.nodeE_Customer().getE_CustomerElementAt(i).get__Bic__Rbwwrpnkz());
customerElement.setChanged(wdContext.nodeE_Customer().getE_CustomerElementAt(i).getChanged());
customerElement.setDatefrom(wdContext.nodeE_Customer().getE_CustomerElementAt(i).getDatefrom());
customerElement.setObjvers(wdContext.nodeE_Customer().getE_CustomerElementAt(i).getObjvers());
wdContext.nodeI_Customer().addElement(customerElement);
wdContext.nodeI_Customer().moveNext();
This leads me to an empty list... Whats wrong?
you have to pass parent stuctures/model as parameters.
try crtl+space inside ( ) and you can easily pass parameter as new Z..( new..//your model());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.