cancel
Showing results for 
Search instead for 
Did you mean: 

Force Server Roundtrip

Former Member
0 Kudos

hi,

I have got a date input field (a date picker). Is it possible to force a server roundtrip when the user has choosen a new date?

At the moment the user has to hit the enter key to send a request to the server.

Regards

Michael

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Refer document http://scn.sap.com/docs/DOC-61931.

Regards,

Ritu

nisha_vinod
Advisor
Advisor
0 Kudos

Hi Michael,

Did you try defining the GET_P method for your date attribute? Here, its possible to check for server-event as follows:

CASE iv_property.

    WHEN if_bsp_wd_model_setter_getter=>FP_SERVER_EVENT.
      rv_value = 'date_selected'.  "Here, you can give the name of your event handler without the EH prefix

Later on, you can define the event handler EH_ONDATE_SELECTED where you can handle the selected event.

Hope this helps.

Regards,

Nisha

Former Member
0 Kudos

hi,

thanks for your help. I already tried your proposal but it does not solve my probleme. No event or roundtrip is triggered when the user enters a new date value.

Regards

Michael

arne_husemann
Explorer
0 Kudos

Hi,

i think it is not possible to achive this requirement without modifications of the underlying WebUI-Framework / BSP-Technology.

Technically the valuehelp for the inputfield is generated via Javascript on the client side. If the user clicks a date the inputfield is updated but no roundtrip is triggered. The input field is configured to trigger a server roundtrip if enter is pressed.

The only chance to trigger the roundtrip would be the event of date selection on client side.

Regards,

Arne

Former Member
0 Kudos

hi Arne,

do you know any example for this client side triggering of a server event?

Regards

Michael

Former Member
0 Kudos

Hello,

Maybe this helps, when being called from the set-method.

METHOD eh_onsubmitonenter.

  DATA: lr_window
TYPE REF TO cl_crm_bupa_window_controller.
  DATA: lr_viewset
TYPE REF TO cl_crm_bupa_view_controller.

  TRY.
      lr_window ?= me->view_manager->get_window_controller( ).
   
CATCH cx_sy_ref_is_initial cx_sy_move_cast_error.
      TRY.
          lr_viewset ?= m_parent.
         
CALL METHOD lr_viewset->('SUBMITONENTER').
       
CATCH cx_sy_dyn_call_illegal_method cx_sy_ref_is_initial
              cx_sy_move_cast_error.
          RETURN.
      ENDTRY.
  ENDTRY.

 
IF lr_window IS BOUND.*   data should be processed in a central place (= viewset)
    TRY.
       
CALL METHOD lr_window->view_set->('SUBMITONENTER').
     
CATCH cx_sy_dyn_call_illegal_method cx_sy_ref_is_initial.
       
RETURN.
    ENDTRY.
  ENDIF.

ENDMETHOD.

Best regards,

Thomas Wagner

krishnendu_laha
Active Contributor
0 Kudos

Hello,

This seems an old post but I am trying to answer:

It is possible to force a round trip for a date field.

You need to code in GET_V method and just take help of an search help (for example WDR_TEST_DATE) and create an F4 instance with  iv_trigger_submit = abap_true.

Example:

    DATA: ls_map      TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
        lt_inmap    TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
        lt_outmap   TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.

  ls_map-context_attr = 'struct.date.
  ls_map-f4_attr = 'FLDATE'.
  APPEND ls_map TO: lt_outmap.

  CREATE OBJECT rv_valuehelp_descriptor TYPE
    cl_bsp_wd_valuehelp_f4descr
    EXPORTING
      iv_help_id        =  'WDR_TEST_DATE'
      iv_help_id_kind   = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name
      iv_input_mapping  = lt_inmap
      iv_output_mapping = lt_outmap
      iv_trigger_submit = abap_true.

Please try.

Thanks

Krish

Former Member
0 Kudos

I was looking for information about roundtrip for date field, due to when I select the date nothings happen, I read your post and i was wondering if the folloging code has to be implemented in get_v method ?

   DATA: ls_map      TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,        lt_inmap    TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,        lt_outmap   TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.  ls_map-context_attr = 'struct.date. 

ls_map-f4_attr = 'FLDATE'.

APPEND ls_map TO: lt_outmap. 

CREATE OBJECT rv_valuehelp_descriptor TYPE    cl_bsp_wd_valuehelp_f4descr   

EXPORTING      iv_help_id        =  'WDR_TEST_DATE'     

iv_help_id_kind   = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name      iv_input_mapping  = lt_inmap     

iv_output_mapping = lt_outmap     

iv_trigger_submit = abap_true.                                                                                                 

I don't undestand what means:

WDR_TEST_DATE and

ls_map-f4_attr = 'FLDATE ?,

WDR_TEST_DATE is a standar help?

FLDATE es a value or what is ?

Thanks for your help

John

krishnendu_laha
Active Contributor
0 Kudos

hello,

WDR_TEST_DATE is dictionary search help

FLDATE is mapped filed.

Thanks,

Krish