cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown List Web dynpro Abap

darren_bambrick2
Active Participant
0 Kudos

Hi All

I am new to adobe forms. I am having a problem with populating drop down list box on an adobe interactive form. I have gone through this forum and I have tried a number of different things but nothing seems to work.

When I run my web dynpro application the drop down looks like an input box. There is no down arrow icon on the side.

I check note 981638. It states it can't be implemented.

I am on CRM 2007 NW7 platform.

I created an interface with an importing value called it_dropdown. this is a table.

I created a form that uses this interface.

i placed a drop down list on the form layout. In the dynamic options i click list items. I get a popup.

In the bindings I bind to the table... $record.IT_DROPDOWN.DATA[*]

The text and value are bound to corresponding fields on the internal table.

I created a webdynpro

I created a view.

I poped an interactive form ui elemnt on the view.

I generated the context.

I checked the cardinality of the node for the internal table and it is 0..n

In my doinit method I have the following code.

data: lr_form_node type REF TO if_wd_context_node.

data: lr_dd type REF TO if_wd_context_node.

data: lt_dropdown type WDR_CONTEXT_ATTR_VALUE_LIST,

wa like line of lt_dropdown.

do 20 times.

wa-value = sy-index.

concatenate 'Test' wa-value into wa-text SEPARATED BY space.

insert wa into table lt_dropdown.

enddo.

lr_form_node = wd_context->get_child_node( wd_this->wdctx_zfp_example_01 ).

lr_dd = lr_form_node->get_child_node( wd_this->wdctx_it_dropdown ).

lr_imp->bind_table( lt_dropdown ).

The adobe form displays but the drop down is not populated.

I have tried a normal drop down and webdynpro enumerated drop downs.

Can someone please point out what I am doing wrong.

Thanks

Darren

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have a problem with the dropdown list in the PDF. I can't click on the arrow...

When I go in debug mode I see the context element is corectly filled with the internal table.

But in the PDF, I'm not able to click to choose a value....

regards,

Said

Former Member
0 Kudos

try this instead - i'm populating several dropdown boxes in my WDOINIT and passing them fine to the PDF.

You need to read your context where the dropdowns are located - in my case, they are all located in IDEASHEET_DATA.

By the way, my drop downs ARE NOT defined as tables in the Context - they are regular fields. The key is attaching the Value Set as seen below.


  DATA: lo_nd_ideasheet_data TYPE REF TO if_wd_context_node.      " <- Context being passed to the PDF
  DATA: node_info TYPE REF TO if_wd_context_node_info.
  DATA: it_table TYPE wdr_context_attr_value_list.              " <--- this holds your drop down Values and Texts

  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 your values into internal table it_table here
*
  node_info->set_attribute_value_set(
     name      = SERVICE_MANAGER'   " <- this is a field in my Context and Adobe Form
     value_set = it_table ).

darren_bambrick2
Active Participant
0 Kudos

Hi Robert

Thanks for getting back to me.

I implemented the change in the webdynpro side. All is fine on that end

I poped a string attribute onto a new structure I created for my dropdowns. This structure has cardinality 0..1. I mapped the internal table to the attribute as you suggested.

When I view the form, I still can't see any values in the drop downs. Can you advise on this ?

What type of drop down do I use ? noraml, webdynpro native etc.

Thanks for your help.

Former Member
0 Kudos

I believe I used Web Dynpro Native Enumerated Drop Down No-Select

darren_bambrick2
Active Participant
0 Kudos

Still no joy

I checked the binding on the webdynpro native drop down and it looks correct.

binding

$record.STAT_CHG_BUTTON

I am at a loss.

Am I missing something on the layout of the form.

I have mine set to zcl layout.

I am not even getting a drop down icon on the drop down list. It looks like a text box.

darren_bambrick2
Active Participant
0 Kudos

I have followed this blog

/people/dezso.pap/blog/2007/07/12/using-ddlb-in-interactive-forms-in-webdynpro-for-abap

Except for the part with "Replace_This" referenced in the blog. I am on lifecycle 8 and the dynamic paramters are disabled.

Former Member
0 Kudos

yes, that's the blog I used as a reference for my coding.

how is your field defined in your context? did you say it was in a table (0..n)?

just try creating a new field in your context with some type (bukrs for example). Then, populate the attribute value set (Text and Value) as mentioned above.

In your form, add the Web Dynpro Native enumerated drop down list, bind it to your new field and test it out.

you must run your web dynpro app to test it - you won't see nay values in the Preview PDF tab in LCD.

darren_bambrick2
Active Participant
0 Kudos

Hi

I created a new interface, new form etc.

I have only 1 attribute on my interface and 1 dropdown on my form.

I excecuted the webdynpro.

There is no values in the list and also there is no dropdown icon on the right of the element. ( Is this strange ?)

The values are being created. see below.

data: lr_context_node type ref to if_wd_context_node.

data: lt_dd type wdr_context_attr_value_list.

DATA: node_info TYPE REF TO if_wd_context_node_info.

data: wa like line of lt_dd.

do 20 times.

wa-value = sy-index.

concatenate 'Test' wa-value into wa-text SEPARATED BY space.

insert wa into table lt_dd.

enddo.

  • lr_form_node = wd_context->get_child_node( wd_this->wdctx_zfp_example_01 ).

lr_context_node = wd_context->get_child_node( name = 'ZDARREN1' ).

node_info = lr_context_node->get_node_info( ).

node_info->set_attribute_value_set(

name = 'DD_BOX'

value_set = lt_dd ).

Former Member
0 Kudos

go into your LCD and click on the drop down box in your form.

Click on Object tab, then Field, then List Items to see the dynamic properties.

Do you have a value there for your binding? Mine looks like:

$record.sap-vhlist.SERVICE_MANAGER

Also, under Obect then Field tab, you have a Type field - does that show Drop-down List?

EDIT: also just to be sure, put a breakpoint after your ENDDO & check your table to make sure those values/texts were really inserted.

Edited by: robert phelan on Jul 16, 2009 5:56 PM

darren_bambrick2
Active Participant
0 Kudos

Hi

In the dynamic parametes I see the following

$record.sap-vhlist.DD_BOX.iterr

In the binding tab

$record.DD_BOX

The type is drop down list.

Former Member
0 Kudos

that looks right... i think the dynamic properties is really $record.sap-vhlist.DD_BOX.item[*] now that i have a look at mine

what version are you on? we're on LCD 8.0

darren_bambrick2
Active Participant
0 Kudos

I am on version 8 also.

my dynamic properties appends .iterr at the end of the binding. I will check oss to see if there is anything there.. This is our first time using this so there could be something wrong with the install.

Thanks

darren_bambrick2
Active Participant
0 Kudos

Hi Robert

I got this sorted in the end.

I approached it differently.

I created the web dynpro first.

I created my context on the web dynpro side.

I poped a interactive form element on the form

In the form template a gave the name of my new form.

I doubled clicked, i got a prompt to create an interface. I created a ZCL form layout that uses the xml interface.

I could see my context nodes. I poped a native webdynpro enumerated drop down box on the layout. Saved, activated and ran the webdynpro and everthing works. It coud be because previously I was using a dictionary interface.

Anyway, thanks for the help, I awarded you some points.

Former Member
0 Kudos

that's good news.. i'm also using the XML interface, but didn't think that would matter as far as drop downs were concerned.

darren_bambrick2
Active Participant
0 Kudos

Its definately the interface. I went back and changed my original form and it works now as well...

Former Member
0 Kudos

edit

Edited by: robert phelan on Jul 17, 2009 4:30 PM

former_member184619
Active Contributor
0 Kudos

Hi Darren,

Can you please provide some pointers on binding and context node cardinatility as well.

I am using the same approach but not able to get the values on Adobe form.

Regards,

Sachin

darren_bambrick2
Active Participant
0 Kudos

Hi Sachin

Here is exactly what I did.

1. Create a web dynpro application.

2. Crate a view

3. On the context create a node called data_source or whatever you want. The cardinality is 1.1.

4. Create an attriubute on the data_source note. I called mine 'DDOWN' and created it as a string.

5. Pop an interactive form element on your view.

6. In the Template Source, give the name of your adobe form. This part was the vital bit for me as I was using a database interface originally and I think that this was my problem. If you already have a form created that does not use xml, I would advise you to create a new temporary adobe form by putting the name in the template source and double clicking it.

7. You will get a popup stating asking you to create an interface. You will see a button called "context" click this and follow the steps.

8. When you get to your form you will see the drop down context node in the data hierarchy. Drop a drop down list on your form and then drag and drop your context node onto it. Make sure your forms layout is ZCI. Save the form.

9 Return to your web dynpro app. You will see that the datasource has been updated.

10. I used the following code in the doinit method of the web dynpro.

data: lr_context_node type ref to if_wd_context_node.

data: lt_dd type wdr_context_attr_value_list.

DATA: node_info TYPE REF TO if_wd_context_node_info.

data: wa like line of lt_dd.

do 20 times.

wa-value = sy-index.

concatenate 'Test' wa-value into wa-text SEPARATED BY space.

insert wa into table lt_dd.

enddo.

lr_context_node = wd_context->get_child_node( name = 'ZDARREN1' ). "Template Source

node_info = lr_context_node->get_node_info( ).

node_info->set_attribute_value_set(

name = 'DDOWN' "DDOWN is a node on the context

value_set = lt_dd ).

Activate and test.

You should see a dropdown.

I hope this helps as this is the approach that worked for me.