on 10-30-2009 10:30 AM
Hi
I have created a Web Dynpro Application.
Here , i want to dynamically add a UI Element of type Interactive Form to my view and at run time only supply Template Source
to it.
I am writing the following code in DOMODIFYVIEW :
method WDDOMODIFYVIEW .
data: LR_CONTAINER type ref to CL_WD_UIELEMENT_CONTAINER,
LR_IF type ref to CL_WD_INTERACTIVE_FORM,
LR_FLOW_DATA type ref to CL_WD_FLOW_DATA.
LR_IF = CL_WD_INTERACTIVE_FORM=>NEW_INTERACTIVE_FORM( ).
LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_IF ).
LR_CONTAINER ?= view->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).
LR_CONTAINER->ADD_CHILD( LR_IF ).
LR_IF->SET_TEMPLATE_SOURCE('ZWD_NEW').
endmethod.
But it is giving a short dump saying
Access via 'NULL' object reference not possible
Can u think a possible problem
Thanks
Shivi Goel
Have you checked in ST22 for the NULL reference ...
Paste that code in ST22 for error.
data: LR_CONTAINER type ref to CL_WD_UIELEMENT_CONTAINER,
LR_IF type ref to CL_WD_INTERACTIVE_FORM,
LR_FLOW_DATA type ref to CL_WD_FLOW_DATA.
LR_IF = CL_WD_INTERACTIVE_FORM=>NEW_INTERACTIVE_FORM( ).
if lr_if is not initial.
LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_IF ).
endif.
LR_CONTAINER ?= view->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).
if lr_container is not initial.
LR_CONTAINER->ADD_CHILD( LR_IF ).
endif.
if lr_if is not initial.
LR_IF->SET_TEMPLATE_SOURCE('ZWD_NEW').
endif,
Edited by: Lekha on Oct 30, 2009 4:06 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.