cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger roundtrip for date field

former_member188843
Participant
0 Kudos

Hi All,

How to make a date field trigger a round trip after user chosed a date?

I did the following in P, but it does not trigger it.

    case iv_property.

  when if_bsp_wd_model_setter_getter=>fp_fieldtype.

    rv_value = cl_bsp_dlc_view_descriptor=>if_bsp_dlc_view_descriptor~field_type_input.

  when if_bsp_wd_model_setter_getter=>fp_server_event .
    rv_value = 'ENTER'.
  endcase.

tks for your hints in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Joshua,


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.

   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.

Thanks & Regards

NIkhil H

former_member188843
Participant
0 Kudos

Hi,

Many tks for your reply...But my field is a general date field not a field with dropdown list.

Former Member
0 Kudos

Hi Joshua,

The code gave is correct. What he is doing here is calling a se11 search help for date, I think the search help to be used here is BU_DATE_CHAR . This will solve your problem.

Regards,

Pratheek

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Joshua,

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

Thanks,

Ritu

Former Member
0 Kudos

Hi Joshua,

Had you found solution for this issue?

I done the exactly same thing now and i getting the short dump CNTL_ERROR:

  DATA:

  lv_index type string,

  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.


  lv_index = iv_index.

  CONCATENATE 'TABLE[' lv_index '].DATUM' INTO ls_map-context_attr.

  CONDENSE ls_map-context_attr NO-GAPS.

  ls_map-f4_attr      = 'DATE_CHAR'.

  APPEND ls_map TO: lt_inmap, lt_outmap.



  CREATE OBJECT rv_valuehelp_descriptor TYPE CL_BSP_WD_VALUEHELP_F4DESCR

    EXPORTING

      iv_help_id        = 'BU_DATE_CHAR'

      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.

Former Member
0 Kudos

Hi Joshua,

This code is not for dropdown list,This is for value help.

'WDR_TEST_DATE' Is nothing but the search help for date,so just create your own search help and give that name in the iv_help_id.

I know seach help will automatically comes when you declare variable as DATS type.

but you want to trigger server round trip for that reason i have given you this solution,

Hope it will solve your problem definately

Thanks & regards

NIkhil H

former_member188843
Participant
0 Kudos

Hi,

tks. the problem is I need the general search help to let the user choose the date freely.

Former Member
0 Kudos

Hi,

Just go to se11,create your own search help,in that give your table name,and give your date field name in the search help parameter and data element of it. and activate .

After that add this search help name to iv_help_id.

Your problem is solved,I dont understand where your facing problem as i have given u whole coding with respect to that.

And its a general search help itself.

Try out this code it will definitely work.

If You have any problem let me know

Thanks & Regards

Nikhil H

former_member188843
Participant
0 Kudos

Hi,

I tired but everytime i get dump when I click it from UI. It seems it failed to create instance of CL_GUI_CUSTOM_CONTAINER.But when i test the search help from se11 it works..

It is strange.

Former Member
0 Kudos

Hi,

Can you provide your code.As i am not understanding why this error is coming.

As i myself have created my own search help and attached to it,its working absolutely fine.

former_member188843
Participant
0 Kudos

Hi, as following.

   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_CHAR'.
ls_map-f4_attr = 'DATE_CHAR'.
append ls_map to: lt_outmap.

create object rv_valuehelp_descriptor type
      cl_bsp_wd_valuehelp_f4descr
      exporting
      iv_help_id        =  'BU_DATE_CHAR'
      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 debugged, it happened when in FM F4_DATE_CONTROL when it going to call screen100 to create instance of CL_GUI_CUSTOM_CONTAINER.

Former Member
0 Kudos

HI,

ls_map-context_attr is nothing but the name what you have provided while creating  context node.

ls_map-f4_attr is nothing but the name which is der in search help.

so check out with those name.

or else better you create your own search help.

and provide me your code.

As i am not able to understand why this error message is coming.

I have checked with the code its working perfectly fine.

former_member188843
Participant
0 Kudos

hI,

i think even with own search help, it will call F4_Date and in BSP it will dump .

Former Member
0 Kudos

Hi Joshua,

I think something wrong with ur other coding,

As what code i have provided you i dnt think u will get any dump,as my self have tested it.

When you create search help in se11, just give any table name in which you have date field and just add date field in search help parameter.So obviously you will get standard date f4 help.

Thanks & Regards

Nikhil H

Former Member
0 Kudos

Hi Joshua,

  I think it will not possible to trigger an event on selection of Date field in UI.

Regards

Rajarama U

former_member184067
Active Contributor
0 Kudos

Hi Joshua,

try to enter the date field in order to trigger the server event that you add

hopes it helps

cheers