on 10-30-2009 12:47 PM
Hi All,
I am new to this ABAP WebDynpro programming, i have requirement, based on IF conditions i need to set my fields In-Visible and Visible mode,
ex:
IF XXXXXX
THEN FIELD VISIBLE
ELSE XXXXXX
FIELD IN-VISIBLE
ENDIF.
Thanks in Advance.
Thanks and Regards,
Abhi.
Is this the textview/Input field....
If it is Input field, then you can use follow Jagdish's post or if is text view then the type should be WDUI_VISIBILITY(01 as None,
02 as Visible)..
Regards,
Lekha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhi,
You can create a Attribute "F_visible" of type WDY_BOOLEAN in the Context Node.
Bind this Attribute to the 'Visible' Property of the Required field on View
And then in the Method you can Set the value of the attribute "F_visible" to 'X' (for visible ) or ' ' (Invisble) as per the requirement.
Regards,
Jagdish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jagadish,
Thanks for your prompt response, based on your instructions i did like below
I created F_Visible in Context with type WDY_BOOLEAN and i given default value to X, then i bind this value to my input fields, after the using WebDynpro Code wizrd i called F_Visible attribute, the below one is my code, please correct me if any thing wrong.
IF(Condition)
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->Element_context.
DATA lv_f_visible TYPE wd_this->Element_context-f_visible.
get element via lead selection
lo_el_context = wd_context->get_element( ).
@TODO handle not set lead selection
IF lo_el_context IS INITIAL.
ENDIF.
@TODO fill attribute
lv_f_visible = 1.
set single attribute
lo_el_context->set_attribute(
name = `F_VISIBLE`
value = lv_f_visible ).
xxxxxxxx
ELSE
lv_f_visible = 'X'.
set single attribute
lo_el_context->set_attribute(
name = `F_VISIBLE`
value = lv_f_visible ).
when i was testing my applicaiton i am getting Access via 'NULL' object reference not possible.
could you please help on this setting if i did any thing wrong.
Thanks in Advance.
Thanks and Regards,
Abhi Ram.
Edited by: Abhiram on Oct 30, 2009 3:18 PM
Hi Lekha,
Nice to see your prompt response, The Below one is the error:
The following error text was processed in the system HT1 : Access via 'NULL' object reference not possible.
The error occurred on the application server ebsptst30a_HT1_11 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: WDDOINIT of program /1BCWDY/PY788O20AL3MH2TLDHWN==CP
Method: IF_WDR_VIEW_DELEGATE~WD_DO_INIT of program /1BCWDY/PY788O20AL3MH2TLDHWN==CP
Method: DO_INIT of program CL_WDR_DELEGATING_VIEW========CP
Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
Method: INIT_CONTROLLER of program CL_WDR_VIEW===================CP
Method: INIT of program CL_WDR_CONTROLLER=============CP
Method: GET_VIEW of program CL_WDR_VIEW_MANAGER===========CP
Method: BIND_ROOT of program CL_WDR_VIEW_MANAGER===========CP
Method: INIT of program CL_WDR_VIEW_MANAGER===========CP
Method: INIT_CONTROLLER of program CL_WDR_INTERFACE_VIEW=========CP
Thanks and Regards,
Abhi Ram.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.