on 03-04-2010 6:01 PM
Hi,
I am creating dynamic drop down list. In a Adobe form side I dragged 'Enumerated DDL' and specify item I have changed 'Replace this' to my context name.
Webdynpro side I have written a code like this.
Types and It_status declared.
.
DATA lo_nd_dropdown TYPE REF TO if_wd_context_node.
DATA lo_el_dropdown TYPE REF TO if_wd_context_element.
DATA ls_dropdown TYPE wd_this->Element_dropdown.
navigate from <CONTEXT> to <DROPDOWN> via lead selection
lo_nd_dropdown = wd_context->path_get_node( path = `ADOBE.DROPDOWN` ).
get element via lead selection
lo_el_dropdown = lo_nd_dropdown->get_element( ).
get all declared attributes
lo_el_dropdown->get_static_attributes(
IMPORTING
static_attributes = ls_dropdown ).
Do I miss anything. I tried to bind the internal table to conext using BIND_TABLE method..but it says method doest not exist.
CALL METHOD me->BIND_TABLE
EXPORTING
NEW_ITEMS = it_status.
Please help me out.
Thanks
GJ
You need to pass a Value List.
This code declares a node, a value table, and populates it and Sets it.
DATA: node_info TYPE REF TO if_wd_context_node_info.
DATA: it_table TYPE wdr_context_attr_value_list.
*
* Populate it_table with Text/Value pairs
*
node_info->set_attribute_value_set(
name = 'PLANT'
value_set = it_table ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert,
Thanks for your response.
node_info->set_attribute_value_set(
name = 'PLANT'
value_set = it_table ).
This has to add to my code. Do you want me to remove anything from my code.
So no need to decalre the IT_TABLE structure as my context structure.
name = 'PLANT' this is the value which is to be populated in drop down...right?..
Can you please clearly explain..Since I am new to adobe form.
Thanks
GJ
I did as you said. But I am getting this error message when I execute the webdynpro.
The following error text was processed in the system : Access via 'NULL' object reference not possible.
The error occurred on the application server pddapp03_PDD_03 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: Z_WDDROPDOWN of program /1BCWDY/GVUGH3P1RAL8BLRW0KO4==CP
Method: IF_MAIN_VIEW~Z_WDDROPDOWN of program /1BCWDY/GVUGH3P1RAL8BLRW0KO4==CP
Method: WDDOINIT of program /1BCWDY/GVUGH3P1RAL8BLRW0KO4==CP
Method: IF_WDR_VIEW_DELEGATE~WD_DO_INIT of program /1BCWDY/GVUGH3P1RAL8BLRW0KO4==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
What could be the reason.
Thanks
GJ
sorry.. i think you have to navigate down to your node info...
Include the Node declaration in your data declarations
The node that contains my PLANT field is lo_nd_ideasheet_data - so replace that with the node that contains your field
DATA: lo_nd_ideasheet_data TYPE REF TO if_wd_context_node. " <-- add this
DATA: node_info TYPE REF TO if_wd_context_node_info.
DATA: it_table TYPE wdr_context_attr_value_list.
lo_nd_ideasheet_data = wd_context->get_child_node( name = wd_this->wdctx_ideasheet_data ).
node_info = lo_nd_ideasheet_data->get_node_info( ).
then, go on with your select statement and method call
Oh OK. But this method is unknown.
lo_nd_ideasheet_data = wd_context->get_child_node( name = wd_this->wdctx_ideasheet_data ).
wdctx_ideasheet_data this is unknown. I have double clicked on this interface if_wd_context_node. I dont see that method.
This is my code:
DATA: lo_nd_ideasheet_data TYPE REF TO if_wd_context_node.
DATA: node_info TYPE REF TO if_wd_context_node_info.
DATA: it_status TYPE wdr_context_attr_value_list.
DATA lo_nd_dropdown TYPE REF TO if_wd_context_node.
DATA lo_el_dropdown TYPE REF TO if_wd_context_element.
DATA ls_dropdown TYPE wd_this->Element_dropdown.
lo_nd_ideasheet_data = wd_context->get_child_node( name = wd_this->wdctx_ideasheet_data ).
node_info = lo_nd_ideasheet_data->get_node_info( ).
Select statement .
navigate from <CONTEXT> to <DROPDOWN> via lead selection
lo_nd_dropdown = wd_context->path_get_node( path = `ADOBE.DROPDOWN` ).
get element via lead selection
lo_el_dropdown = lo_nd_dropdown->get_element( ).
@TODO handle not set lead selection
IF lo_el_dropdown IS INITIAL.
ENDIF.
get all declared attributes
lo_el_dropdown->get_static_attributes(
IMPORTING
static_attributes = ls_dropdown ).
node_info->set_attribute_value_set(
name = 'STATUS'
value_set = it_status ).
Is that right.
Thanks
GJ
Change lo_nd_ideasheet_data to your Context Node that contains your STATUS field. Everywhere i have ideasheet_data - that needs to be changed to your context node.
this is all you should need:
DATA: lo_nd_ideasheet_data TYPE REF TO if_wd_context_node.
DATA: node_info TYPE REF TO if_wd_context_node_info.
DATA: it_table TYPE wdr_context_attr_value_list.
lo_nd_ideasheet_data = wd_context->get_child_node( name = wd_this->wdctx_ideasheet_data ).
node_info = lo_nd_ideasheet_data->get_node_info( ).
* select data and populate it_table appropriately
node_info->set_attribute_value_set(
name = 'STATUS'
value_set = it_table ).
Yup..Got it. But another error.
node_info->set_attribute_value_set(
name = 'VALUE'
value_set = it_status ).
This is my context :
Context.
Adobe (Node)
Dropdown. (Node)
Text (Attribute)
Value (Attribute)
When I execute the webdynpro component, I am this error.
The following error text was processed in the system PDD : Could not find attribute VALUE
Thanks
GJ
i think there's an issue with your context. You don't need to have a separate node for your drop downs.
For example, if i wanted to pass the LFA1 structure to Adobe, my Context would look like this:
PDF Node 1:1 cardinality
lifnr
land1
name1
name2
name3
ort01
and on and on....
So, the only thing underneath your Node is a bunch of attributes.
now, let's say you want to pass dropdown values for field ORT01
DATA: lo_nd_pdf TYPE REF TO if_wd_context_node.
DATA: node_info TYPE REF TO if_wd_context_node_info.
DATA: it_table TYPE wdr_context_attr_value_list.
lo_nd_pdf = wd_context->get_child_node( name = wd_this->wdctx_pdf ).
node_info = lo_nd_pdf->get_node_info( ).
* select data and populate it_table here
node_info->set_attribute_value_set(
name = 'ORT01'
value_set = it_table ).
that should be all you need to do
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
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.