on 09-14-2007 3:41 AM
Hi, experts,
There are some attributes in the node context(ee_node) that contained the attribute named "ANSSA" in the view(test_view) in the WDA for abap. In the method modifyview of the view(there is a transfered parameter that represent the name of "ANSSA")
I want to create a dynamic element(inputfield) in the test_view. The element need bind the context attribute (ANSSA).Through the transfered parameter(para), I only know the name of the attribute binded.
How can I bind the attribute of the context in the following code?
METHOD modifyview .
*****************************
*
*importing para type string.
*importing m_view type ref to if_wd_view.
*
******************************
data wd_inputfield type ref to cl_wd_input_field.
create one element automatically in the view.
wd_inputfield = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD(
view = m_view
id = para
BIND_VALUE = ???
).
ENDMETHOD.
I don't know how to replace the "???" in the method modifyview? Do you give me some hint for it?
You can reply back to me via e-mail if you think we should discuss this internally at tao.wang@besuretech.com or wwangt_92@hotmail.com.
Thanks.
Best regards,
tao
Hi,
If we have a cotext node SFLIGHTS and CARRID as its attribute, then we can provide
bind_value = 'SFLIGHTS.CARRID'
Best regards,
Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Suresh,
Thanks a lot for your help.
Just now, I think I may finished the code. But when I run the WDA for the dynamic created element, the system occuring error. do you give me some hints?
The following is my code in the wddomodifyview method in the ADDR_AUTO_DISP_VIEW view.
METHOD wddomodifyview .
******************************************
importing view type ref to if_wd_view.
*
******************************************
DATA transparent_container TYPE REF TO cl_wd_transparent_container.
DATA inputfield type ref to cl_wd_input_field.
DATA inputfield_id type string.
DATA LABEL TYPE REF TO CL_WD_LABEL.
data m_view type ref to if_wd_view.
transparent_container ?= view->get_element( `TRANSPARENT_CONTAINER` ).
transparent_container->set_visible(
EXPORTING
value = if_wdl_core=>visibility_visible ).
wd_this->SET_DYNAMIC_INPUT(
EXPORTING
inputfield_ID = 'ANSSA'
M_VIEW = view
IMPORTING
INPUTFIELD = inputfield
LABEL = LABEL
).
***************The web page will occur error when running the WDA as soon as I write the code.***********
transparent_container->add_child( THE_CHILD = inputfield ).
*********************************************************************************************************
ENDMETHOD.
The following is the code of the SET_DYNAMIC_INPUT method.
method SET_DYNAMIC_INPUT .
*********************************************
*
*importing
*INPUTFIELD_ID type STRING
*M_VIEW type ref to IF_WD_VIEW
*
*
*exporting
*INPUTFIELD type ref to CL_WD_INPUT_FIELD
*LABEL type ref to CL_WD_LABEL
*****************************************************
Data binded_context type string.
concatenate 'ADDR_AUTO_DISP_VIEW.EE_ADDRESS.' INPUTFIELD_ID into binded_context .
inputfield = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD(
view = m_view
id = inputfield_id
read_only = abap_true
BIND_VALUE = binded_context
).
label = cl_wd_label=>new_label( view = m_view
label_for = inputfield_id
).
endmethod.
When I run the WDA, The web page occuring the error information:
"
The following error text was processed in the system DEV : Access via 'NULL' object reference not possible.
The error occurred on the application server devserver_DEV_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
"
Do you give me some hints?
Thanks a million.
Best regards,
tao
Hi, Suresh,
Thanks a lot for your help in advance.
Now, I modify my code. The following is my new code in the wddomodifyview method in the ADDR_AUTO_DISP_VIEW view.
METHOD wddomodifyview .
******************************************
importing view type ref to if_wd_view.
******************************************
DATA transparent_container TYPE REF TO cl_wd_transparent_container.
DATA inputfield type ref to cl_wd_input_field.
DATA inputfield_id type string.
DATA LABEL TYPE REF TO CL_WD_LABEL.
data m_view type ref to if_wd_view.
transparent_container ?= view->get_element( `TRANSPARENT_CONTAINER` ).
transparent_container->set_visible(
EXPORTING
value = if_wdl_core=>visibility_visible ).
m_view = transparent_container->view.
wd_this->SET_DYNAMIC_INPUT(
EXPORTING
inputfield_ID = 'ANSSA'
IMPORTING
INPUTFIELD = inputfield
LABEL = LABEL
).
**************The web page will occur error when running the WDA as soon as I write the code.***********
transparent_container->add_child( THE_CHILD = inputfield ).
*********************************************************************************************************
ENDMETHOD.
The following is the code of the SET_DYNAMIC_INPUT method.
method SET_DYNAMIC_INPUT .
*********************************************
*
*importing
*INPUTFIELD_ID type STRING
*exporting
*INPUTFIELD type ref to CL_WD_INPUT_FIELD
*****************************************************
Data binded_context type string.
concatenate 'ADDR_AUTO_DISP_VIEW.EE_ADDRESS.' INPUTFIELD_ID into binded_context .
inputfield = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD(
id = inputfield_id
read_only = abap_true
BIND_VALUE = binded_context
).
endmethod.
When I run the WDA, The web page occuring the error information:
"
Note
The following error text was processed in the system DEV : Access via 'NULL' object reference not possible.
The error occurred on the application server devserver_DEV_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
"
But when I delete the code of the wddomodifyview, and create a inputfield in the layout of the view, and bind the "ANSSA" to the "value" property in the layout, the WDA is running correctly.
Do you give me some hints?
Thanks a million.
Best regards,
tao
Hi, Suresh,
Thanks a lot for your help.
The last mail have some errors. Now, I modify my code error. The following is my new code in the wddomodifyview method in the ADDR_AUTO_DISP_VIEW view.
Now, I modify my code. The following is my new code in the wddomodifyview method in the ADDR_AUTO_DISP_VIEW view.
METHOD wddomodifyview .
******************************************
importing view type ref to if_wd_view.
******************************************
DATA transparent_container TYPE REF TO cl_wd_transparent_container.
DATA inputfield type ref to cl_wd_input_field.
transparent_container ?= view->get_element( `TRANSPARENT_CONTAINER` ).
transparent_container->set_visible(
EXPORTING
value = if_wdl_core=>visibility_visible ).
wd_this->SET_DYNAMIC_INPUT(
EXPORTING
inputfield_ID = 'ANSSA'
IMPORTING
INPUTFIELD = inputfield
).
**************The web page will occur error when running the WDA as soon as I write the code.***********
transparent_container->add_child( THE_CHILD = inputfield ).
*********************************************************************************************************
ENDMETHOD.
The following is the code of the SET_DYNAMIC_INPUT method.
method SET_DYNAMIC_INPUT .
*********************************************
*
*importing
*INPUTFIELD_ID type STRING
*exporting
*INPUTFIELD type ref to CL_WD_INPUT_FIELD
*****************************************************
Data binded_context type string.
concatenate 'ADDR_AUTO_DISP_VIEW.EE_ADDRESS.' INPUTFIELD_ID into binded_context .
inputfield = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD(
id = inputfield_id
read_only = abap_true
BIND_VALUE = binded_context
).
endmethod.
When I run the WDA, The web page occuring the error information:
"
Note
The following error text was processed in the system DEV : Access via 'NULL' object reference not possible.
The error occurred on the application server devserver_DEV_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
"
But when I delete the code of the wddomodifyview, and create a inputfield in the layout of the view, and bind the "ANSSA" to the "value" property in the layout, the WDA is running correctly.
Do you give me some hints?
Thanks a million.
Best regards,
tao
Hi, Suresh,
Thanks a lot for your help in advance.
Now, I modify my code. The following is my new code in the wddomodifyview method in the ADDR_AUTO_DISP_VIEW view. It is correct when I run the WDA.
METHOD wddomodifyview .
DATA transparent_container TYPE REF TO cl_wd_transparent_container.
DATA inputfield type ref to cl_wd_input_field.
DATA inputfield_id type string.
transparent_container ?= view->get_element( `TRANSPARENT_CONTAINER` ).
transparent_container->set_visible(
EXPORTING
value = if_wdl_core=>visibility_visible ).
wd_this->SET_DYNAMIC_INPUT(
EXPORTING
inputfield_ID = 'ANSSA'
IMPORTING
INPUTFIELD = inputfield
).
cl_wd_grid_data=>new_grid_data( element = inputfield
h_align = 00 ).
transparent_container->add_child( THE_CHILD = inputfield ).
ENDMETHOD.
The problem has been solved.
Thanks a million.
Best regards,
tao
Hi, Suresh,
This problem have been solved.
Thanks a lot.
Best regards,
tao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
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.