on 01-05-2007 10:47 AM
Hi,
In my Component Controller > Implementation >
in the method executeBapi_MYBAPI_Input( )
i write this code:
String s_nom_deb = "BT*"
String s_nom_fin = "BV*"
nom_deb.setUname(s_nom_deb);
nom_fin.setUname(s_nom_fin);
wdContext.currentBapi_MYBAPI_InputElement().modelObject().setNom_Start(nom_deb);
wdContext.currentBapi_MYBAPI_InputElement().modelObject().setNom_End(nom_fin);
wdContext
.currentBapi_MYBAPI_InputElement()
.modelObject()
.execute();
wdContext.nodeOutput().invalidate();
and IT WORKS.
but i want value "BT" and "BV" became from inputfield,
but when i replace by:
wdContext.nodeNom_Start().currentNom_StartElement().getUname();
and wdContext.nodeNom_End().currentNom_EndElement().getUname();
it doesn't work.
how can i retrieve the value from my 2 inputfields ?
what sould i verifie in "mapping" ?
Regards,
Phoenix
Hi ,
Take two value attributes of type string and map them to ur input fileds.
now ur code will be,
nom_deb.setUname(wdcontext.currentcontextelement.getS_nom_deb);
nom_fin.setUname(wdcontext.currentcontextelement.getS_nom_fin);
and try to execute the BAPI.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
upper/lower case problem which cause errors in BAPI execution (from the beginning, model mapping/binding, context mapping was good)
Message was edited by:
phoenix leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi phoenix leo ,
Declare all ur value attrobutes and then map them to the Views. Now try accessing the elements.
Regards,
Jhansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks Jhansi, but i've ever done that before.
my problem is that i can access to my inputfield in my ResultView with
wdThis
.wdGetListUserComponentController()
.wdGetContext()
.currentContextElement()
.getUsername();
but not in my ListUserComponent with
wdContext.currentContextElement().getUsername();
😕
Hi,
Let me know these context attributes are in component or in view
|->Nom_End----
>Nom_End
|->Nom_Start----
>Nom_Start
I think these fileds generalled model node value attributes getting from component controller only.
But input should be passed only thru View only for that sake u need to context mapping the conroller (end and start value attributes) to your View where u pass the input.
I think these two input value attributes values only input for the BAPI.
Otherwise explain your flow once agin we will solve your problem.
Thanks,
Lohi.
hi,
i've try an other things,
in my Component Controller
in my metho executeBapi_MYBAPI_Input()
i write
<b> wdContext.currentContextElement().setUsername("BT*");
wdContext.currentContextElement().setUsername_end("BV*");</b>
s_nom_deb = wdContext.currentContextElement().getUsername();
s_nom_fin = wdContext.currentContextElement().getUsername_end();
and IT WORKS
of course, the code in bold is made "manually" but it confirm that the code
wdContext.currentContextElement().getUsername()
is empty !!!
but i don't know why ???
hi,
is anybody know how i can access, in my componenet controller, an element which is in the StartView ?
For example, in the Context of the StartView, if i define a Value Attribute "<b>va_foo</b>".
In my Component Controller, can i access it by
wdContext.currentContextElement().getMap_va_foo();
<u>Informations</u>:
Context mapping between StartView and my Component Controller is
<b>va_foo -
>Map_va_foo</b>
StartView -> Layout : value of inputfield : <b>va_foo</b>
Hi ,
Create a value attribute in controller with same name as it in view ,
now go to your view context , right click on value attribute , select edit context binding and select the value attribute which u created in controller .
now u can access it in controller as .....
wdContext.currentContextElement().getMap_va_foo();
Thanks,
Sunitha
Declare two value attributes binding with input field and those are like variables one and two
simply u can add like this.
wdContext.currentBapi_MYBAPI_InputElement().modelObject().setNom_Start(wdContext.currentContextelement.getOne());
wdContext.currentBapi_MYBAPI_InputElement().modelObject().setNom_End(wdContext.currentContextelement.getTwo());
it might helps you.
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Phoenix,
Declare two value attributes (ex: a and b) and map them to your input fields.
Now get the values of input fields:
String s_nom_deb = wdContext.currentContextElement().getA();
String s_nom_fin = wdContext.currentContextElement().getB();
Now set them to
wdContext.currentBapi_MYBAPI_InputElement().setNom_Start(s_nom_deb); wdContext.currentBapi_MYBAPI_InputElement().setNom_End(s_nom_fin);
and call <b>executeBapi_MYBAPI_Input( )
</b> method.
And dont put the code executeBapi_MYBAPI_Input( ) method put it in Button action or where ever you want.
Regards,
Jhansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i try to move this part of the code in the WdInit but whitout success...
String s_nom_deb = wdContext.currentContextElement().getA();
String s_nom_fin = wdContext.currentContextElement().getB();
nom_deb.setUname(s_nom_deb);
nom_fin.setUname(s_nom_fin);
wdContext.currentBapi_MYBAPI_InputElement().modelObject().setNom_Start(nom_deb);
wdContext.currentBapi_MYBAPI_InputElement().modelObject().setNom_End(nom_fin);
Hi ,
your code
<b>String s_nom_deb = wdContext.currentContextElement().getA();
String s_nom_fin = wdContext.currentContextElement().getB();
nom_deb.setUname(s_nom_deb);
nom_fin.setUname(s_nom_fin);
wdContext.currentBapi_MYBAPI_InputElement().modelObject().setNom_Start(nom_deb);
wdContext.currentBapi_MYBAPI_InputElement().modelObject().setNom_End(nom_fin);
</b>
should be in executeBapi_MYBAPI_Input( ) method.
try this...
hi sunitha,
that's exactly what i've done but without success...
and my inputfiled are nice mapped as i can access it in my <b>ResultView</b>
with :
nom_user =
wdThis
.wdGetListUserComponentController()
.wdGetContext()
.currentContextElement()
.getUsername();
but in my <b>listUserComponent</b>,
with this code :
String s_nom_deb = wdContext.currentContextElement().getA();
i can't retrive the data of the inputfield
Hi ,
i think the problem is with ur value attributes mapping..
value attribute of view is not mapped to value atribute on the controller.
right click on the value attribute in view , select edit context mapping and map it to the value attribute in controller.
hope this will solve ur problem....
hi,
here are some explanations wich can be helpful:
when i double click on the link (between my StartView and my Component Controller) in my Data Modeler, i can see:
SartView ListUserComponent
Context Context
Bapi_MYBAPI_Input----
>Bapi_MYBAPI_Input
|->Nom_End----
>Nom_End
|->Nom_Start----
>Nom_Start
Name----
>Username
Name_End----
>Username_End
but may be that it should be,
Name(which is mapp to inputfield in StartView)----
>Nom_Start
Name_End(which is mapp to inputfield in StartView)----
>Nom_End
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.