on 05-01-2013 9:54 AM
Hi
I have created a wd-ui input field representing a classification characteristic value as a char-field lenght 30.
Dynamically at run time my characteristic input field sometimes is a date.
I need a calendar input help for my wd-input field but only when it is representation a date.
Normally input help for a date is only possible for input fields type DATS.
I dont success dynamically to change my input field data declaration to type DATS.
I successed in setting the Search Help dynamically.
When I set at Seach Help where a calendar popup for a char-field is coded in the Search Help Exit function e.g. BU_DATE_CHAR I get a dump in WD but not from GUI.
The search help dumps in call function 'F4_DATE' .
Any possible way to get a fm 'F4_DATE' which works in a WD envirronment?
Or any other solution?
Thanks Kim Brandt
Hi,
Try to create the attribute and the input UI element dynamically( And bind to the dynamically created attribute ).
Please check the sample code below .( This code should appear in WDDOMODIFYVIEW method of the view )
DATA : lr_node TYPE REF TO if_wd_context_node,
lr_node_info TYPE REF TO if_wd_context_node_info,
ls_att_type TYPE wdr_context_attribute_info,
lr_container TYPE REF TO cl_wd_uielement_container,
lr_input_field TYPE REF TO cl_wd_input_field,
lr_flow_data TYPE REF TO cl_wd_flow_data,
fl_test TYPE wdy_boolean VALUE ' '.
*1. Get the reference of the existing node
lr_node = wd_context->get_child_node( 'ND_DYN' ).
*2. Get the node info object
lr_node_info = lr_node->get_node_info( ).
*3. Specify the attribute type dynamically
ls_att_type-name = 'ATT_DYN'.
IF fl_test = 'X'. "(dynamic condition)
ls_att_type-type_name = 'DATS'.
ELSE.
ls_att_type-type_name = 'CHAR30'.
ENDIF.
* 4. Add the dynmaically created attribute to the node.
lr_node_info->add_attribute( attribute_info = ls_att_type ).
*5. Get the reference of the layout rootelement container
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
* 6. Create an input field UI Element
lr_input_field = cl_wd_input_field=>new_input_field( bind_value = 'ND_DYN.ATT_DYN' ).
* 7. Specify the layout data
lr_flow_data = cl_wd_flow_data=>new_flow_data( element = lr_input_field ).
* 8. Add the newly created input ui element in the hierarchy
lr_container->add_child( lr_input_field ).
Thanks
Ajith C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No I didn't solved the problem but manage to set a workaround calendar F4 help.
/ Kim B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
did you solve this problem? I have the same issue now.
Thanks
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since Class/Characteristics are dynamic attributes, best Solution is to put a validation so that user has to enter in format MM/DD/YYYY, If not throw an error message like in SAP.
Else, you will have to build a complex OVS search help with one Input field(type Date) & when the Characteristic type is DATE, then User can select date from that OVS search help & click OK to transfer that date to the UI field.
Warm regards,
Phani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.