on 08-19-2008 1:16 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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.
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.
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
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.
Solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.