Dynamic tree UI element in the view
Dear All,
Can anyone provide me with the code snippet for Dynamic Tree UI element in the view. I need to show the tree which should be generated dynamically.
Thanks alot in advance!
Points will be rewarded, Please its urgent!
Cheers,
Darshna.
Hi ,
sorry for the late reply... here is the code for onActionLoadchildren .. i am sure you wont understand this.. but lets try...
DATA:
element_parent TYPE REF TO if_wd_context_element,
lv_object_key1 type string,
lv_object_type type string.
DATA:
node_root_entry TYPE REF TO if_wd_context_node,
elem_root_entry TYPE REF TO if_wd_context_element,
stru_root_entry TYPE if_structure_view_new=>element_root_entry ,
item_valid_from LIKE stru_root_entry-valid_from,
item_plant LIKE stru_root_entry-plant,
item_equi_key LIKE stru_root_entry-equi_key,
item_object_key LIKE stru_root_entry-object_key,
item_object_type TYPE string,
item_path TYPE string,
item_parent_path TYPE string,
context_node TYPE REF TO if_wd_context_node,
root_entry TYPE if_structure_view_new=>element_selected_entry.
l_ref_componentcontroller TYPE REF TO ig_componentcontroller.
DATA:
node_root_info TYPE REF TO if_wd_context_node,
elem_root_info TYPE REF TO if_wd_context_element,
stru_root_info TYPE if_structure_view_new=>element_root_info .
DATA:
element TYPE REF TO if_wd_context_element,
node_selected_entry TYPE REF TO if_wd_context_node,
elem_selected_entry TYPE REF TO if_wd_context_element.
DATA:
ls_hier_return TYPE rplm_ts_struc_elements,
lt_hier_return TYPE TABLE OF rplm_ts_struc_elements,
ls_hier_return_temp TYPE rplm_ts_struc_elements,
lt_hier_return_temp TYPE TABLE OF rplm_ts_struc_elements,
ls_hier_level TYPE rplm_ts_hier_level,
lt_hier_level TYPE TABLE OF rplm_ts_hier_level,
ls_hier_return_sort TYPE rplm_mt_ts_hier,
lt_hier_return_sort TYPE TABLE OF rplm_mt_ts_hier.
DATA:
temp_hier_level TYPE if_structure_view_new=>element_hier_level,
lt_hier_temp TYPE TABLE OF if_structure_view_new=>element_hier_level,
lt_temp TYPE TABLE OF if_structure_view_new=>element_hier_level.
DATA:
lc_path TYPE string,
lv_object_key TYPE string.
DATA:
lv_hier_lines TYPE i.
DATA:
node_entries TYPE REF TO if_wd_context_node,
node_sub_entries TYPE REF TO if_wd_context_node,
elem_sub_entries TYPE REF TO if_wd_context_element,
stru_sub_entries TYPE if_structure_view_new=>element_sub_entries .
TYPES: BEGIN OF ls_hier_type, "structure for Hierarchy table
object(31) TYPE c, "Objectkey
predecessor(31) TYPE c, "Objectkey Predecessor
data(2000) TYPE c, "Data container
level TYPE i, "level of object in tree
successors(1) TYPE c, "Object has successors: YES/NO/U
display(1) TYPE c, "Object is displayed: YES/NO
selected(1) TYPE c, "Object is selected/marked: YES/NO
index_predec LIKE sy-tabix, "Index predecessor
strno TYPE ilom_strno,"External number for func. loc.
"in BOMs used for top object
END OF ls_hier_type.
DATA:
ls_hier TYPE ls_hier_type,
lt_hier TYPE TABLE OF ls_hier_type WITH DEFAULT KEY,
lt_mat_hier TYPE TABLE OF ls_hier_type WITH DEFAULT KEY.
" For retrieving Material Data Heirarchy
DATA:
lh_stpo_tab TYPE TABLE OF rihstpx ,
lwa_stpo_tab LIKE LINE OF lh_stpo_tab,
check_menge TYPE string ,
check_meins TYPE string ,
lwa_mat_hier LIKE LINE OF lt_mat_hier ,
lt_dup_mat_hier LIKE lt_mat_hier,
lv_len TYPE i,
lv_len_temp TYPE i .
DATA:
lv_equnr TYPE equi-equnr,
lv_tplnr TYPE iflo-tplnr,
lv_matnr TYPE mast-matnr.
DATA:
lv_cnt TYPE i,
lv_index TYPE i.
DATA:
lv_path TYPE string,
lv_parent_path TYPE string,
pos TYPE string,
separator TYPE c VALUE '.',
max_level TYPE i,
temp_level TYPE i,
counter TYPE i VALUE 1.
TYPES: BEGIN OF ls_pred_type, "structure for Hierarchy table
parent(31) TYPE c, "Objectkey Predecessor
path(2000) TYPE c, "Data container
index_predec LIKE sy-tabix, "Index predecessor
END OF ls_pred_type.
DATA:
ls_pred TYPE ls_pred_type,
lt_pred TYPE TABLE OF ls_pred_type WITH DEFAULT KEY.
DATA:
lv_int_obj_key TYPE string,
obj_len TYPE i,
lv_funcloc_ext TYPE ilom_strno,
lv_funcloc TYPE itob-tplnr.
DATA:
lv_level TYPE i,
lv_temp TYPE i,
lt_path_entries TYPE string_table.
DATA:
node_general TYPE REF TO if_wd_context_node,
elem_general TYPE REF TO if_wd_context_element,
stru_general TYPE if_structure_view_new=>element_general ,
item_collapse_visibility LIKE stru_general-collapse_visibility.
DATA:
elem_context TYPE REF TO if_wd_context_element,
stru_context TYPE if_structure_view_new=>element_context ,
item_expand_all LIKE stru_context-expand_all.
lv_path = path.
Get Element whose children shall be loaded
element_parent = wd_context->path_get_element( lv_path ).
element_parent->get_attribute(
EXPORTING
name = `OBJECT_KEY`
IMPORTING
value = LV_object_key ).
element_parent->get_attribute(
EXPORTING
name = `OBJECT_TYPE`
IMPORTING
value = lv_object_type ).
node_root_entry = wd_context->get_child_node( name = wd_this->wdctx_root_entry ).
get element via lead selection
elem_root_entry = node_root_entry->get_element( ).
get single attribute
elem_root_entry->get_attribute(
EXPORTING
name = `VALID_FROM`
IMPORTING
value = item_valid_from ).
elem_root_entry->get_attribute(
EXPORTING
name = `PLANT`
IMPORTING
value = item_plant ).
item_object_type = lv_object_type.
if lv_object_type eq 'EQUI'.
item_object_key = ''.
item_equi_key = lv_object_key.
elseif lv_object_type eq 'FUNCLOC'.
item_object_key = lv_object_key.
item_equi_key = ''.
ELSE.
lv_matnr = lv_object_key.
For BOM, material and Assembly
endif.
IF item_object_type EQ 'EQUI'.
lv_equnr = lv_object_key.
ELSEif item_object_type eq 'FUNCLOC'.
lv_tplnr = lv_object_key.
ELSE.
LV_MATNR = lv_object_key.
exit.
ENDIF.
CALL FUNCTION 'PM_HIERARCHY_CALL'
EXPORTING
datum = item_valid_from
equnr = lv_equnr
tplnr = lv_tplnr
matnr = lv_matnr
levdo = '99'
levup = '00'
sanin = 'X'
select_equi = 'X'
select_iflo = 'X'
select_stpo = 'X'
selmod = 'D'
stkkz = ''
werks = item_plant
with_equi = 'X'
with_equi_hier = 'X'
with_iflo_hier = 'X'
with_btyp = 'X'
with_mara = 'X'
with_ibase_hier = ''
capid = ''
emeng = 0
IMPORTING
et_hier = lt_hier
EXCEPTIONS
no_hierarchy = 1
no_object_defined = 2
no_selection = 3
no_valid_equnr = 4
no_valid_matnr = 5
no_valid_selmod = 6
no_valid_tplnr = 7
OTHERS = 8.
LOOP AT lt_hier INTO ls_hier.
ls_hier_return-object_key = ls_hier-object.
ls_hier_level-object_key = ls_hier-object.
ls_hier_level-predecessor = ls_hier-predecessor.
lv_len = strlen( ls_hier-object ).
IF lv_len GT 1.
lv_len_temp = lv_len - 1.
ELSEIF
lv_len_temp = lv_len.
ENDIF.
ls_hier_level-level = ls_hier-level.
IF ls_hier-object(1) = 'T'.
ls_hier_return-icon = 'ICON_TECHNICAL_PLACE'.
ls_hier_return-object_type = 'FUNCLOC'.
IF ls_hier-successors = 'Y'.
ls_hier_return-is_leaf = abap_false.
ls_hier_return-is_expanded = abap_false.
ls_hier_return-children_loaded = abap_true.
ELSE.
ls_hier_return-is_leaf = abap_true.
ls_hier_return-is_expanded = abap_true.
ls_hier_return-children_loaded = abap_true.
ENDIF.
ELSEIF ls_hier-object(1) = 'E'.
ls_hier_return-icon = 'ICON_EQUIPMENT'.
ls_hier_return-object_type = 'EQUI'.
IF ls_hier-successors = 'Y'.
ls_hier_return-is_leaf = abap_false.
ls_hier_return-is_expanded = abap_false.
ls_hier_return-children_loaded = abap_true.
ELSE.
ls_hier_return-is_leaf = abap_true.
ls_hier_return-is_expanded = abap_true.
ls_hier_return-children_loaded = abap_true.
ENDIF.
ELSEIF ls_hier-object+lv_len_temp(1) = 'M'.
ls_hier_return-icon = 'ICON_MATERIAL'.
ls_hier_return-object_type = 'MATERIAL'.
IF ls_hier-successors = 'Y'.
ls_hier_return-is_leaf = abap_false.
ls_hier_return-is_expanded = abap_false.
ls_hier_return-children_loaded = abap_false.
ELSE.
ls_hier_return-is_leaf = abap_true.
ls_hier_return-is_expanded = abap_true.
ls_hier_return-children_loaded = abap_true.
ENDIF.
ELSEIF ls_hier-object+lv_len_temp(1) = 'X'.
ls_hier_return-icon = 'ICON_SUPPLY_AREA'.
ls_hier_return-object_type = 'MATBOM'.
IF ls_hier-successors = 'Y'.
ls_hier_return-is_leaf = abap_false.
ls_hier_return-is_expanded = abap_false.
ls_hier_return-children_loaded = abap_false.
ELSE.
ls_hier_return-is_leaf = abap_true.
ls_hier_return-is_expanded = abap_true.
ls_hier_return-children_loaded = abap_true.
ENDIF.
ELSEIF ls_hier-object+lv_len_temp(1) = 'A'.
ls_hier_return-icon = 'ICON_MATERIAL_REVISION'.
ls_hier_return-object_type = 'MATERIAL'.
IF ls_hier-successors = 'Y'.
ls_hier_return-is_leaf = abap_false.
ls_hier_return-is_expanded = abap_false.
ls_hier_return-children_loaded = abap_false.
ELSE.
ls_hier_return-is_leaf = abap_true.
ls_hier_return-is_expanded = abap_true.
ls_hier_return-children_loaded = abap_true.
ENDIF.
ENDIF.
*IF ls_hier-predecessor EQ item_object_key OR ls_hier-object EQ item_object_key.
APPEND ls_hier_return TO lt_hier_return.
APPEND ls_hier_level TO lt_hier_level.
*ENDIF.
CLEAR lv_len.
CLEAR lv_len_temp.
ENDLOOP.
lt_hier_return_temp = lt_hier_return.
DESCRIBE TABLE lt_hier LINES lv_hier_lines.
IF lv_hier_lines EQ 0.
elem_selected_entry = wd_context->path_get_element( '1.ENTRIES.1' ).
Get children node
elem_selected_entry->set_attribute(
value = abap_true
name = 'IS_LEAF' ).
ENDIF.
*************************************Deleting Now***********
SORT lt_hier_level BY level DESCENDING.
LOOP AT lt_hier_level INTO ls_hier_level.
max_level = ls_hier_level-level.
EXIT.
ENDLOOP.
SORT lt_hier_level BY level ASCENDING.
LOOP AT lt_hier_level INTO ls_hier_level WHERE level EQ 0.
ls_hier_level-path = '1.ENTRIES.1'.
ls_hier_level-parent_path = '1.ENTRIES.1'.
MODIFY lt_hier_level FROM ls_hier_level.
ENDLOOP.
************************New design to Generate Path and Parent path
lv_cnt = 0.
temp_level = 1.
SORT lt_hier_level BY object_key ASCENDING.
LOOP AT lt_hier_level INTO ls_hier_level WHERE level EQ 1.
lv_cnt = lv_cnt + 1.
lv_parent_path = '1.ENTRIES.1'.
ls_hier_level-parent_path = lv_parent_path.
pos = lv_cnt.
CONCATENATE lv_parent_path separator 'SUB_ENTRIES' separator pos INTO lv_path.
ls_hier_level-path = lv_path.
MODIFY lt_hier_level FROM ls_hier_level.
ENDLOOP.
temp_level = 1.
lv_cnt = 0.
*********************Need to call this for each level ***************************
WHILE temp_level LT max_level.
CLEAR lt_pred.
CLEAR ls_pred.
LOOP AT lt_hier_level INTO ls_hier_level WHERE level EQ temp_level.
ls_pred-parent = ls_hier_level-object_key.
ls_pred-path = ls_hier_level-path.
APPEND ls_pred TO lt_pred.
ENDLOOP.
SORT lt_pred BY parent.
DELETE ADJACENT DUPLICATES FROM lt_pred.
LOOP AT lt_pred INTO ls_pred.
lv_cnt = 0.
LOOP AT lt_hier_level INTO ls_hier_level WHERE predecessor EQ ls_pred-parent.
lv_cnt = lv_cnt + 1.
lv_parent_path = ls_pred-path.
ls_hier_level-parent_path = lv_parent_path.
lv_path = ''.
pos = lv_cnt.
CONCATENATE lv_parent_path separator 'SUB_ENTRIES' separator pos INTO lv_path.
ls_hier_level-path = lv_path.
MODIFY lt_hier_level FROM ls_hier_level.
ENDLOOP.
ENDLOOP.
temp_level = temp_level + 1.
ENDWHILE.
LOOP AT lt_hier_level INTO ls_hier_level.
LOOP AT lt_hier_return INTO ls_hier_return.
IF ls_hier_level-object_key = ls_hier_return-object_key.
MOVE-CORRESPONDING ls_hier_level TO ls_hier_return.
MODIFY lt_hier_return FROM ls_hier_return.
ENDIF.
ENDLOOP.
ENDLOOP.
SORT lt_hier_return BY path ASCENDING.
**************************Delete the extra first character returned by PM_HIERARCHY_CALL******
LOOP AT lt_hier_return INTO ls_hier_return.
IF ls_hier_return-object_key(1) = 'T'.
SHIFT ls_hier_return-object_key BY 1 PLACES.
lv_object_key = ls_hier_return-object_key.
lv_funcloc_ext = lv_object_key.
CALL FUNCTION 'CONVERSION_EXIT_TPLNR_OUTPUT'
EXPORTING
input = lv_funcloc_ext
IMPORTING
output = lv_funcloc.
lv_int_obj_key = lv_funcloc.
ls_hier_return-object_key = lv_int_obj_key.
ELSEIF ls_hier_return-object_key(1) = 'E'.
SHIFT ls_hier_return-object_key BY 1 PLACES.
lv_object_key = ls_hier_return-object_key.
obj_len = strlen( lv_object_key ).
IF obj_len GE 18.
lv_object_key = lv_object_key+0(18).
ENDIF.
wd_comp_controller->conv_ext_2_int(
EXPORTING
iv_object_key_ext = lv_object_key " String
iv_object_type = 'EQUI' " String
IMPORTING
ev_object_key = lv_int_obj_key " String
SHIFT lv_int_obj_key LEFT DELETING LEADING '0'.
ls_hier_return-object_key = lv_int_obj_key.
ELSE.
SHIFT ls_hier_return-object_key BY 1 PLACES.
lv_object_key = ls_hier_return-object_key.
obj_len = strlen( lv_object_key ).
IF obj_len GE 18.
lv_object_key = lv_object_key+0(18).
ENDIF.
SHIFT lv_object_key LEFT DELETING LEADING '0'.
ls_hier_return-object_key = lv_object_key.
ENDIF.
MODIFY lt_hier_return FROM ls_hier_return TRANSPORTING object_key object_key.
ENDLOOP.
LOOP AT lt_hier_level INTO ls_hier_level.
IF ls_hier_level-object_key(1) = 'T'.
SHIFT ls_hier_level-object_key BY 1 PLACES.
lv_object_key = ls_hier_level-object_key.
lv_funcloc_ext = lv_object_key.
CALL FUNCTION 'CONVERSION_EXIT_TPLNR_OUTPUT'
EXPORTING
input = lv_funcloc_ext
IMPORTING
output = lv_funcloc.
lv_int_obj_key = lv_funcloc.
ls_hier_level-object_key = lv_int_obj_key.
ELSEIF ls_hier_level-object_key(1) = 'E'.
SHIFT ls_hier_level-object_key BY 1 PLACES.
lv_int_obj_key = ls_hier_level-object_key.
obj_len = strlen( lv_int_obj_key ).
IF obj_len GE 18.
lv_int_obj_key = lv_int_obj_key+0(18).
ENDIF.
wd_comp_controller->conv_ext_2_int(
EXPORTING
iv_object_key_ext = lv_int_obj_key " String
iv_object_type = 'EQUI' " String
IMPORTING
ev_object_key = lv_int_obj_key " String
SHIFT lv_int_obj_key LEFT DELETING LEADING '0'.
ls_hier_level-object_key = lv_int_obj_key.
ELSE.
SHIFT ls_hier_level-object_key BY 1 PLACES.
lv_int_obj_key = ls_hier_level-object_key.
obj_len = strlen( lv_int_obj_key ).
IF obj_len GE 18.
lv_int_obj_key = lv_int_obj_key+0(18).
ENDIF.
SHIFT lv_int_obj_key LEFT DELETING LEADING '0'.
ls_hier_level-object_key = lv_int_obj_key.
ENDIF.
MODIFY lt_hier_level FROM ls_hier_level TRANSPORTING object_key object_key.
ENDLOOP.
*********************Getinfo if root node else call Get_Children_Info to generate the structure as well*******
IF lv_path EQ '1.ENTRIES.1'.
element = wd_context->path_get_element( lv_path ).
navigate from <ENTRIES> to <SUB_ENTRIES> via lead selection
node_sub_entries = element->get_child_node( name = 'SUB_ENTRIES' ).
element->get_attribute( EXPORTING name = 'OBJECT_KEY'
IMPORTING value = item_object_key ).
element->get_attribute( EXPORTING name = `OBJECT_TYPE`
IMPORTING value = item_object_type ).
****************Get Info of Technical Objects*************
wd_comp_controller->get_children_info(
EXPORTING
iv_lt_list = lt_hier_return " Rplm_Tt_Mt_Struc
iv_path = ''
iv_hier_level = lt_hier_level
IMPORTING
ev_lt_full = lt_hier_return " Rplm_Tt_Mt_Struc
Create the strcuture by binding the entries to Node which is bound to the table
element = wd_context->path_get_element( lc_path ).
Get children node
node_sub_entries = element->get_child_node( 'SUB_ENTRIES' ).
CALL METHOD node_sub_entries->bind_table
EXPORTING
new_items = lt_hier_return
set_initial_elements = abap_true.
@TODO handle not set lead selection
IF ( node_entries IS INITIAL ).
ENDIF.
lv_temp = 1.
***************Sort the LT_HIER_TABLE appropriately ******
LOOP AT lt_hier_return INTO ls_hier_return .
MOVE-CORRESPONDING ls_hier_return TO ls_hier_return_sort.
ls_hier_return_sort-path_length = strlen( ls_hier_return_sort-path ).
APPEND ls_hier_return_sort TO lt_hier_return_sort.
ENDLOOP.
SORT lt_hier_return_sort BY path_length ASCENDING path ASCENDING.
CLEAR lt_hier_return.
LOOP AT lt_hier_return_sort INTO ls_hier_return_sort.
MOVE-CORRESPONDING ls_hier_return_sort TO ls_hier_return.
APPEND ls_hier_return TO lt_hier_return.
ENDLOOP.
*wd_comp_controller->gv_master_data = lt_hier_return.
LOOP AT lt_hier_return INTO ls_hier_return.
lv_path = ls_hier_return-path.
lc_path = ls_hier_return-parent_path.
IF lv_path NE '1.ENTRIES.1'.
element = wd_context->path_get_element( lc_path ).
Get children node
node_sub_entries = element->get_child_node( 'SUB_ENTRIES' ).
Now, create the children elements
element->get_attribute( EXPORTING name = 'OBJECT_KEY'
IMPORTING value = ls_hier_level-predecessor ).
Create the strcuture by binding the entries to Node which is bound to the table
CALL METHOD node_sub_entries->bind_structure
EXPORTING
new_item = ls_hier_return
set_initial_elements = abap_false.
ENDIF.
ENDLOOP.
Only when a new level is reached we create one more child node
else we attach our elements to same child node
element = wd_context->path_get_element( item_path ).
Get children node
element->set_attribute(
value = abap_false
name = 'IS_EXPANDED' ).
ENDIF.
navigate from <CONTEXT> to <GENERAL> via lead selection
node_general = wd_context->get_child_node( name = wd_this->wdctx_general ).
get element via lead selection
elem_general = node_general->get_element( ).
get single attribute
elem_general->set_attribute(
name = `COLLAPSE_VISIBILITY`
value = abap_false ).
node_selected_entry = wd_context->get_child_node( name = if_structure_view_new=>wdctx_selected_entry ).
get element via lead selection
elem_selected_entry = node_selected_entry->get_element( ).
get single attribute
elem_selected_entry->set_attribute(
name = `OBJECT_KEY`
value = '' ).
elem_selected_entry->set_attribute(
name = `OBJECT_TYPE`
value = '' ).
get element via lead selection
elem_context = wd_context->get_element( ).
get single attribute
elem_context->set_attribute(
name = `EXPAND_ALL`
value = abap_false ).
wd_this->enable_buttons(
endmethod.
Similar Messages
-
How to Return the Index of a Mouse-Selected Array Element in the View Interface of Diadem
Hello,
Does anybody have an idea of how to obtain the index of a mouse-selected array element in the View interface of Diadem??
Thanks!Hi Ovidius,
Keep explaining. The only way I know of to trap a selected cell value in VIEW is to embed into the desired VIEW area a second non-modal SUDialog that has a Table control or an XTable control displaying the values of certain data channels. There are callbacks in both table controls for cell selection, and you can configure the table control to allow only single cell selection if that's what you want. The regular table control will be easier to program, but the XTable control will perform much better for larger channels.
But what happens with that value the user selected? Is it used for a calculation? Is it added to a report? Why would the user select that cell in a table rather than selecting the corresponding feature in a graph with the crosshair cursor?
Brad Turpin
DIAdem Product Support Engineer
National Instruments -
The UI element of the view will be desplaying in desable mode
Hi,
I have developed an application which is in the SAP Help Creating an Email Client Using Web Dynpro and Web Services.
Followed as it is steps in that example.
it has deployed without any errors,
but when we run the application its displaying all the UI Elements in disable mode.
could any one help on this,
Thanks & Regards,
Ravinder Jilla.Hi
In supply function you are itself creating an element of node. no need to create it again.
By writing only following code you can create a node element which can enable all UI elements.
// In Supply function
node.addElement(node.create<your node>Element());
Other wise you can also do this in wdDoInit() of view controller
IPrivateView<your View>.I<your node>Element() element = wdContext.create<your node> element();
wdContext.node<your node>().addElement ( element );
this will create an element of your node and enable UI element bound to it.
Try the latter one and let me know the status
Mandeep Virk -
ABAP webdynpro how to give spacing between the UI Elements in a view
Hi Expert,
I am very new to webdynproapplication development. I am stuck in changing the look of the ui elements of the view.
Cud anyone explain how to set the spaces between the UI Elements on a View is there any method ?
I have set the Layout property to Matrix layout. But here I am unable to set the spacing between the deffernet elements as it is taking it automaticaaly and I am not able to allign all the Elements.
Need your help!.............thank you
Moderator message: wrong forum, please have a look in the dedicated "Web Dynpro ABAP" forum.
Edited by: Thomas Zloch on Apr 15, 2011 10:17 PMHi anushree.,
If u are using matrix layout:
In Layout Data select MatrixHeadData to display UI in next line.,
If u want to give space between UI elements in the width enter 50, 60, 70 or what ever space u want.
Also in the vGutter u can select medium , large , medium with rule to give space between UI elements.
n if u want to give space between lines ., in the height enter 30 40 or whatever spacing between lines u want.,
Matrix layout is a good layout., and u can play with colspan , hAlign, vAlign, vGutter, width and height options.,
If u dont like the layout with these options then use Grid layout., where u can give custom spacing., with the help of Left Padding, Right Padding, Top Padding, Bottom Padding.
reply if u need some more clarifications.,
Thanks & Regards
Kiran -
How to hide columns that are getting added dynamically to UI Element 'Table
In SRM 7.0 while displaying a RFx, click on "responses and awards" button.
In the response comparision tab once the user selects response number and clicks on "compare all responses".
Item details table is displayed with fields item number,internal number,item description,........,Price etc.
Requirement is to hide the price column from the table.
The UI element type is 'Table'.
But the catch is there is no column price visible at layout design level.
This field is getting added dynamically at run time.
When i right click and see the 'more field help' at the front end i get the field id as 'GRP_1_COL_3_TXTV'.
lo_table ?= view->get_element( id = 'ITEMS_TABLE' ).
lo_column = lo_table->get_column( id = 'GRP_1_COL_3_TXTV').
ASSERT lo_column IS NOT INITIAL.
lo_column->set_visible( EXPORTING value = '01' ).
I had written the above code in the pre-exit of WDDOMODIFYVIEW.
But i am getting dump as assertion failed.it says no column by name 'GRP_1_COL_3_TXTV'.
Please help me inhow to hide fields or buttons getting generated dynmically.
Regards,
Venkat Raghavan.Hi Anitha,
What i understood from your question is,you want to control the table from your inputs.I have a one question for you what do you want to show defaultly i.e when you run the application what you want to show,either no table or table with some values.
Any how i am giving solution in this way.
If both inputs are given proper table output is displayed
Write your below logic in the WDDOMODIFYVIEW )
Here i am assuming that you already have a table element in the view.
Get the values entered in the input fields and compare those 2 values ,if the condition is satisfied then bind the values which you want to show in the table to the context node.
but if only 1 input is given a column is empty in the output table so i want to hide this column dynamically at runtime based on my inputs
You are telling that you know the empty column.If so get the view element reference and use the REMOVE_COLUMN to remove the column.
data:lr_table type ref to cl_wd_table,
lr_column type ref to L_WD_TABLE_COLUMN.
lr_table ?= view->get_element( 'TABLE1' ).
CALL METHOD LR_TABLE->REMOVE_COLUMN
EXPORTING
ID = 'TABLE1_color'
INDEX =
RECEIVING
THE_COLUMN = lr_column.
i want to hide some empty rows also at runtime based on inputs.
Removing the rows is very simple.if you know the key fields data of internal table from your input fields then do in this way.
delete itab from wa where key1= "12" and key2="abd".
Now bind the internal table to context node.
LO_ND_hcm->BIND_TABLE(
NEW_ITEMS = it_final
SET_INITIAL_ELEMENTS = ABAP_TRUE ). -
Need to add new UI elements in HAP_PMP_OVERALL_APPRAISAL view VW_MAIN
Hi,
how to add new UI elements (input field, read only field and button) on VW_MAIN view of HAP_PMP_OVERALL_APPRAISAL .
This is about ESS MSS Performance Mgmt.
I am checking for enhancement modifications, enhacement spots, dynamic programming to add new UI elements etc.
kindly provide inputs
thanks
BHi,
The following procedure explains how to add UI elements in the view of the standard component.
1. Create an Enhancement Implementation.
2. Create a new node on Component controller context.
3. Create a new method on component controller as the supply function of the new node.
4. Create new node on the view context by binding it from the controller context.
5. Create the UI elements on view.
6. Create post-exit on view method DoModifyView.--> In order to handle the events of UI element newly added.
7. Create a pre-exit on component method(Ex: SAVEAPPRAISALDATA) --> to get the static attributes of node.
Hope, the above steps will be useful .
Regards,
Abi -
Call a method in the view from Component Controller
Hi Friends,
I have written the code for calling the RFC in Component Controller.
My requirement is to change the properties of UI elements in the view, if I get any exception while calling RFC.
Can Call a method in the view from Component Controller.
Regards,
Lakshmi Prasad.HI,
You can get the error message during the exception of calling RFC in view itself.
Any way you may call the RFC at some action in the view only.
Can you explain me what you are trying to do?
Kind Regards,
Mukesh -
Explaination of UI elements in a view
Hi gurus,
I want to create a Pane in the webpage just like we have in BSP...when i was gng through the UI elements in the view i was bit confused what to select...
is there any doc which explains about the UI elements in detail...
or please suggest me how do i start creating the pane ...
the pane shld be in left side of the webpage and shld contain something like menu etc...
Regards
HarikaHi,
Please refer to this link: http://help.sap.com/saphelp_nw70ehp1/helpdata/en/df/da8b412bb5b35fe10000000a1550b0/frameset.htm
I hope it helps.
Regards
Arjun -
How to add UI elements dynamically in the views of webdynpro
Hi Experts,
Here i have a requirement where 2 text-box get added on a click of "ADD" button in the view during the execution of the Application. so is it possible to add the text-box to the view or not?
if yes how can it be done.
Thanks in advance
Regards
Lalitkumar.Even with these expanded requirements I wouldn't necessarily recommend dynamic UI element creation in WDDOMODIFYVIEW.
If the UI element requirements are fairly static (2 text boxes for each push of the button), then consider using a Multi-Pane (http://help.sap.com/saphelp_nw70ehp1/helpdata/en/df/da8b412bb5b35fe10000000a1550b0/frameset.htm) or Row Repeater (http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/93d3792e8c60d6e10000000a114a6b/frameset.htm) UI element. These constructs will both create a series of UI elements based upon the number of context elements in a bound node. Therefore if you want to generate two textboxes for each push of a button, in the button event handler you simple add another context element to the context node. You don't need dynamic UI element creation or dynamic data binding.
If you feel that you must use dynamic UI element creation, then first read up on the WDDOMODIFYVIEW phase model event.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d2/8acd409cc4dd50e10000000a1550b0/frameset.htm
You then probably want to study these three blogs on the topic:
/people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements
/people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements
/people/thomas.szcs/blog/2006/02/22/dynamic-programming-in-web-dynpro-abap--part-iii-aggregations-and-ddic-binding-of-viewelements -
How to change the view element visibility Dynamically?
Hi,
Can any one please suggest that how can I make one of the viewUIElements from the view, visible on the whole screen? Basically i want to make the data in the table, available for printing. I want when user clicks on the print button, he should see only the data in the table on the whole screen and some icons, nothing else. Again when he clicks one back button icon on the screen, he should return to the previous view.
Thanks and Regards,
Smriti<b>Hi smriti Behl
I Think you can get something from the below explanation
Create one UI Element For example "Visible" and make the type as
com.sap.ide.webdynpro.uielementdefinitions.Visibility
Now bind this Context Value with the UI Elements ie UI elements which you want to make Not Visible When you click Print Button. You can write the Following Code inside the print button
wdContext.currentContextElement().setVisible(WDVisibility.NONE);
When you want to make the UI Elements Visble When Click Back Button Write Following code In side Back Buuton Method
wdContext.currentContextElement().setVisiblity(WDVisibility.VISIBLE);
May i Know Your Problem Solved ..............
Regards
Chandran S</b> -
Dynamic creation of Dropdown by Index in the view
Hi,
Please help me how to create Dropdown by Index dynamically.
The scenario is in a view, part of view is Static and other part is Dynamic.
Dynamic part display depends on entry selected from Static part of the view.
I am using method WDDOMODIFYVIEW to implement this. I could successfully generate Group, Caption, TextView view
element dynamically but with Dropdown by Index, I am getting runtime error.
New Dropdown by Index will belong to Dyanmically generated Group in 'ROOTELEMENTCONTAINER' and new Context node will be created in CONTEXT for Dynamic Dropdown by Index .
Thanks, in advance ,for your help.Thanks Amit and Lekha for your replies.
I tried the code but still I am getting the same error.
lr_rootnode_info = wd_context->get_node_info( ).
lr_rootnode_info = lr_rootnode_info->get_child_node( 'ADD_DATA' ).
call method lr_rootnode_info->add_new_child_node( exporting name = lv_node_name 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_rootnode_info ).
****----------------Get instance of new node
concatenate 'ADD_DATA.' lv_node_name INTO lv_child_node.
lr_dyn_node = wd_context->get_child_node( name = lv_child_node ).
***----------------Prepare properties of attribute and add to context node
*data:lo_nd_add_data type ref to if_wd_context_node,
* lo_nd_lv_node_name type ref to if_wd_context_node,
* lo_el_lv_node_name type ref to if_wd_context_element.
*lo_nd_add_data = wd_context->get_child_node( name = wd_this->wdctx_add_data ).
*lo_nd_lv_node_name = lo_nd_add_data->get_child_node( name = lv_node_name ).
*lo_el_lv_node_name = lo_nd_lv_node_name->get_element( ).
concatenate is_char-descr_char 'ID' into lv_attname.
translate lv_attname to upper case.
condense lv_attname no-gaps.
lr_attribute-name = lv_attname.
lr_attribute-type_name = 'STRING'.
lr_attribute-value_help_mode = '0'.
lr_rootnode_info->add_attribute( exporting attribute_info = lr_attribute ).
lr_element = lr_dyn_node->create_element( ).
lr_dyn_node->bind_element( new_item = lr_element
set_initial_elements = abap_true ).
concatenate lv_node_name '.' lv_attname into lv_bindtext.
lr_ddbyidx = CL_WD_DROPDOWN_BY_IDX=>NEW_DROPDOWN_BY_IDX( id = iv_name
view = ir_view
label_for = iv_textviewid
bind_texts = lv_bindtext ).
lr_row_grid_data = cl_wd_grid_data=>new_grid_data( element = lr_ddbyidx ).
*******To set the TextView to the Group_2
lr_group2->add_child( lr_ddbyidx ).
Please help.
Thanks.
Edited by: Trupti Kallurwar on Oct 26, 2009 9:14 PM -
How to get the view tree from a jsp page
Hi,
I would like to get the view tree of a jsp page. The idea is to dynamically include the content of one or more jsf pages into a UIPanel during a "value changed" event.
So, i could get from an arbitrary page like ...
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<h:panelGrid columns="3" width="100%" rowClasses="gridTop">
<h:outputText value="#{someBean.someValue}"/>
</h:panelGrid>... the corresponding List of components...
Any idea?Thanks for your answer Jayashri,
The view tree can be retrieved by this way during the page is parsed, for example with scriptlets <%%>, or once the page has been parsed (the view has been builded and attached to the FacesContext).
My problem is to get the view tree of a page from another Context.
The idea is to build a dynamic layout of some pages that represents "views". I can imagine this like the concept of perspectives and views of Eclipse IDE.
Because of the difficulty to build it with pure JSP (cannot use dynamic ID nor JSTL ForEach), I try to build it into my backing bean and to bind it with a <h:panelGrid/>. By this way, I'm not able to use the <jsp:include/> tag as I usually did to include some content into the view tree.
Sorry for my english ;)
- Renaud. -
What is the correct way to dynamically change the View?
hi @,
In my application I have a radiobuttonbyKey UI element and based upon the key I have to hide and/or show a particular UI combination placed in the group UI element basically dynamicallly modifying the view.
I have 2 option one on radio button action I will change the visibilkity property of the group or in the wdModifyView method of the View.
I want to know which is the best way in such situation as per MVC concepts to dynamically modify view in UI action or in wdModifyView method.
Regards,
AmitI would just bind the "visible"-property of the Group to a context attribute (DDIC type "Visibility") and set the value of that attribute from the onSelect-handler of the drop-down list. No need for code in wdDoModifyView().
Armin -
Is it possible to add elements to the lov dynamically?
Hi,
I'm using forms6i.
I've one record group which fetches data from the table, and based on that recordgroup i have one lov.
But based on the values entered by the user at runtime,(which wont be there in table till it is saved),
I want to add those items to the already exisitng lov. Is it possible?
Say i have one column pack_serial, for which i've attached thie above said lov.
And in the table pack_serial have values 1,2
In runtime, user entered one more value say 3 to the pack_serial, which is not saved to the table yet
and the for the next record, user wants to view the elements in the lov. 1,2 is already there since it is saved in the table.
In addition to that i want to show 3 also(just entered value) in the lov.
So i may have to add this value,3, to the list dynamically, may be in when-validate-record trigger or something.
Is the above said possible? if yes please help me do it
ThanksHi Francois,
As i explained above, the item should be added to lov for the next record irrespective of whether it is saved to the table or not.
Like the form looks like this
PACKSERIAL SERIAL PACK TYPE WEIGHT VOLUME.....
1 1 Type1 4 5
1 2 ......
2 1 ....
3 1 ...Now suppose the first three records are already there in the database, (with packserial 1 and 2)
and when user try to view the lov from the 4th record, the lov will contain 1 and 2 , as per the recordgroup query which fetches from the table
But instead he is entering new packserial 3, so serial becomes 1, and then he fills all the other details.
Now agian user wants to add another record in same packserial 3 with serial 2.
So this time we should show the lov with values 1,2 (which is already available ) + 3.
So everytime user tries key-listval may be i need to retrieve all the additionally entered pack serials in the form and add to the lov, before showing the lov.
Hope it is clear, Please suggest the best way, i'm not v much aware of the multi user environment
I referred the below thread,
Dynamically generting LOV's in Forms 6i based on the values entered
Though the value is getting added to the lov(from the groupcount i understood), it is not displayed!
Please go through my code in W-V-I (when user enters new pack serial)
Declare
rg_name VARCHAR2(20) := 'RG_PACK_GROUP_SERIAL';
rg_id RecordGroup;
res boolean;
num number;
i number := 2;
errcode number;
no_of_rows number;
Begin
rg_id := Find_Group( rg_name );
IF NOT Id_Null(rg_id) THEN
errcode := Populate_Group(rg_id);
no_of_rows := Get_Group_Row_Count(rg_name);
Add_Group_Row( rg_id, no_of_rows+1 );
Set_Group_Number_Cell( 'RG_PACK_GROUP_SERIAL.SPM_PACK_GROUP_SERIAL',no_of_rows+1,:SPM_PACK_GROUP_SERIAL);
no_of_rows:=Get_Group_Row_Count(rg_name);
message('value added '||no_of_rows||','||Get_Group_Number_Cell('RG_PACK_GROUP_SERIAL.SPM_PACK_GROUP_SERIAL', no_of_rows));
message(' ');
END IF;
errcode := Populate_Group(rg_id);
End if;
End;Note : I already have the record group,'RG_PACK_GROUP_SERIAL', with select query in it.
Thanks -
In elements 6 the MyFolders tree was ordered latest first
Is it possible to get elements 11 to do the same
Andromeda14 wrote:
Are you saying you want to change the order in which folders are shown on left side? If that is so, then it is not possible. The folders shown in folder tree are same as the OS hierarchy and can't be altered. Please let me know if that answers your question.
~Surendra
That is also how I understand Rjay28's question.
If that is so, I wonder if using the folder view like this is simply ignoring the normal way to browse in thumbnail view with all the power of the database tool like tags?
Just for the fun, since it's an OS feature, the workaround would be to rename the date folders (from the organizer, of course). Just change the 2013 folder to a2013, the 2012 one to b2012, the 2011 one with c2011 and so on.
Maybe you are looking for
-
Ive tried to display an animated gif in an applet and it only shows the first frame. What is the code to do this and it be animated?
-
How to block a Billing Document Type?
Hi forum I need to block the billing document type FV-Invoice Contract. Is there some configuration to do that? I found VOFA where you can change billings documents, but I cant find how to block it. Thanks for your support.
-
Hard Disk Failure - Please Help
Hi, I have a HP probook 4730s. The laptop is 13 months old and the warranty has expired. The HDD has been laging lateley and also the system restore took, the last time it was ran took longer as usual, now at the startup i receive a message that the
-
I am using Captivate 4. I have a group of files where any edits I make to the audio track are not saved. The audio plays back fine in the audio editor. It just will not save the changes I make to the audio track (cut segments, add silent segments, et
-
Why after effects renders me with bad audio?
I rendered almost six times and the result of these renders is that audio takes me wrong, when I play it in Windows media audio don´t reproduce, and I reproduced a file alternative to this and reproduced it excellent, the worst is that when I play in