Application Development 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: 

f4 in selection screen

Former Member
0 Kudos

hi

i look for function that when you press f4 in selection screen you can filter the screen that show according to other field for example

if i press on calendar name and i have a field of werks that equal 1201 i want to show just the calendar name that have connection to 1201.

thanks a lot

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

The function module you are looking for is

f4if_int_table_value_request.

let me know if you want the code too.

Allot points for valuable answers.

Regards,

Vinod.

4 REPLIES 4

Former Member
0 Kudos

Hi,

The function module you are looking for is

f4if_int_table_value_request.

let me know if you want the code too.

Allot points for valuable answers.

Regards,

Vinod.

Former Member
0 Kudos

Hi,

I hope this will help you..

********************

data: begin of t_itab occurs 0,

pernr like zfdmr_records-pernr,

end of t_itab.

DATA: t_return like ddshretval occurs 0 with header line.

**----


*at selection-screen on value-request for s_pernr-low.

**----


  • perform get_values changing s_pernr-low.

*

**----


*at selection-screen on value-request for s_pernr-high.

**----


  • perform get_values changing s_pernr-high.

&----


*& Form get_values

&----


  • text

----


  • -->P_S_PERNR_LOW text

----


FORM get_values CHANGING P_S_PERNR.

refresh t_itab.

clear t_return.

select pernr from zfdmr_records into table t_itab.

delete adjacent duplicates from t_itab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'PERNR'

  • PVALKEY = ' '

DYNPPROG = sy-cprog

DYNPNR = sy-dynnr

DYNPROFIELD = 'ZFDMR_RECORDS-PERNR'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

MULTIPLE_CHOICE = ' '

DISPLAY = 'F'

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

TABLES

VALUE_TAB = t_itab

  • FIELD_TAB =

RETURN_TAB = t_return

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

READ TABLE t_return INDEX 1.

p_s_pernr = t_return-fieldval.

ENDFORM. " get_values

Thanks.

If your issue is solve reward points and close the thread.

Former Member
0 Kudos

Hi yossi,

Depending on the data entered on the other parameter if you want to show f4 help, ypu can do it at selection screen output.See the below code.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_pstlz-low.
* Get Zipcodes
  PERFORM get_zipcodes.
  s_pstlz-low = dg_pstlz.
*&---------------------------------------------------------------------*
*&      Form  GET_ZIPCODES
*&---------------------------------------------------------------------*
*       Get Zipcodes
*----------------------------------------------------------------------*
FORM get_zipcodes.
  REFRESH: dt_fields, dt_contents_zipcode.
  CLEAR dg_ind.

  dt_fields-tabname   = 'PA0006'.
  dt_fields-fieldname = 'PSTLZ'.
  dt_fields-selectflag = 'X'.
  APPEND dt_fields.
  CLEAR dt_fields.

  CLEAR dt_contents_zipcode.

* Get Zipcodes from PA0006 where molga = '10'
  SELECT f~pstlz
    INTO TABLE dt_contents_zipcode
    FROM pa0006 AS f INNER JOIN t500p AS p
         ON f~land1 = p~land1
      WHERE p~molga = '10'.

  SORT dt_contents_zipcode.

  DELETE ADJACENT DUPLICATES FROM dt_contents_zipcode
  COMPARING pstlz.

  LOOP AT dt_contents_zipcode.
    dt_contents_zipcode = dt_contents_zipcode+0(5).
    MODIFY dt_contents_zipcode.
  ENDLOOP.

  DELETE ADJACENT DUPLICATES FROM dt_contents_zipcode
  COMPARING pstlz.

* Give F4 help
  CALL FUNCTION <b>'HELP_VALUES_GET_NO_DD_NAME'</b>
       EXPORTING
            selectfield                  = 'PSTLZ'
            titel                        = 'Zipcodes'(024)
       IMPORTING
            ind                          = dg_ind
       TABLES
            fields                       = dt_fields
            full_table                   = dt_contents_zipcode
       EXCEPTIONS
            full_table_empty             = 1
            no_tablestructure_given      = 2
            no_tablefields_in_dictionary = 3
            more_then_one_selectfield    = 4
            no_selectfield               = 5
            OTHERS                       = 6.

  IF sy-subrc EQ 0.
    READ TABLE dt_contents_zipcode INDEX dg_ind.
    dg_pstlz = dt_contents_zipcode-pstlz.
  ENDIF.

Depending on your request you write a seelct from the table.

Hope this will help you.

Thanks&Regards,

Siri.

Kindly award points if it is useful.

Former Member
0 Kudos

Hi Yossi,

Here is some example.

find it if is useful.

REPORT ZTESTB .

*Scenario : Get all the PSA values depend on the PA value

  • that is going to enter on the selection screen.

parameters : p_WERKS type PERSA,

p_BTRTL type BTRTL_001P.

data : t_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE,

t_return like ddshretval occurs 0 with header line.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_btrtl.

DATA : BEGIN OF lt_psa OCCURS 0,

btrtl LIKE t001p-btrtl,

END OF lt_psa.

data : l_werks type persa.

*-- Get value PA value from screen

t_dynpfields-fieldname = 'P_WERKS'.

APPEND t_dynpfields.

CLEAR t_dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = t_dynpfields

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

OTHERS = 11.

IF sy-subrc EQ 0.

READ TABLE t_dynpfields WITH KEY fieldname = 'P_WERKS'.

IF sy-subrc EQ 0.

MOVE t_dynpfields-fieldvalue TO l_WERKS.

ENDIF.

ELSE.

EXIT.

ENDIF.

SELECT btrtl

FROM t001p

INTO table lt_psa

WHERE werks = L_werks.

*--- Get F4 help

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'BTRTL'

  • PVALKEY = ' '

DYNPPROG = sy-cprog

DYNPNR = SY-DYNNR

DYNPROFIELD = 'ZTESTB-P_BTRTL'

  • STEPL = 0

WINDOW_TITLE = 'help'

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = LT_PSA

  • FIELD_TAB =

RETURN_TAB = T_RETURN

  • DYNPFLD_MAPPING =

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.