Dynamic Context Mapping in Web Dynpro ABAP
Hi Experts,
How can I create two dynamic Context nodes, one in ViewController and the other in Component Controller and finally create a context mapping between them?
Regards,
Johan Kriek.
Hi Johan,
I found a method IF_WD_CONTEXT_NODE_INFO~ADD_NEW_MAPPED_CHILD_NODE that seems to be the one that I am looking for.
I do have same idea but i have been trying to give solution by using above method,unfortunately here my server is down.check the below code. i didnt check this code due to server down.
DATA: lo_nd_purchase_header TYPE REF TO if_wd_context_node,
lo_el_purchase_header TYPE REF TO if_wd_context_element,
ls_purchase_header TYPE wd_this->element_purchase_header,
lo_node_info type ref to if_wd_context_node_info,
lo_child_node_info type ref to if_wd_context_node_info,
MAPPING_INFO type WDR_CONTEXT_MAPPING_INFO.
* navigate from <CONTEXT> to <PURCHASE_HEADER> via lead selection
lo_nd_purchase_header = wd_context->get_child_node( name = wd_this->wdctx_purchase_header ).
CALL METHOD LO_ND_PURCHSE_HEADER->GET_NODE_INFO
RECEIVING
NODE_INFO = lo_node_info.
MAPPING_INFO-controller = 'ZWDC_ALV'. "conponent name
MAPPING_INFO-path = 'PURCHASE_HEADER'. "Controller context node name
CALL METHOD LO_NODE_INFO->ADD_NEW_MAPPED_CHILD_NODE
EXPORTING
CHILD_NAME = 'PURCHASE_HEADER'
MAPPING_INFO = MAPPING_INFO
* IS_STATIC = ABAP_TRUE
RECEIVING
CHILD_NODE_INFO = lo_child_node_info
Similar Messages
-
Cannot see Ecatt option in context menu in web dynpro abap in SE80 ECC 6.0
Hi ,
I saw a presentation by Thomas in which there is option of recording ecatt script on context menu in web dynpro abap application.we are on ECC 6.0 we are trying to record WDA applications and test them by using Ecatt but I am unable to see the option of recording the ecatt script in SE80 editor.
Why could this be happeningThanks ,
I saw that disappointing note ...any other way to automate web dynpro abap testing ? please advise. -
How to put dynamic search help in web dynpro ABAP.
Hi,
I have a table element with two columns in my web dynpro ABAP.Both the columns are F4 helps.
Based on the value of the first column,the F4 help of second column must change dynamically.Kindly tell me how to do this.
Thanks & Regards,
Raji.Hi ,
Use this code to dynamically assign search help and to deactivate search helps.
data lo_nd_info type if_wd_context_node_info.
lo_nd_info = lo_nd->get_node_info( ).
CALL METHOD lo_nd_info->set_attribute_value_help
EXPORTING
name = 'ATTR1' " Your attribute Name
value_help_mode = '121' " Valid value help mode
value_help = 'Z187442'. " Search help name
The various possible values that you can pass to value_help_mode are as shown below.
deactivated 101
automatic 111
ddic 121
ovs 131 -
Dynamic table columns in web dynpro abap
Hi,
In my current project I have got a requirement whose solution I am not able to figure out.
My requirement is this:
I will have a table containig budget owners name(since its compensation management in HR).There will be a table popin inside this table on the click of the personal number of the budget owner. Now the table popin will have another table with all employees name under that particular budget owner.
The problem is that the table inside the popin will not be having fixed columns.Actually the columns will be coming from a standard java web dynpro application (say in the form of an internal table).
My requirement is this how can this be handled?Can we include all the possible columns in the node(which i bind to the child table) and make them visible/invisible during runtime? or create a dynamic node and assign it to the table(but in this case a node needs to be bound to the table during design time,what to bind?) ?
Can u please help along with code snippets.
Thanks and Regards,
Saikat.Thnx for the input.
I am abke to make the table columns inside the popin visible/invisible.
I have a tabstrip.Indise one of the tabs is my main table and inside one of the columns is the popin.Inside that a transparent container and finally the table inside that.
This is the code that worked for me.
METHOD wddomodifyview .
DATA lr_root_container TYPE REF TO cl_wd_uielement_container.
DATA lr_table_popin TYPE REF TO cl_wd_table_popin.
DATA lr_transparent_container TYPE REF TO cl_wd_transparent_container.
DATA lr_table TYPE REF TO cl_wd_table.
DATA lr_table_column TYPE REF TO cl_wd_table_column.
DATA lr_table_in_table_popin TYPE REF TO cl_wd_table.
DATA lr_node_header_node TYPE REF TO if_wd_context_node.
DATA lr_node_item_node TYPE REF TO if_wd_context_node.
DATA lr_tabstrip TYPE REF TO cl_wd_tabstrip.
DATA lr_tab TYPE REF TO cl_wd_tab.
data lr_tc type ref to CL_WD_TRANSPARENT_CONTAINER.
data lr_table2 type ref to cl_wd_table.
DATA lr_table2_column TYPE REF TO cl_wd_table_column.
IF first_time = abap_false.
lr_root_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_tabstrip ?= lr_root_container->get_child( id = 'TABSTRIP1' ). "GETTING THE TABSTRIP
lr_tab ?= lr_tabstrip->get_tab( id = 'TAB1' ). "GETTING THE TAB INSIDE TABSTRIP
lr_table ?= lr_tab->GET_CONTENT( ). "GETTING THE CONTENT(TABLE IN THIS CASE) INSIDE TABSTRIP
lr_table_column ?= lr_table->get_grouped_column( id = 'TABLE_MAIN_PERNR' ). "GETTING THE COLUMN INSIDE THE TABLE
"Table popin
lr_table_popin ?= lr_table_column->GET_POPIN( ). "GETTING THE POPIN INSIDE THE TABLE
lr_tc ?= lr_table_popin->GET_CONTENT( ). "GETTING THE CONTENT(TRANSPARENT CONTAINER IN THIS CASE)INSIDE THE TABLE
lr_table2 ?= lr_tc->get_child( id = 'TABLE_EMPLOYEE' ). "GETTING THE EMPLOYEE TABLE INSIDE THE TRANSPARENT CONTAINER
lr_table2_column ?= lr_table2->get_grouped_column( id = 'TABLE_EMPLOYEE_PERNR' ). "GETTING THE COLUMN INSIDE THE TABLE
lr_table2_column->SET_VISIBLE( '02' ). "SETTING VISIBILITY FOR THE COLUMN
ENDIF.
ENDMETHOD.
But I'm still considering the dynamic node concept.Lets see if this works out or not.If not then I'll have to go for the dynamic node thing.
Thanks,
Saikat -
Dynamic context binding in web dynpro alv
I use dynamic context binding (see code below to show and edit the ALV table.
'DB_TABLE' is a tranparent table. It works fine.
But now this table should be expanded with additional fields which are only known at runtime and could be different from case to case.
How can I get these fields in the context dynamically?
DATA:
rootnode_info TYPE REF TO if_wd_context_node_info,
dyn_node TYPE REF TO if_wd_context_node,
tablename TYPE string.
rootnode_info = wd_context->get_node_info( ).
tablename = 'DB_TABLE'.
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = tablename
structure_name = tablename
is_multiple = abap_true ).
DATA:
stru_tab TYPE REF TO data.
FIELD-SYMBOLS: <tab> TYPE table.
CREATE DATA stru_tab TYPE TABLE OF (tablename).
ASSIGN stru_tab->* TO <tab>.
SELECT * FROM (tablename) INTO CORRESPONDING FIELDS OF TABLE <tab>.
dyn_node = wd_context->get_child_node( name = tablename ).
dyn_node->bind_table( <tab> ).You should create a structure dynamically and use this as the context structure. See the coding below, where a structure is created, which contains CARRID and CONNID.
DATA: node_info type ref to if_wd_context_node_info,
struct_type TYPE REF TO cl_abap_structdescr,
table_type type ref to cl_abap_tabledescr,
comp_tab TYPE cl_abap_structdescr=>component_table,
comp LIKE LINE OF comp_tab,
my_table type ref to data,
my_row type ref to data.
field-symbols: <table> type table,
<row> type data,
<flight> type sflight.
* build a structure description from the list of single fields
comp-name = 'CARRID'.
comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CARR_ID' ).
APPEND comp TO comp_tab.
comp-name = 'CONNID'.
comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CONN_ID' ).
APPEND comp TO comp_tab.
* note this structure contains the fields "CONNID" and "CARRID"
struct_type = cl_abap_structdescr=>create( comp_tab ).
* now the nodeinfo is created
node_info = wd_context->get_node_info( ).
node_info = node_info->add_new_child_node(
name = 'MY_NODE'
IS_MANDATORY = ABAP_true
IS_MULTIPLE = ABAP_true
STATIC_ELEMENT_RTTI = struct_type
IS_STATIC = ABAP_false
* fill new node;
data: l_node type ref to if_wd_context_node,
l_flight type STANDARD TABLE OF sflight.
l_node = wd_context->get_child_node( 'MY_NODE' ).
l_flight = wd_assist->get_flights( ).
* if you could create a local data type, would be fine, but if you have to do it dynamically ...
struct_type = node_info->GET_STATIC_ATTRIBUTES_TYPE( ).
* create tabledescriptor from structdescription (standard table, no keys)
table_type = cl_abap_tabledescr=>create( p_line_type = struct_type ).
create data my_table type handle table_type.
assign my_table->* to <table>.
loop at l_flight assigning <flight>.
create data my_row type handle struct_type.
assign my_row->* to <row>.
move-corresponding <flight> to <row>.
append <row> to <table>.
endloop.
l_node->bind_table( <table> ). -
Hi,
Steps which I underwent for context mapping is:
1. Opened view designer for start view .
2. Choose the context tab.
3. Opened the context menu for the root node context n choosed the option New->Value attribute.
4. entered the name for the attribute such as name n choosed finish.
5. From the context menu for the attribute Name choose Edit Context Mapping.
Problem is in my case "edit context mapping" is disable.
RegardsHi
u have to add the Component Controller In the required Controllers List of the view
thwn u fill find the it enabled.
Suppose u want to map the value Attribute in the view to that of the Attribte in the Component Controller then add that ComponentContolle Name in the required Controllers of the view
ur Component controler shuld also have the Value Attribute of same data type.
u can go properties of the View there u have required Controllers and Add Button click on that and add ur controller Name -
Creating Dynamic UI Elements in Web Dynpro ABAP
Hi,
I want to an application in which the context nodes and the UI Elements for the second screen get created dynamically at run time based on the input on the first screen
First i have used this method :
cl_wd_dynamic_tool=>create_nodeinfo_from_struct()
to create the dynamic context nodes.
I have checked in debugger and the dynamic context node is getting creates successfully.
I have saved the reference for the context node in DYN_NODE.
Now for creating the dynamic UI Elements corresponding to the attributes of this context node, i call the method :
cl_wd_dynamic_tool=>create_form_from_node(
ui_parent = group_1
node = dyn_node
inputlength = 20 ).
But this thing is dumping.
This is the dump.
The following error text was processed in the system CG7 : Adapter error in &VIEW_ELEMENT_TYPE& "BP_ICLIENT" of view "ZWD_ONLINE_FORMS.FINAL_VIEW": Context binding of property VALUE cannot be resolved: Node FINAL_VIEW.1.BP does not contain any elements
Where BP_ICLIENT is the first attribute of the dynmaic context node BP created..
Please Help.
Thanks
ShiviRefer this wiki :
https://wiki.sdn.sap.com/wiki/display/WDABAP/CreatingUIElementsDynamicallyinAbapWebdynpro+Application
More links are available on SDN reg Dynammci UI creations :
Have a look at the documentation for the WDDOMODIFYVIEW section of the phase model:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d2/8acd409cc4dd50e10000000a1550b0/frameset.htm
There is also the class CL_WD_DYNAMIC_TOOL:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/67/6935425394033be10000000a1550b0/frameset.htm
Also have a look at the example application DEMODYNAMIC.
eLearning on the topic here as well:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/201ddd3b-b4ce-2b10-8883-880ae8147f89
Edited by: Saurav Mago on Oct 26, 2009 12:23 PM -
Dynamic ALV columns in Web Dynpro ABAP
Hello masters:
Does anybody know how to build an ALV with dynamic columns in a WD4A?
I know how to make an ALV with a dynamic context node (dynamic DDIC structure), but it isn't the problem. First, I need to validate data entries, and then I will know how many fields I have to show.
I've been reading about interface IF_WD_CONTEXT_NODE_INFO. I think some of its methods can be useful to me. Can you help me to solve that?
Thanks.Hi Rodrigo,
There are two ways for it:
1) Creating an attribute dynamically under the Staticly defined node.
2) Creating a new node dynamically with your desired columns in it.
I am explaining the second process, Here it as follows:
1. Create a WDC, and use the component SALV_WD_TABLE.
2. Create a node in the context to store the defined strucutre name.
3. Read the node and set the structure name to that node from which you want to get the columns.
4. Use this structure name and create a new node dynamically.
5. Set the data to this dynamically created node.
6. Set this context node to ALV.
Here is the sample code:
To get the strcutre from where you want to fecth the fields.
tabname_node->get_attribute( Exporting name = 'TABLENAME'
Importing value = tablename ).
translate tablename to upper case.
*create sub node named TEST1 of structure (tablename)
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = tablename
structure_name = tablename
is_multiple = abap_true ).
DATA: stru_tab type ref to data.
field-symbols: <tab> type table.*Create Internal Table
create data stru_tab type table of (tablename).
assign stru_tab->* to <tab>.*Get table content
select * from (tablename) into corresponding fields of table <tab>.*get instance of new node
dyn_node = wd_context->get_child_node( name = tablename ).*Bind Internal table to context node.
dyn_node->bind_table( <tab> ).*instantiate alv component
data: l_ref_cmp_usage type ref to if_wd_component_usage.l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.*pass context node to alv
data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
l_ref_interfacecontroller->set_data( dyn_node ).
Hope it helps..
Good day!
Regards,
Shashikanth. D -
Portal dynamic iView from Web Dynpro ABAP?
I wish to use a "Dynamic iView" from a Web Dynpro ABAP application, but it appears the API is only available in Web Dynpro Java. Can this feature be used from Web Dynpro ABAP, or can this be accomplished in another way?
Scenario: I have two iViews on a page, one Web Dynpro ABAP and another iView whose source I want to change dynamically based on something a user clicks in the Web Dynpro ABAP.
Dynamic iView:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/a72c155df77038e10000000a422035/frameset.htmSo you are suggesting the WDA fires an event to a new WDJ that we would need to create that would in turn use the Dynamic iView service mentioned in that help document?
-
Dynamic radio button in web dynpro abao
Hi expert,
I want to dynamic radio button by web dynpro abap .
Kindly give me a soulation ASAP.
Thanks and regard's
Vikashhi,
method wddomodifyview .
if first_time eq abap_true.
data: LR_CONTAINER type ref to CL_WD_UIELEMENT_CONTAINER,
LR_RADIOBUTTON1 type ref to CL_WD_RADIOBUTTON,
LR_RADIOBUTTON2 type ref to CL_WD_RADIOBUTTON,
LR_FLOW_DATA type ref to CL_WD_FLOW_DATA.
" bind text property will give TEXT that appears next to Radio Button
CALL METHOD cl_wd_radiobutton=>new_radiobutton
EXPORTING
bind_selected_key = '01'
BIND_TEXT = 'saurav'
receiving
control = LR_RADIOBUTTON1.
" bind text property will give TEXT that appears next to Radio Button
CALL METHOD cl_wd_radiobutton=>new_radiobutton
EXPORTING
bind_selected_key = '02'
BIND_TEXT = 'mago'
receiving
control = LR_RADIOBUTTON2.
LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_RADIOBUTTON1 ).
LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_RADIOBUTTON2 ).
LR_CONTAINER ?= view->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).
LR_CONTAINER->ADD_CHILD( LR_RADIOBUTTON1 ).
LR_CONTAINER->ADD_CHILD( LR_RADIOBUTTON2 ).
endif.
endmethod.
Thanx. -
Dynamic context in web dynpro abap: recursion node is possible?
Hi,
i'm working with web dynpro ABAP and I need to create a dynamic recursion node. Is possible?
thank you.
Regards.
AlHello Saravanan,
this is my code that creates a context node with recursion node, but supply_method i never called. why? could you help me?
CALL METHOD lr_root_info->add_new_child_node
EXPORTING
name = y_name
is_mandatory = abap_false
is_multiple = abap_true
is_mandatory_selection = abap_false
is_multiple_selection = abap_true
is_singleton = abap_true
is_initialize_lead_selection = abap_true
is_static = abap_true
supply_method = 'SUPPLY_NAV_LIST'
RECEIVING
child_node_info = lr_node_info.
ls_attribute-name = 'TEXT'.
ls_attribute-type_name = 'STRING'.
CALL METHOD lr_node_info->add_attribute
EXPORTING
attribute_info = ls_attribute.
ls_attribute-name = 'ENABLED'.
ls_attribute-type_name = 'WDY_BOOLEAN'.
CALL METHOD lr_node_info->add_attribute
EXPORTING
attribute_info = ls_attribute.
lr_node_info->add_recursive_child_node( child_name = y_name_nav child_info = lr_node_info is_static = abap_false ).
Thank you.
Al -
Adding rows in web dynpro ABAP Dynamic Interactive form.
Hi Experts,
I am having problem in web dynpro ABAP Dynamic Interactive form.
This is my scenario....
I have a dynamic interactive form that has buttons to add and remove rows in a table. It works fine when I preview it , but when I render, view or save it using ADS, it no longer works. The "add" button actually does instantiate more repeating rows, because I put some trace messages in to count them, but the added rows are not displayed. How do I make them visible?
In web dynpro java we write some coding in modify view to set the pdf form as dynamic
IWDInteractiveForm iForm =
(IWDInteractiveForm)view.getElement("<ID>");
iForm.setDynamicPDF(true);
simillarly what we need to write in web dynpro ABAP.
Please give me solution for the same.
Thanks,
Sathishhi all,
expecting reply from u all. pls help me and give some sugesstion.
regards,
vinoth. -
Reading Dynamic Table Values in interactive form (web Dynpro ABAP)
Hi All,
I have created a Web Dynpro ABAP application which contains an Interactive Form, That Adobe Interactive Form contains Dynamic table (New rows can be added manually and deleted using a button).
I am not able to read the Dynamic table values in Web Dynpro u201COn Submitu201D.
In the Adobe form I have web Dynpro native button (I am using ZCI), while clicking the native button I need to read the dynamic table values.
How can I resolve this problem.
Thanks and Regards,
Boopathi Mthat means, when u add the table instance at runtime, you will also have to add an element to the node that is bound to the table.
probably addNew() mathos may be useful to you.
it appends a new record to the record set.
xfa.sourceSet.dataConnectionName.addNew()
also when on the exit event of the table field, do the following:
var i = xfa.parent.index
$record.rootnodename.tablenodename.data<i>.fieldname = $.rawValue
xfa.host.messageBox($record.rootnodename.tablenodename.data<i>.fieldname) -
Set Context From Event Handler in Web Dynpro ABAP
Hi,
I am passing some parameters when navigating from one view to another. Now I would like to set the context of the second view. How can I achieve that in Web Dynpro ABAP?
Thanks.
/ ElvezI figured out ...
element->set_attribute(
exporting name = `NAME`
value = value ). -
Web dynpro Abap - Adobe Form Table Dynamic
hi Friends ,
I created one table in ADOBE interactive form and i kept two button for row add and row delete in table
it is working fine in Adobe fomr Preview form
but i deployed in Web dynpro abap this functionality is not working is there any reason
Pls give suggestion
Regards
Krishnan R.Krishnan,
Check if the form is Interactive and also have you installed Adobe Reader Rights on the server. If not please check note 736902 and ask BASIS to apply them.
Chintan
Maybe you are looking for
-
This is probably my fourth post about this. My Zen Touch will just not keep working. It wont turn at all unless i reset it 4 times a day. and i just did a disk clean up and it still is being a pain. do you think it could be my firmware? i would have
-
GetCodeBase() stopped working on WWW
I have a Java program that has a LOAD option so users can load data files. In the load function I have code like this: JFileChooser chooser = new JFileChooser(); URL baseURL = getCodeBase(); c_strDirectory = baseURL.toString(); baseDir = new File(c_s
-
Error with Constrain to crop check box
Sometimes when i click on contrain to crop check box and go to the next photo it will automatically uncheck itself. When i go back to image the box is unchecked, but the crop is still constrained. Then when i check the box again in becomes unconstrai
-
I have a Crystal Report file and want to convert it to a .PDF document. Does anyone have any idea on how to do that using vbscript?
-
FCP won't launch! Help!
Using FCP 5.0.4 and it was working fine this morning but won't launch this evening. I just updated to the latest OS, FCP, QT etc and still no luck. The program starts it's launch sequence and just disappears part way through (right aroung the rt sett