Code to create dynamic context elements
Dear Guys,
I have create a dynamic text edit using the following code in abap webdynpro.
I have created a transparent container named PREREPLY set to grid layout and created a context REPLY type string and in WDDOMODIFYVIEW view i have written the following
data : lr_container type ref to cl_wd_uielement_container,
lr_comment type ref to cl_wd_text_edit.
lr_container ?= view->get_element( 'PREREPLY' ).
lr_comment = cl_wd_text_edit=>NEW_TEXT_EDIT( BIND_VALUE = 'REPLY'
COLS = 70
ID = 'PREREPLIES2'
STATE = 01 ).
lr_comment->BIND_VALUE( 'REPLY' ).
cl_wd_grid_data=>new_grid_data( element = lr_comment ).
lr_container->ADD_CHILD( lr_comment ).
i am able to see a new textedit when i run my application.
Now I want to create the context also dynamically, because i will not know how many text edit will be there. Based on the number of lines in the internal table i want the create the context and textedits dynamically.
Give me the code to create context dynamically in abap webdynpro.
Regards,
Shamila
Hi Sharmila,
Just go through this sample code snippet which does the following.
1) It dynamically creates a context node named CHILD and then creates 4 attributes ATTR1, ATTR2,..
2) Creates a GROUP UI element with a caption attached to it
3) Create 4 textEdit UI elements bound to the 4 context attributes created earlier and embed them within the group
METHOD wddomodifyview.
DATA: lr_container TYPE REF TO cl_wd_uielement_container,
lr_group TYPE REF TO cl_wd_group,
lr_caption_group TYPE REF TO cl_wd_caption,
lr_textedit TYPE REF TO cl_wd_text_edit,
lr_node_info TYPE REF TO if_wd_context_node_info,
lr_node TYPE REF TO if_wd_context_node,
lr_element TYPE REF TO if_wd_context_element,
lr_attribute_info TYPE wdr_context_attribute_info,
content TYPE string,
attribute_name TYPE string,
lv_textview_id TYPE string.
CHECK first_time = abap_true.
lr_node_info = wd_context->get_node_info( ).
CALL METHOD lr_node_info->add_new_child_node
EXPORTING
name = 'CHILD'
is_mandatory = abap_false
is_multiple = abap_true
is_multiple_selection = abap_true
is_singleton = abap_false
is_initialize_lead_selection = abap_true
is_static = abap_false
RECEIVING
child_node_info = lr_node_info.
lr_container ?= view->get_root_element( ).
cl_wd_matrix_layout=>new_matrix_layout( container = lr_container ).
lr_group = cl_wd_group=>new_group( id = 'GROUP' ).
lr_group->set_width( value = '50%' ).
cl_wd_matrix_layout=>new_matrix_layout( container = lr_group ).
cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_group ).
lr_caption_group = cl_wd_caption=>new_caption( text = 'Group Header' ).
lr_group->set_header( the_header = lr_caption_group ).
DO 4 TIMES.
MOVE sy-index TO attribute_name.
** Preparing the data to be displayed in the textEdit i.e, data for context attribute
CONCATENATE 'This'
'is the'
'data for textEdit number: '
attribute_name INTO content SEPARATED BY cl_abap_char_utilities=>newline.
CONCATENATE 'ATTR'
attribute_name INTO attribute_name.
** Condense the ID to ensure that the format is consistent with SAP standard
CONDENSE attribute_name NO-GAPS.
** Prepare properties of attribute & add to context node CHILD
lr_attribute_info-name = attribute_name.
lr_attribute_info-type_name = 'STRING'.
lr_attribute_info-value_help_mode = '0'.
lr_node_info->add_attribute( EXPORTING attribute_info = lr_attribute_info ).
lr_node = wd_context->get_child_node( name = 'CHILD' ).
lr_element = lr_node->create_element( ).
lr_element->set_attribute( name = attribute_name
value = content ).
lr_node->bind_element( new_item = lr_element
set_initial_elements = abap_false ).
** Compute the attribute path dynamically i.e, like CHILD.ATTR1
CONCATENATE 'CHILD.'
attribute_name INTO attribute_name.
CONDENSE attribute_name NO-GAPS.
lr_textedit = cl_wd_text_edit=>new_text_edit( cols = 10
rows = 5
width = '90%'
bind_value = attribute_name ).
cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_textedit ).
lr_group->add_child( the_child = lr_textedit ).
ENDDO.
lr_container->add_child( the_child = lr_group ).
ENDMETHOD.
Hope that you can manage to go through this & try change it to suit your requirement.
Regards,
Uday
Similar Messages
-
How to create dynamic context based on a structure defined in the program?
Hi Experts,
I need to create a dynamic context based on a structure wa_struc which i have define programatically.
When I pass wa_struc to structure_name parameter of create_nodeinfo_from_struc, i get a runtime error:
"Parameter STRUCTURE_NAME contains an invalid value wa_struc."
How to create dynamic context based on a structure defined in the program?
I have written the code like this:
TYPES: BEGIN OF t_type,
v_carrid TYPE sflight-carrid,
v_connid TYPE sflight-connid,
END OF t_type.
Data: i_struc type table of t_type,
wa_struc type t_type.
data: dyn_node type ref to if_wd_context_node.
data: rootnode_info type ref to if_wd_context_node_info.
rootnode_info = wd_context->get_node_info( ).
clear i_struc. refresh i_struc.
select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = 'dynflight'
structure_name = 'wa_struc'
is_multiple = abap_true ).
dyn_node = wd_context->get_child_node( name = 'dynflight' ).
dyn_node->bind_table( i_struc ).
Thanks
Gopal
Message was edited by: gopalkrishna baligaHi Michelle,
First of all Special thanks for your informative answers to my other forum questions. I really appreciate your help.
Coming back to this question I am still waiting for an answer. Please help. Note that my structure is not in a dictionary.
I am trying to create a new node. That is
CONTEXT
- DYNFLIGHT
CARRID
CONNID
As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
Also I cannot define the structure in the ABAP dictionary because it changes based on condition
I have updated my code like the following and I am getting error:
TYPES: BEGIN OF t_type,
CARRID TYPE sflight-carrid,
CONNID TYPE sflight-connid,
END OF t_type.
Data: i_struc type table of t_type,
dyn_node type ref to if_wd_context_node,
rootnode_info type ref to if_wd_context_node_info,
i_node_att type wdr_context_attr_info_map,
wa_node_att type line of wdr_context_attr_info_map.
wa_node_att-name = 'CARRID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
insert wa_node_att into table i_node_att.
wa_node_att-name = 'CONNID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
insert wa_node_att into table i_node_att.
clear i_struc. refresh i_struc.
select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
rootnode_info = wd_context->get_node_info( ).
rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
attributes = i_node_att
is_multiple = abap_true ).
dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
dyn_node->bind_table( i_struc ).
l_ref_interfacecontroller->set_data( dyn_node ).
But now I am getting the following error :
The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
-Gopal
Message was edited by: gopalkrishna baliga -
How to create a context element
Hai,
How can i create a context element for a view dynamically.
regards,Hi,
Context element or context attribute?
For context element use appropriate method in your IWDNode implementation and after creation call add method of node.
For context attribute - see appropriate tutorial : https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial on dynamic programming of web dynpro applications - 17.htm
Best regards, Maksim Rashchynski. -
Can't create dynamic html elements with jsp????? important
Hi All,
I am having problem creating dynamic html elements with jsp tags, i have tried to use EL and java scriplet, both of them don't work.
i am trying to create dynamic menu in my "rightMenu.jspf", based on, if user has logged in or not.
some like this!
<jsp:if test ="${validUser == null}">
some simple text menu here
</jsp:if>
but it is not working. it simply loading all and images with in statement, regardless of whether user has logged in or not. i think some how if statement is not working properly.
"validUser" is a session bean, which is not creating at this point, it will created when user will log in successfully. and also this session bean does not exist at the page, where i am trying to check that .
Is there any way to create dynamic values in jsp. It is really important, is there any body who help me in this matter. i would be really grateful.
zamanhi jaspre,
thanks for replying me. you know what, is it not something wrong with web.xml file. i remember once, i deleted some from there, a property with "*.jsp". i can't remember what exactly was it though.
all if statements works on files ending with extension ".jsp" but don't work only on with extension ".jspf". there must be to do with this.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>ValidateServlet</servlet-name>
<servlet-class>ValidateServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ValidateServlet</servlet-name>
<url-pattern>/ValidateServlet</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>pollAndCometEnabled</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
main.jsp
</welcome-file>
</welcome-file-list>
</web-app>
if any one can figure it out. i would be grateful.
zaman -
Error creating dynamic context node in Webdynpro for ABAP. Plesae help!
Hi
I am getting the following error while creating a dynamic context node with 2 attributes. Please help me resolve this problem.
Note
The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
My code is like the following:
TYPES: BEGIN OF t_type,
CARRID TYPE sflight-carrid,
CONNID TYPE sflight-connid,
END OF t_type.
Data: i_struc type table of t_type,
dyn_node type ref to if_wd_context_node,
rootnode_info type ref to if_wd_context_node_info,
i_node_att type wdr_context_attr_info_map,
wa_node_att type line of wdr_context_attr_info_map.
wa_node_att-name = 'CARRID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
insert wa_node_att into table i_node_att.
wa_node_att-name = 'CONNID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
insert wa_node_att into table i_node_att.
clear i_struc. refresh i_struc.
select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
rootnode_info = wd_context->get_node_info( ).
rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
attributes = i_node_att
is_multiple = abap_true ).
dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
dyn_node->bind_table( i_struc ).
l_ref_interfacecontroller->set_data( dyn_node ).
I am trying to create a new node. That is
CONTEXT
- DYNFLIGHT
CARRID
CONNID
As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
Also I cannot define the structure in the ABAP dictionary because it changes based on conditionOk, I think I found a bug... It seems for adobe forms in WD4A, the root context node must be 1-1 and you must nest the 1-n node within that... Not sure why, but it worked. So in my case my context would look like this:
FOO_NODE (1-1)
Widget (1-N)
-Widget_info (1-1)
*Name
*Sku
*Description
-Widget_plant (1-M)
*Plant_Code
*Plant_State
*Plant_City
-Widget_pic (1-1)
*Picture -
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 -
Hi Experts,
i want to create fileupload,dropdown,inputfield,checkbox,,...etc , my requirement is ,when i click one button that time only i want to create dynamically one ui element,then when i click the second button that time second ui element is created
Please tell me how can i do that,its urgent
Regards,
Sundaresanhi,
Create the Ui elements Dybamically in the Domodify Method of the view as
IWDGroup group = (IWDGroup) View.getElement("ID of the Group") ;
IWDInputField input = view.createElement(IWDInputField.class);
input.setLength(20);
input.bindValue("DynamicNode.input");
group.addElement(input);
In the Similar way u can create all the Ui elements .
create a Context Attributr of type WDVisibilty.
Bind the Visible Property of ythe Ui element to this Context Attribute.
finally in the doinit ,method set the First ui element to WDVisibilty.Visible.
and set the visible property of others ui elements to WDVisibilty.none.
finally in the Action of first ui element set the second Second Ui element to WdVisibility.Visisble. and so on.
Thanks and regards,
Fistae -
How to create dynamic list element in Site Studio designer?
Hi all,
I have installed the Site Studio Designer(10gR4).The dynamic list element that i have added in the contributor region executes a query to search and display all the files in a particular folder.In the contributor mode when i try to add/edit the dynamic list element it gives an error saying :
Unable to perform the action due to the following reasons:
[+] Unable to retrieve search results. Unable to retrieve search results. Unable to create result set for query 'SELECT IdcColl2.dID, dDocName, dDocTitle, dDocType, dRevisionID, dSecurityGroup, dDocAuthor, dDocAccount, dRevLabel, dFormat, dOriginalName, dExtension, dWebExtension, dInDate, dOutDate, dCreateDate, dPublishType, dRendition1, dRendition2, VaultFileSize, WebFileSize, URL, dFullTextFormat, dFullTextCharset, DocMeta.* FROM IdcColl2, DocMeta WHERE IdcColl2.dID=DocMeta.dID AND (((((( xCollectionID >= 14 AND xCollectionID <= 14 ) AND NOT ( (CONTAINS(xDontShowInListsForWebsites, '{DIPP_Sample}') > 0) )))))) ORDER BY dDocTitle desc'. ORA-20000: Oracle Text error: DRG-10599: column is not indexed
I have enabled the full-text search on the content server and also included xWebsites and xWebsiteObjectType columns to be full indexed in the Zone Fields Configuration.Is there any other setting to be done?Please help.
Thanks,
nithyaHi
Include the xDontShowInListsForWebsites also from the zone filed and then update it.Then test it out.
Hope it helps
Srinath -
Hi Experts,
I have tried the given example for Dynamic Context Node in Webdynpro ABAP
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4c70444a-0801-0010-7688-9e4bd844b783
But getting the Error when executing this application
Note
The following error text was processed in the system ISP : Adapter error in &VIEW_ELEMENT_TYPE& "TABLENAME" of view "ZWD_SACHIN_DYN_ALV.MAIN_VIEW": Context binding of property VALUE cannot be resolved: Node MAIN_VIEW.1.INPUT does not contain any elements
The error occurred on the application server usirs254_ISP_01 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: RAISE_FOR of program CX_WDR_ADAPTER_EXCEPTION======CP
Method: RAISE_BINDING_EXCEPTION of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
Method: GET_BOUND_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
Please resolve this issue because when I am mapping the Attribute TableName in the InputGroup, it is throwing above Error.
Thanks in advance
Regards
SachinHi Sachin,
I am unable to understand why you are getting an error. I have tried the same tutorial myself and it works fine for me. Make sure that the TABLENAME attribute (which is of string type) is properly binded to the value property of the input field.
Regards
Arjun
Edited by: Arjun Thakur on Mar 17, 2009 1:46 PM -
How to create the Dynamic UI element table in web dynpro in abap
Hi All,
Does anybody have reference note or teach me how to create dynamic UI element table in web dynpro in abap ?
Regards,
LukeHI LukeWong ,
for creating any UI dynamically you shoul use their runtime class that always start with cl_wd_* ui element name*
so for the Table UI element the runtime class is CL_WD_TABLE
now reffer the below code for creating the Table UI dynamically
METHOD wddomodifyview.
DATA lr_table TYPE REF TO cl_wd_table.
DATA lr_flow_data TYPE REF TO cl_wd_flow_data.
DATA lr_container TYPE REF TO cl_wd_uielement_container.
DATA lr_column_name TYPE REF TO cl_wd_table_column.
DATA lr_text_view TYPE REF TO cl_wd_text_view.
DATA lr_table_header TYPE REF TO cl_wd_caption.
DATA lr_column_name_header TYPE REF TO cl_wd_caption.
IF first_time EQ abap_true.
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_table = cl_wd_table=>new_table(
id = 'TBL_TABLE'
bind_data_source = 'TABLE'
design = cl_wd_table=>e_design-alternating
visible_row_count = 3
lr_flow_data = cl_wd_flow_data=>new_flow_data( element =
lr_table ).
lr_container->add_child( lr_table ).
lr_column_name = cl_wd_table_column=>new_table_column(
id = 'TBL_EXAMPLE_NAME'
lr_table_header ?= cl_wd_caption=>new_caption( text = 'Table UI elem
ent - example').
lr_table->add_column( the_column = lr_column_name ).
lr_table->set_header( lr_table_header ).
lr_text_view = cl_wd_text_view=>new_text_view(
id = 'TXV_NAME'
bind_text = 'TABLE.NAME'
lr_column_name_header ?= cl_wd_caption=>new_caption( text = 'Name').
lr_column_name->set_table_cell_editor( the_table_cell_editor = lr_text_view).
lr_column_name->set_header( lr_column_name_header ).
ENDIF.
ENDMETHOD.
Regards
Chinnaiya P
Edited by: chinnaiya pandiyan on Sep 17, 2010 12:01 PM -
Dynamic Context Dynamic and UI table Dynamic
Hello,
I created a dynamic context and a dynamic table that use this dynamic context. I have the following error:* * The following error text was processed in the system XAP : Could not find attribute AMOUNT2009**
The error occurred on the application server sat190_XAP_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WD_CONTEXT_NODE_INFO~GET_ATTRIBUTE of program CL_WDR_CONTEXT_NODE_INFO======CP
Method: GET_ATTRIBUTE_INFO of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
AMOUNT2009 is a new attribute that add to my context, i made the next code, can you review and say me where i have the error? I start with the second year is for this reason that i use a count.
Reading FINCATYGROUP
DATA lo_nd_fincatygroup TYPE REF TO if_wd_context_node.
DATA lo_el_fincatygroup TYPE REF TO if_wd_context_element.
DATA ls_fincatygroup TYPE wd_this->element_fincatygroup.
DATA : lv_year type STRING,
ls_attribute type wdr_context_attribute_info, "To create dynamic node in the context
lr_container TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
lr_table TYPE REF TO CL_WD_TABLE,
lr_input_field TYPE REF TO CL_WD_INPUT_FIELD,
lr_cell_editor TYPE REF TO if_wd_table_cell_editor,
lr_column TYPE REF TO CL_WD_TABLE_COLUMN,
lr_column_header TYPE REF TO CL_WD_CAPTION,
lv_headerColumn TYPE STRING,
lv_id_input_field TYPE STRING,
lv_name TYPE STRING,
lv_id_table_column TYPE STRING.
DATA: lr_node_info TYPE REF TO if_wd_context_node_info, "To get node info
lr_table_type TYPE REF TO cl_abap_tabledescr, "To get table and stuct descriptor
lr_line_type TYPE REF TO cl_abap_structdescr,
lt_components TYPE cl_abap_structdescr=>component_table, "To get component table
ls_components_line LIKE LINE OF lt_components, "One line of component table
lr_elem_type TYPE REF TO cl_abap_elemdescr.
LOOP AT lv_periods_tt INTO lv_periods_ts.
get all declared attributes
lv_periods_ts->get_static_attributes(
IMPORTING
static_attributes = ls_wa_period ).
navigate from <CONTEXT> to <FINCATYGROUP> via lead selection
lo_nd_fincatygroup = wd_context->get_child_node( name = wd_this->wdctx_fincatygroup ).
IF lv_cont = 1 OR lv_cont = 2.
lv_cont = lv_cont + 1.
ELSE.
Create dynamic context and dynamic view
get node_info
lr_rootnodeinfo = lo_nd_fincatygroup->get_node_info( ).
lv_year = ls_wa_period-zyear.
SHIFT lv_year BY 15 PLACES LEFT.
CONCATENATE 'AMOUNT' lv_year INTO lv_name.
put attributes of add_attrbute node
CONCATENATE 'Y' lv_year INTO ls_attribute-name.
ls_attribute-name = lv_name.
ls_attribute-type_name = '\TYPE=/RPM/TV_CURR_AMOUNT'.
lr_rootnodeinfo->add_attribute( "Add attribute for amount of year
EXPORTING
attribute_info = ls_attribute ).
********************* table *******************************************************
Get ROOTUIELEMENTCONTAINER
lr_container ?= view1->get_element( 'ROOTUIELEMENTCONTAINER ' ).
Get TABLEFCG
lr_table ?= view1->get_element( 'TABLEFCG' ).
Create cell_editor
CONCATENATE 'TABLEFCGIF_Y' lv_year '_EDITOR' INTO lv_id_input_field.
lr_input_field = cl_wd_input_field=>new_input_field(
id = lv_id_input_field bind_value = ls_attribute-name ).
CONCATENATE 'TABLEFCG_Y' lv_year '_EDITOR' INTO lv_headerColumn.
lr_column_header = cl_wd_caption=>new_caption( id = lv_headerColumn ).
lr_column_header->set_text( ls_attribute-name ).
Create table column
CONCATENATE 'TABLEFCG_' lv_year 'COLUMN' INTO lv_id_table_column.
lr_column = cl_wd_table_column=>new_table_column( id = lv_id_table_column ).
lr_column->set_table_cell_editor( lr_input_field ).
lr_column->set_header( lr_column_header ).
lr_table->add_grouped_column( lr_column ).
********************* end table *******************************************************
ENDIF.
ENDLOOP.
Thanx.1.
Code if the Transparent container's layout is Matrix ( method WDDOMODIFYVIEW )
data lr_container type ref to cl_wd_transparent_container.
data lr_input type ref to cl_wd_input_field.
data lr_layout_data type ref to cl_wd_matrix_head_data.
lr_container ?= view->get_element( '<Transparent container ID>' ).
lr_input = cl_wd_input_field=>new_input_field( bind_value = '<node>.<attribute>'
view = view
ID = 'INP' ).
lr_layout_data = cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_input width = '100%' ).
2.
Dynamic Context Attribute in a node.
data lr_node type ref to if_wd_context_node.
data lr_info type ref to if_wd_context_node_info.
data ls_attr type WDR_CONTEXT_ATTRIBUTE_INFO.
lr_node = wd_context->get_child_node( '<Node_name>' ).
lr_info = lr_node->get_node_info( ).
ls_attr-name = '<attribute_name>'.
ls_attr-type_name = 'STRING'.
lr_info->add_attribute( ls_attr ). -
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 -
Creating dynamic jdbc pools in WLS 5.10
Looking for pointers and/or sample code for creating dynamic connection pool using weblogic 5.10 SP9.
We are using oracle jdbc thin drivershttp://www.weblogic.com/docs51/classdocs/conn_pools.html#638923
Mehul Parikh wrote:
Looking for pointers and/or sample code for creating dynamic connection pool using weblogic 5.10 SP9.
We are using oracle jdbc thin drivers -
How to create dynamic data tables with ADF 10g
Hi,
Can anyone provide sample code for creating dynamic data table in adf where column & row will be added dynamically according to the data coming from the Array List of data.
I appreciate your help here.I think you've posted to the wrong forum. This one is for WebLogic Portal questions.
Try the ADF/DVT forum:
http://myforums.oracle.com/jive3/forum.jspa?forumID=1565 -
Hello All,
Can Anyone help me to create Dynamic Dictionary Element. Runtime, I want to create a Simple Type data element in Dictionary, which can be binded to a RadioGroup ui element. So that Enumeration data can be added Runtime for that dictionary element.
Is there any Java Docs for WebDynpro SAP packages.
Help !!!Please check the tutorial
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/value help in web dynpro applications.pdf
Regards, Anilkumar
Maybe you are looking for
-
Can't get the album info into my itunes automatically
I know the info for the cds i'm adding to my library is available but it won't come up. i have checked consolidate library but still won't work.
-
No mater what I do, I'm getting an incompatible format error when importing .mov files into DVD SP4. I've tried several different .mov files, created on export from FCP as a self contained quicktime movie. The file is NTSC SD, and about 10 minutes in
-
Hello all, Our users sometimes post hours via CAT2 in a month that is already closed, SAP will create a log and the actual posting will not be made. The confirmation can be reviewed in COFC and normally they can be reprocessed via IW46. Current situa
-
Unable to resolve ORA-12154: TNS:could not resolve the connect identifier specified
Hi Friends, I am unable to resolve ORA-12154: TNS:could not resolve the connect identifier specified, error: C:\Windows\system32>sqlplus scott/tiger@ORADATA SQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 2 13:46:10 2014 Copyright (c) 1982, 2010,
-
Help needed badly Insert text data from xml files into tables
Hi all, I have asked to do insertion of text from a xml file into tables upon receiving using pro*c. i've done quite an amount of research on xml parser in c but there wasn't much information for mi to use for implementation... Guys don't mind helpin