cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down box not getting filled

Former Member
0 Kudos

Friends,

I am using a drop down list in Adobe Interactive Form for Web Dynpro ABAP.

The form is of ZCI type layout and the form interface is of XML schema-based interface type and the XML schema source is set to "Generated".

I have included the following code in WDDOINIT method of the view where the form is included as an UI element:

-


data: handle1 type ref to if_wd_context_node,

begin of zstruct,

zktokd type kna1-ktokd,

end of zstruct,

zitab type table of zsttxecr.

handle1 = wd_context->get_child_node( name = 'DATA.NODE1' ).

select ktokd from kna1 into corresponding fields of zstruct.

append zstruct to zitab.

endselect.

handle1->bind_table( new_items = zitab ).

-


In the Adobe Form Designer, i have binded the node NODE1 to the enumerated drop down list from native web dynpro library. Still the drop down box is not getting populated.

Please let me know what is missing.

Thanks and Regards.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Try changing

>

> -


> data: handle1 type ref to if_wd_context_node,

> begin of zstruct,

> zktokd type kna1-ktokd,

> end of zstruct,

> zitab type table of zsttxecr.

>

> handle1 = wd_context->get_child_node( name = 'DATA.NODE1' ).

> select ktokd from kna1 into corresponding fields of zstruct.

> append zstruct to zitab.

> endselect.

>

> handle1->bind_table( new_items = zitab ).

> -


>.

to

>

> -


> data: handle1 type ref to if_wd_context_node,

> begin of zstruct,

> zktokd type kna1-ktokd,

> end of zstruct,

> zitab type table of zstruct.

>

> handle1 = wd_context->get_child_node( name = 'DATA.NODE1' ).

> select ktokd from kna1 into corresponding fields of zstruct.

> append zstruct to zitab.

> endselect.

>

> handle1->bind_table( new_items = zitab ).

> -


>.

Also check that the cardinality of your context node is NOT 0..1

Regards

Thashin

Edited by: Thoshin Naicker on Aug 19, 2008 3:28 PM

Former Member
0 Kudos

Hi,

The cardinality of the node is 1..n

I tried changing the code as you suggested. It led to an syntax error and i have implemented the following code.

-


method WDDOINIT .

types: begin of zs,

zktokd type kna1-ktokd,

end of zs.

data: handle1 type ref to if_wd_context_node,

begin of zstruct,

zktokd type kna1-ktokd,

end of zstruct,

zitab type table of zs.

handle1 = wd_context->get_child_node( name = 'DATASOURCE' ).

select ktokd from kna1 into corresponding fields of zstruct.

append zstruct to zitab.

endselect.

handle1->bind_table( new_items = zitab ).

endmethod.

-


Still the drop down is not getting populated.

Thanks and Regards.

Former Member
0 Kudos

Hi

How did you do the binding in the lifecycle designer? did you do it as per the followning ?

Procedure

1. Place the Adobe UI element as usual on the template and bind it to the context in the data view.

2. Change the element value binding.

a. ChooseElement Values.

On the following popup the following entry for Objects appears below the group title Binding:

$record.sap-vhlist.REPLACE_THIS.item[*]

b. Replace REPLACE_THIS with the SOM expression of the data binding.

You can get this value from the Object menu. This is the value that appears after $record in the standard binding. Example

Node.DVH3.

Note that you escape each point with \.

Example of a correct value: $record.sap-vhlist.Node\.DVH3.item[*]

The values of the EnumeratedDropDownList are taken from the VALUE_SET of the bound Web Dynpro attribute. If the type of the attribute is DDIC (ABAP Dictionary) and domain fixed values are defined, these are shown. You can also program the VALUE_SET to fill with values at runtime.

Regards

Thashin

Edited by: Thoshin Naicker on Aug 20, 2008 8:53 AM

Former Member
0 Kudos

Thashin,

I have sent screenshots of the binding and context to your email id.

Please let me know what is missing.

Thanks and Regards.

former_member189058
Active Contributor
0 Kudos

Hi

Try this:

1. in WD4A --> Context

Create a Node with foll structure

NODE1

myText

myValue

2. in WD4A --> View Layout

Embed a Interactive Form UI Element

and sepcify following properties

dataSource -> VIEW.NODE1

displayType -> Native/ActiveX

enabled = true

templateSource = <form_name>

3. in WD4A --> View

Write a method to populate data in NODE1

say for eg

NODE1-myText = Text 01

NODE1-myValue = V01

NODE1-myText = Text 02

NODE1-myValue = V02

NODE1-myText = Text 03

NODE1-myValue = V03

4. Enable Dynamic Binding

Go to Form Builder.. SFP transaction.

Open the form in Edit mode..

Go to Layout

Tools --> Options --> Data Binding --> check Show Dynamic Properties.

5. On the layout to Create a Dropdown..

Go to Library... --> Web Dynpro Native or Web Dynpro Active-X (Depeding on form displayType - Point 2)

Drag and Drop --> ValueHelp DropDown List

6. Bind Text and Value

Select the dropdown box and click on Object Palette --> Cell Tab

List Items should be a link now.. (due to dynamic binding)

Binding --> Items --> NODE1->DATA ($record.NODE1.DATA[*])

Item Text --> myText

Item Value --> myValue

Now test the form, you should be getting the drop down values.

Regards,

Reema.

Former Member
0 Kudos

Reema,

I followed most of your steps. I have a question reg. step 3 ie populating data in node 1.

Here is my code:

-


method WDDOINIT .

types: begin of zs,

zktokd type kna1-ktokd,

end of zs.

data: handle1 type ref to if_wd_context_node,

begin of zstruct,

zktokd type kna1-ktokd,

end of zstruct,

zitab type table of zs.

handle1 = wd_context->get_child_node( name = 'NODE1' ).

*select ktokd into corresponding fields of zstruct from kna1.

*append zstruct to zitab.

*endselect.

zstruct-zktokd = 'Sold-to party'.

append zstruct to zitab.

zstruct-zktokd = 'Goods recipient'.

append zstruct to zitab.

zstruct-zktokd = 'Payer'.

append zstruct to zitab.

zstruct-zktokd = 'Bill-to party'.

append zstruct to zitab.

zstruct-zktokd = 'Prospective Customer'.

append zstruct to zitab.

zstruct-zktokd = 'Competitor'.

append zstruct to zitab.

zstruct-zktokd = 'Sales partners'.

append zstruct to zitab.

zstruct-zktokd = 'Hierarchy Node'.

append zstruct to zitab.

zstruct-zktokd = 'Named List of Accounts'.

append zstruct to zitab.

zstruct-zktokd = 'Distribution center'.

append zstruct to zitab.

zstruct-zktokd = 'Payer'.

append zstruct to zitab.

handle1->bind_table( new_items = zitab ).

endmethod.

-


Please let me know if this is the best way to populate the node and then bind the table values from the node to the drop down box.

Thanks and Regards.

former_member189058
Active Contributor
0 Kudos

begin of zstruct,

ktokd type kna1-ktokd, * Replace Zktokd with ktokd *

end of zstruct,

zitab type table of zs.

select ktokd

into corresponding fields of table zitab

from kna1.

handle->bind_table( zitab ).

(code}

Former Member
0 Kudos

Reema,

Let me know if i can send you screenshots of the form and context to give you a better understanding of the same.

Thanks and Regards.

former_member189058
Active Contributor
0 Kudos

sure... do send it to me

Former Member
0 Kudos

Reema,

I sent the screenshots to your email id.

Thanks and Regards.

former_member189058
Active Contributor
0 Kudos

Gosh!!!!! I got it.....

For PDF... the node that is bound to the Data Source needs to be a 1..1 cardinality..

simply change the Context as follows

PDFNODE 1..1

NODE1 1..n

ATT

and bind the data source of the interactive form UI to PDFNODE

activate WD4A...

Dbl click on the formName in TemplateSource property of interactive form UI...

There will be a popup asking confirmation to adjust the interface... click on YES and activate the interface....

Now when u specify the list items as NODE1->DATA

Former Member
0 Kudos

Reema,

I made the changes.

I am getting the following error:

Subnode MAIN.NODE1 does not exist

I changed the WDDOINIT code from this:

handle1 = wd_context->get_child_node( name = 'NODE1' ).

to this:

handle1 = wd_context->get_child_node( name = 'PDFNODE1.NODE1' ).

Then i get this error:

Subnode MAIN.PDFNODE1.NODE1 does not exist

Please let me know what is the right syntax to access the NODE1, now that it is part of PDFNODE1.

Thanks and Regards.

former_member189058
Active Contributor
0 Kudos

data: l_node type ref to if_wd_context_node.

l_node = wd_context->get_child_node( name = wd_this->wdctx_pdfnode ).
l_node = l_node->get_child_node( name = wd_this->wdctx_node1 ).

l_node->bind_table ( zitab ).
Former Member
0 Kudos

Hi

Please let me know if you have already done what i mentioned in the mail.

Regards

Thashin

Former Member
0 Kudos

Hi

Have a look at the following blog. It will help you.

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6793] [original link is broken] [original link is broken] [original link is broken];

Regards

Thashin

Answers (1)

Answers (1)

Former Member
0 Kudos

Solved