Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Clear selection screen fields on using value help on another field

Former Member
0 Likes
699

Hi Experts,

I have 3 fields - reason1, reason2, reason3.

Now i want to clear fields reason2 and reason 3 when i use value help for reason1.

How do i go about it.

Thanks & Regards

Gaurav Kumar Raghav

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
658

Hi,

You use the function module 'DYNP_VALUES_UPDATE', here is a code extract showing its use..

*&---------------------------------------------------------------------*
*&      Form  f4_laufd
*&---------------------------------------------------------------------*
form f4_laufd .

  data: ls_laufk type ilaufk,
        lt_laufk type table of ilaufk.

  ls_laufk-laufk = space.
  ls_laufk-sign  = 'I'.
  append ls_laufk to lt_laufk.

  call function 'F4_ZAHLLAUF'
    exporting
      f1typ = 'D'
      f2nme = 'F110V-LAUFI'
    importing
      laufd = p_laufd
      laufi = p_laufi
    tables
      laufk = lt_laufk.

  perform set_selection using 'P_LAUFI' p_laufi.

endform.                                                    " f4_laufd

*&---------------------------------------------------------------------*
*&      Form  set_selection
*&---------------------------------------------------------------------*
form set_selection  using    value(i_field)
                             i_value.

  data: ls_dynpfld type dynpread,
        lt_dynpfld type table of dynpread.

  ls_dynpfld-fieldname  = i_field.
  ls_dynpfld-fieldvalue = i_value.
  append ls_dynpfld to lt_dynpfld.

  call function 'DYNP_VALUES_UPDATE'
    exporting
      dyname     = sy-repid
      dynumb     = sy-dynnr
    tables
      dynpfields = lt_dynpfld.

endform.                    " set_selection

Darren

5 REPLIES 5
Read only

Former Member
0 Likes
658

AT SELECTION-SCREEN OUTPUT

if reason1 = <value>

clear: reason2, reason3.

endif.

Read only

Former Member
0 Likes
658

Hi,

INITIALIZATION.
If reason 3 NE space.
Clear: reason1,
         reason2.
ENDIF.

Regards,

Nandha

Read only

Former Member
0 Likes
659

Hi,

You use the function module 'DYNP_VALUES_UPDATE', here is a code extract showing its use..

*&---------------------------------------------------------------------*
*&      Form  f4_laufd
*&---------------------------------------------------------------------*
form f4_laufd .

  data: ls_laufk type ilaufk,
        lt_laufk type table of ilaufk.

  ls_laufk-laufk = space.
  ls_laufk-sign  = 'I'.
  append ls_laufk to lt_laufk.

  call function 'F4_ZAHLLAUF'
    exporting
      f1typ = 'D'
      f2nme = 'F110V-LAUFI'
    importing
      laufd = p_laufd
      laufi = p_laufi
    tables
      laufk = lt_laufk.

  perform set_selection using 'P_LAUFI' p_laufi.

endform.                                                    " f4_laufd

*&---------------------------------------------------------------------*
*&      Form  set_selection
*&---------------------------------------------------------------------*
form set_selection  using    value(i_field)
                             i_value.

  data: ls_dynpfld type dynpread,
        lt_dynpfld type table of dynpread.

  ls_dynpfld-fieldname  = i_field.
  ls_dynpfld-fieldvalue = i_value.
  append ls_dynpfld to lt_dynpfld.

  call function 'DYNP_VALUES_UPDATE'
    exporting
      dyname     = sy-repid
      dynumb     = sy-dynnr
    tables
      dynpfields = lt_dynpfld.

endform.                    " set_selection

Darren

Read only

0 Likes
658

Hi Darren

Somehow the values are not clearing from the selection screen.

here is my code.

DATA: ls_dynpfld TYPE dynpread,

lt_dynpfld TYPE STANDARD TABLE OF dynpread,

lv_repid TYPE sy-repid,

lv_dynnr TYPE sy-dynnr,

lv_initial TYPE string.

lv_repid = sy-cprog.

lv_dynnr = sy-dynnr.

ls_dynpfld-fieldname = 'P_RES2'.

ls_dynpfld-fieldvalue = lv_initial.

APPEND ls_dynpfld TO lt_dynpfld.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = lv_repid

dynumb = lv_dynnr

tables

dynpfields = lt_dynpfld

EXCEPTIONS

INVALID_ABAPWORKAREA = 1

INVALID_DYNPROFIELD = 2

INVALID_DYNPRONAME = 3

INVALID_DYNPRONUMMER = 4

INVALID_REQUEST = 5

NO_FIELDDESCRIPTION = 6

UNDEFIND_ERROR = 7

OTHERS = 8.

Read only

Former Member
0 Likes
658

Hi All,

The issue is resolved.

I used the same FM DYNP_VALUES_UPDATE.

The trick to use it that i had to pass the parameter on which the POV was written alongwith the parameters i wanted to change.

So i had to pass all 3 reason1, reason2 and reason3 to the FM to change the screen values.

Thanks to all.