cancel
Showing results for 
Search instead for 
Did you mean: 

Drop Down list in table with data from database table

rvinod1982
Contributor
0 Kudos

Hi,

I have created an interactive form in WD ABAP.

In Context tab I have created the nodes as follows:

ZSOHEADER node with cardinality 1..1

|-> MATERIAL node with cardinality 0..n. Under MATERIAL node there are 2 attrib. MAKTX and MATNR.

I am fetching data from MARA table into an internal table IT_MARA.

The node MATERIAL is bound to internal table IT_MARA.

I have created a table with property ' Body rows vary depending on data ' .

I have only one row in table. The first cell of the row is a drop down field.

I have bind the field to the node MATERIAL->DATA->MAKTX.

Now the issue is even though I have created only one row in my table, in preview it is creating as many rows in the table as the no.of records in the internal table.

I want only one row with the drop down list containing all values of the internal table.

Kindly suggest what to do.

Regards,

Vinod

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In the WebDynpro Context, in the main node create another node like A1 with cardinality 0..n and in this node create attributes TEXT and VALUE.

Now goto method and in that method using code wizard read the node A1.

And use the below code snippet sample in your program, i.e. code this under respective method of the webdynpro.


*Declare the TYPES 
TYPES : BEGIN OF TY_TABLE,
TEXT TYPE SOMETYPE,
VALUE TYPE SOMETYPE,
END OF TY_UOM.

*Define Internal Table and work area.
DATA : IT_TABLE TYPE STANDARD TABLE OF TY_TABLE INITIAL SIZE 0,
WA_TABLE TYPE TY_TABLE.

SELECT TEXT VALUE FROM TABLENAME INTO TABLE IT_TABLE.

lr_node_info->bind_table( IT_TABLE ).

And in the Adobe Form Layout

Go to Menu of the Adobe LiveCycle Designer:

Tools>Options..>DataBinding

In that window you just check the Show Dynamic properties Check Box.

Now for the Drop Down go the binding tab in object palette and click on the list items and there specify the Internal Table and specify the text as the internal table text field and value as internal table value field.

OR

From the WebDynpro Native Library Palette use the Value Help Drop Down and in object pallette goto binding tab and provide the form interface binding. Before this in the WebDynpro goto Context and for the particular field under the properties provide the search help as dictionary search help and specify the name of the dictionary search help.

OR

We have another method of setting the Text and Value to the DDL directly in the WebDynpro by coding in the methods, I dont have much knowledge on this.

Regards

Pradeep Goli

rvinod1982
Contributor
0 Kudos

Hi Pradeep,

I have already done as you have specified.

The issue is I have only row in my table. On executing, it is showing as many rows as there are no.of records in the internal table. Suppose there are 10 records in the internal table, the table is created with 10 rows.

But I require only one row.

Regards,

Vinod

Former Member
0 Kudos

Hi,

Remove all the bindings related to the Table in the Adobe Layout and use only the Dynamic Binding for the Field in that table and for that field also dont specify any binding in the binding tab of the object pallette. Check whether it works fine or not and then poceed with the adding the other bindings to the table or fields in the layout.

If its not working, check by placing a drop down outside of the table and specify the dynamic binding and see whether it is working or not.

Thanks and Regards

Pradeep Goli

rvinod1982
Contributor
0 Kudos

Hi Pradeep,

It really worked !!!

Thanks a lot

Regards,

Vinod

Answers (0)