cancel
Showing results for 
Search instead for 
Did you mean: 

Calendar popup for Char-field

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (3)

Answers (3)

Former Member
0 Kudos

No I didn't solved the problem but manage to set a workaround calendar F4 help.

/ Kim B

andreas_hoger
Explorer
0 Kudos

Can you tell me how you did it.

Thanks

Andreas

Former Member
0 Kudos

As far as I remenber, I programmed a self-programmed F4 help screen which only was called when field contained a date.

/ Kim

andreas_hoger
Explorer
0 Kudos


Hello,

did you solve this problem? I have the same issue now.

Thanks

Andreas

phanir_mullapudi
Active Participant
0 Kudos

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