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 help for select options based on parameter value

Former Member
0 Kudos

hi all,

I need a help to create an F4 help for select options for object id based on parameter value of object type, I mean once an object type is given the f4 help should contain object id's only of that type for each option.

Regard's,

Girija

5 REPLIES 5

syed_ibrahim5
Active Participant
0 Kudos

hi,

you can refer the below thread.

[]

with regards,

Syed ibrahim . G

0 Kudos

i have populated the value into table dynpread like this

ls_dynpread-fieldname = 'HRP1001-PLVAR'.

ls_dynpread-FIELDVALUE = '01'.

APPEND ls_dynpread TO lt_dynpread.

lv_syrepid = sy-repid.

lv_dynnr = sy-dynnr.

*calld FM

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = lv_syrepid

dynumb = lv_dynnr

translate_to_upper = 'X'

TABLES

dynpfields = lt_dynpread.

I m getting error as Invalid_dynprofield

can u please help

0 Kudos

Hi Giri,

When you use DYNP_VALUES_READ function module you need to uncomment the exceptions and must use them

call function 'DYNP_VALUES_READ'
  exporting
    dyname                               = sy-repid
    dynumb                               = sy-dynnr
  tables
    dynpfields                           = value
  EXCEPTIONS         " These Exceptions you must use otherwise you will get the error as you mentioned
   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

Cheerz

Ramchander Rao.K

0 Kudos

I uncommented it but if an exception is raised the FM is not executed right..?? so the values are not fetched how to make the FM work..??

0 Kudos

Hi Girija,

For your requirement use FM F4IF_INT_TABLE_VALUE_REQUEST. I have created such a scenario for your better understanding.

Here the employee list are being selected on demanding F4 help depending upon the payroll area given.

    • Type declaration

TYPES : BEGIN OF ty_f4pernr,

pernr TYPE p_pernr,

vorna TYPE pa0002-vorna,

nachn TYPE pa0002-nachn,

abkrs TYPE pa0001-abkrs,

END OF ty_f4pernr.

    • Internal table declaration

DATA : int_f4pernr TYPE STANDARD TABLE OF ty_f4pernr.

    • Internal table memory clear

REFRESH : int_f4pernr.

    • Selection Screen Declaration

    • Begin of block with frame name

SELECTION-SCREEN BEGIN OF BLOCK a1.

PARAMETERS: p_abkrs TYPE abkrs OBLIGATORY.

    • Select option declaration of pernr field

SELECT-OPTIONS s_pernr FOR pa0001-pernr.

    • End of block

SELECTION-SCREEN END OF BLOCK a1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_pernr-low.

    • Calling the perform method when the low field of select option pernr's f4 is clicked

PERFORM pernr_f4help.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_pernr-high.

    • Calling the perform method when the high field of select option pernr's f4 is clicked

PERFORM pernr_f4help.

FORM pernr_f4help .

    • Retrieve pernr and corressponding first, last and middle name from pa0002 and pa0001 infotype using inner join

SELECT pa0001~pernr

pa0002~vorna

pa0002~nachn

pa0001~abkrs

INTO TABLE int_f4pernr

FROM pa0001

INNER JOIN pa0002

ON pa0001pernr EQ pa0002pernr

WHERE pa0001~abkrs = p_abkrs.

    • Calling F4 help function module to assign that retrieved value for that select option pernr

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'PERNR'

dynpprog = sy-repid " Program name

dynpnr = sy-dynnr " Screen number

dynprofield = 'S_PERNR' " F4 help need field

value_org = 'S'

TABLES

value_tab = int_f4pernr " F4 help values

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

ENDFORM.

So on entering the payroll area and pressing F4 on the select-options for employee number, you get the list of ONLY those employees who are present in the given payroll area.

Hopefully this will be of your much help.

thanks and regards,

Koushik.