on 07-07-2011 10:26 AM
Hi guys,
i have some basic doubt.
In my screen, i have several input fields, it will contain employee personal information like PAN number, address..
Once employee access the application, he will get his information in display mode, there he can edit the value by clicking on edit button and can update it.
If employee dont have prior information, application throwing dump like
"Adapter error in &VIEW_ELEMENT_TYPE& "TC1_A_PANNO" of view "ZCOMP_EPI.VMAIN": Context binding of property VALUE cannot be resolved: Node VMAIN.1.N_PER5 does not contain any elements "
So how can we avoid dump, if employee dont have prior information?
FYI: i am displaying information in input fields in display mode ( readonly ), once he click on edit button, it will enable.
Regards
Srinivas
IF LO_EL_N_PER5 IS not INITIAL.
LO_EL_N_PER5->SET_ATTRIBUTE(
EXPORTING
NAME = `PANNUM`
VALUE =lv_value ).
ENDIF
if element is intial and if you are trying to bind it, it will go for a dump.
if it is initial, you can create element and then bind with 'no value found'.
try this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Srinivas,
what I understood from the dump is that you are trying to bind the first element (VMAIN.1.N_PER5) attributes to the inputfields.
Since your node cardinality is 0..1, can you try bninding like VMAIN.N_PER5. I assume VMAIN is your parent node and not the Root Context.
BR, Saravanan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lekha,
I replaced input field with TEXT view.
in wddoint method, I did like ...
If itab is not initial...
then i bind the itab to the node
else
manually I set the value for that attribute.
LO_EL_N_PER5->SET_ATTRIBUTE(
EXPORTING
NAME = `PANNUM`
VALUE = 'LV_PANNUM' ).
endif.
Now, it is throwing dump like "Access via 'NULL' object reference not possible. " I check in st22 , it showing error in
LO_EL_N_PER5->SET_ATTRIBU......... statement. I declared everything. i dont where it goes wrong.
Regards
Srinivas
You didnt check whether the element reference is initital or not...TEXT VIEW should be bound to some string attribute..
pass the value as 'NO VALUE FOUND' or any meesage..bind this attribute to TEXT_VIEW and set teh visibility as TRUE and for input field SET the VISIBILITy as false...and donot show.
IF LO_EL_N_PER5 IS NOT INITIAL.
ENDIF.
Have you used the code wizard...have you decalred the new context attribute undre any node or directly under the root node..
Check the cardinality of the Node..
Can you paste the etnire code starting from the node being read..
If you find that element object (LO_EL..) is initial then you cannnot access the method...NULL OBJECT reference is thrown..
LO_EL = LR_NODE->get_element (). "What have you specified here...
For my simplification, I remove the input field and replace with TEXT view, binded with attribute which is available under node n_per5.
under this node only attribute is there.
DATA LO_ND_N_PER5 TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_N_PER5 TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_N_PER5 TYPE WD_THIS->ELEMENT_N_PER5.
navigate from <CONTEXT> to <N_PER1> via lead selection
LO_ND_N_PER5 = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_N_PER5 ).
IF PTAB5 IS NOT INITIAL.
get element via lead selection
LO_ND_N_PER5->BIND_TABLE( PTAB5 ).
else.
@TODO handle not set lead selection
IF LO_ND_N_PER5 IS INITIAL.
ENDIF.
get element via lead selection
LO_EL_N_PER5 = LO_ND_N_PER5->GET_ELEMENT( ).
@TODO handle not set lead selection
IF LO_EL_N_PER5 IS INITIAL.
LO_EL_N_PER5->SET_ATTRIBUTE(
EXPORTING
NAME = `PANNUM`
VALUE = 'NO VALUE FOUND' ).
ENDIF.
ENDIF.
Now throwing null object error at set_sttribute statement found using ST22.
Thanks and Regards
Sriniva
what is the cardnaltiy fo this context node..I guess it must be 0:N or 1:N...As you are using a BIND_TABLE statement..
And you are checking that internal table is initial or not and biding the table to node..
But for some TEXT VIEW you can create a context attribute and bound this...Have you created some toher node or directly created in the same Node..If you ahve created it under the same node..then...your coding is incorrect.
One thing you do..create a context attribute under the root node...abnd bind this to TEXT_VIEw..and set the value...
TEXTVIEW always hold a single value...
Hi Srinivas,
Instead of dump if you want you can report your own messages. that part only you can do.
Like if element is initial - display some mesage.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kris,
In the initial screen I am displaying information like address deatils, communication details, which i fetched from several info types.
My application is Employee should be able to see what all the info available right now, if he want to update he can update there.
In screen if only some fields dont have data, we cant throw message na...
Regards
Srinivas
check whether the node has 0 to 1 cardinality.
in the code, while reading the prior information check whether it has successfully returned the value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.