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: 

limited entries in f4 help in selection screen

Former Member
0 Kudos

hi experts,

i have a selection screen and it has f4 help also .there it displayes all the records in the table .but i need to display only selected records.i have do it from the code itself.

for ex .if i have a selection screen to select matnr from mara table .i need to display the materials which fall under the category raw material alone .for that what i have to do ?

1 ACCEPTED SOLUTION

0 Kudos

Hi,

At the event

AT SELECTION-SCREEN ON VALUE-REQUEST FOR matnr.

Here create the table of values you want to display and then

use one of those FM's F4IF_XXX to show the list.

Like the FM F4IF_INT_TABLE_VALUE_REQUEST.

Regards,

Sesh

7 REPLIES 7

0 Kudos

Hi,

At the event

AT SELECTION-SCREEN ON VALUE-REQUEST FOR matnr.

Here create the table of values you want to display and then

use one of those FM's F4IF_XXX to show the list.

Like the FM F4IF_INT_TABLE_VALUE_REQUEST.

Regards,

Sesh

Former Member
0 Kudos

Hi Manikandan,

To restrict the entries displayed in F4 help, you can create a internal table according to ur need,(populate it with the values u need)..and pass it in the foll.FM

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'E_VALUE'

dynprofield = 'A'

dynpprog = sy-cprog

dynpnr = sy-dynnr

TABLES

value_tab = itab

field_tab = field_tab

return_tab = return_tab

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.

Where ITAB is the internal table which contains the required values.

Former Member
0 Kudos

Hi,

Please find the following code for your help.

Change the according to your table and field name.

*& ---------- SOC FOR F4 HELP ON SELECTION SCREEN 15.05.07 ------------------------------- &*

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_UNIQUE.

SELECT  UNIQ_RES_NO
        FROM zproject_res INTO CORRESPONDING FIELDS OF TABLE ITAB_HELP
        where flag = 'Z'.

SORT ITAB_HELP BY UNIQ_RES_NO .

DELETE ADJACENT DUPLICATES FROM ITAB_HELP.



CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
*   DDIC_STRUCTURE         = ' '
    retfield               = 'UNIQ_RES_NO'
*   PVALKEY                = ' '
   DYNPPROG               = 'ZRPSTRESVSLIP'
   DYNPNR                 = '1000'
   DYNPROFIELD            = 'P_UNIQUE'
*   STEPL                  = 0
*   WINDOW_TITLE           = ' '
*   VALUE                  = ' '
   VALUE_ORG              = 'S'
*   MULTIPLE_CHOICE        = ' '
*   DISPLAY                = ' '
*   CALLBACK_PROGRAM       = ' '
*   CALLBACK_FORM          = ' '
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
  tables
    value_tab              = itab_help
*   FIELD_TAB              =
*   RETURN_TAB             =
*   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.




*& ---------- EOC FOR F4 HELP ON  SELECTION SCREEN 16.05.07  ------------------------------- &*

<i><b>Reward points for helpful answer

Debjani</b></i>

former_member194669
Active Contributor
0 Kudos

Hi,

check this

aRs

Points are always welcome

Former Member
0 Kudos

HI

Check the F$ help for the second parameter .

PARAMETERS: p_carr_1 TYPE spfli-carrid,

p_carr_2 TYPE spfli-carrid.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carr_2.

CALL SCREEN 100 STARTING AT 10 5

ENDING AT 50 10.

MODULE value_list OUTPUT.

SUPPRESS DIALOG.

LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

SET PF-STATUS space.

NEW-PAGE NO-TITLE.

WRITE 'Star Alliance' COLOR COL_HEADING.

ULINE.

p_carr_2 = 'AC '.

WRITE: / p_carr_2 COLOR COL_KEY, 'Air Canada'.

HIDE p_carr_2.

p_carr_2 = 'LH '.

WRITE: / p_carr_2 COLOR COL_KEY, 'Lufthansa'.

HIDE p_carr_2.

p_carr_2 = 'SAS'.

WRITE: / p_carr_2 COLOR COL_KEY, 'SAS'.

HIDE p_carr_2.

p_carr_2 = 'THA'.

WRITE: / p_carr_2 COLOR COL_KEY, 'Thai International'.

HIDE p_carr_2.

p_carr_2 = 'UA '.

WRITE: / p_carr_2 COLOR COL_KEY, 'United Airlines'.

HIDE p_carr_2.

CLEAR p_carr_2.

ENDMODULE.

AT LINE-SELECTION.

CHECK NOT p_carr_2 IS INITIAL.

LEAVE TO SCREEN 0.

Former Member
0 Kudos

hi

use the FM 'F4IF_INT_TABLE_VALUE_REQUEST'

1) fetch the required data from database table into ur internal table

2) delete unnecessary records fromt he internal table.

then use above function module.

3) then if u press f4 help there it will shows the records.

thanks,

maheedhar.t

Former Member
0 Kudos

Hi,

Check this code:

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

*SELECT-OPTIONS : s_blart FOR bkpf-blart OBLIGATORY NO INTERVALS.

SELECT-OPTIONS s_blart FOR t003-blart MATCHCODE OBJECT zdoc_type OBLIGATORY NO INTERVALS NO-EXTENSION.

PARAMETERS: p_belnr LIKE bseg-belnr,

b_bukrs LIKE bseg-bukrs OBLIGATORY DEFAULT '1000',

g_gjahr LIKE bseg-gjahr.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_belnr.

DESCRIBE TABLE it_hlp LINES wk_lines.

IF wk_lines = 0.

SELECT belnr gjahr bldat budat INTO CORRESPONDING FIELDS OF it_hlp

FROM bkpf

WHERE bukrs = b_bukrs AND

bstat = ' ' AND

blart IN s_blart.

APPEND it_hlp.

ENDSELECT.

ENDIF.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BELNR'

dynprofield = 'P_BELNR'

dynpprog = sy-cprog

dynpnr = sy-dynnr

value_org = 'S'

TABLES

value_tab = it_hlp.

Reward if useful!