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

F4 HELP FOR ONLY SELECTED FIELD VALUES

Former Member
0 Likes
3,139

Hi,

I have to display the F4 help for the selection screen field parameter. From the ICON table, I need to display the field ID values. In the ICON table, I have lot of field values for the field ID, but I need to display only 3 field values into F4 help.(like say @07@, @08@, @0A@ only at the F4 help).

Thanks in advance.

Regards

Ramesh mavilla.

Hi,

I have to display the F4 help for the selection screen field parameter. From the ICON table, I need to display the field ID values. In the ICON table, I have lot of field values for the field ID, but I need to display only 3 field values into F4 help.(like say @07@, @08@, @0A@ only at the F4 help).

Thanks in advance.

Regards

Ramesh mavilla.

8 REPLIES 8
Read only

former_member196299
Active Contributor
0 Likes
2,207

hi ,

Try this way :

Create a search help for that field wit the required field values .

Add this search help to that field as an match code object .

Regards,

Ranjita

Read only

Former Member
0 Likes
2,207

Hi,

Check this. i have added the custm values. if you want it from database, then hit the database and populate the values

PARAMETERS: p_skills TYPE z73390_skill.

DATA: lt_retval TYPE STANDARD TABLE OF ddshretval,

ls_retval LIKE ddshretval,

lt_dynmap TYPE STANDARD TABLE OF dselc,

ls_dynmap TYPE dselc,

dynp_values TYPE STANDARD TABLE OF dynpread ,

wa_dynp_values TYPE dynpread,

lt_values TYPE TABLE OF seahlpres,

lt_fields TYPE TABLE OF dfies,

ls_field TYPE dfies,

ls_return TYPE ddshretval.

CLEAR ls_field.

ls_field-fieldname = 'SKILLS'.

ls_field-intlen = 15.

ls_field-leng = 15.

ls_field-outputlen = 15.

ls_field-scrtext_m = 'SKILLS AVALIABLE'.

APPEND ls_field TO lt_fields.

CLEAR ls_field.

ls_field-fieldname = 'DESCRIPTION'.

ls_field-intlen = 25.

ls_field-leng = 25.

ls_field-outputlen = 25.

ls_field-scrtext_m = 'DESCRIPTION'.

APPEND ls_field TO lt_fields.

PERFORM fill_values USING 'C' 'C programming'.

PERFORM fill_values USING 'C+' 'C+ Programming'.

PERFORM fill_values USING 'ABAP' 'ABAP Language'.

PERFORM fill_values USING 'JAVA' 'JAVA programming'.

PERFORM fill_values USING 'SAP SCRIPT' 'Working with SAP Scripts'.

PERFORM fill_values USING 'SMART FORMS' 'Smart forms'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = 'VTTK'

retfield = 'SKILLS'

  • PVALKEY = ' '

dynpprog = sy-repid

  • DYNPNR = '0100'

  • DYNPROFIELD = 'P_SKILLS'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

  • VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

value_tab = gt_values

field_tab = lt_fields

return_tab = lt_retval

  • DYNPFLD_MAPPING = Lt_dynmap

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.

CLEAR ls_retval.

READ TABLE lt_retval INTO ls_retval INDEX 1.

MOVE ls_retval-fieldval TO p_skills.

REFRESH gt_values[].

&----


*& Form fill_values

&----


  • text

----


  • --->P_0290 Skill

----


FORM fill_values USING pa_value

pa_desc.

DATA ls_values TYPE seahlpres.

CLEAR ls_values.

ls_values-string = pa_value.

APPEND ls_values TO gt_values.

CLEAR ls_values.

ls_values-string = pa_desc.

APPEND ls_values TO gt_values.

ENDFORM. " fill_values

Regards,

Niyaz

Read only

Former Member
0 Likes
2,207

Hi Ramesh,

Do the following:

AT SLECTION-SCREEN ON VALUE REQUEST FOR (PARAMETER_NAME).

Select from icon table the required fields.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'. and pass the internal table containing the field values

Read only

Former Member
0 Likes
2,207

Hi Ramesh,

Do the following:

AT SLECTION-SCREEN ON VALUE REQUEST FOR (PARAMETER_NAME).

Select from icon table the required fields.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'. and pass the internal table containing the field values

Thank you.

Reward points if helpful.

Read only

Former Member
0 Likes
2,207

Hi

use liek this

creat a structure what values you want for that search help

like this

TYPES : BEGIN OF ST_OBJID_SH,

OTYPE TYPE HRP1000-OTYPE,

OBJID TYPE HRP1000-OBJID,

END OF ST_OBJID_SH.

DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.

DATA : WA_OBJID_SH TYPE ST_OBJID_SH.

write this logic

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.

  • IF S_OBJID IS NOT INITIAL.

SELECT OTYPE OBJID FROM HRP1000

INTO TABLE IT_OBJID_SH

WHERE OTYPE = 'D'.

IF SY-SUBRC EQ 0.

  • SEARCH HELP FOR QUALIFICATION.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'OBJID'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'S_OBJID'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = IT_OBJID_SH

  • FIELD_TAB =

  • RETURN_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.

ENDIF.

.

that logic depends on ur requirment

<b>Reward if usefull</b>

Read only

hymavathi_oruganti
Active Contributor
0 Likes
2,207

just copy and paste the below code and run it and check. ur problem will be solved.

REPORT Ztest NO STANDARD PAGE HEADING.

type-pools:icon.

parameters: p_icon(6).

data:z_icon type table of icon WITH HEADER LINE.

at selection-screen on value-request for p_icon.

DATA: RET_TAB TYPE TABLE OF DDSHRETVAL WITH HEADER LINE.

Z_ICON-ID = '@07@'.

APPEND Z_ICON.

CLEAR Z_ICON.

Z_ICON-NAME = '@08@'.

APPEND Z_ICON.

CLEAR Z_ICON.

Z_ICON-NAME = '@09@'.

APPEND Z_ICON.

CLEAR Z_ICON.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

<b> RETFIELD = 'ID'</b>

DYNPROFIELD = 'P_ICON'

<b> VALUE_ORG = 'S'</b>

TABLES

VALUE_TAB = Z_ICON

RETURN_TAB = RET_TAB.

READ TABLE RET_TAB INDEX 1.

P_ICON = RET_TAB-FIELDVAL.

Message was edited by:

Hymavathi Oruganti

Message was edited by:

Hymavathi Oruganti

Read only

Former Member
0 Likes
2,207

Hi <b>Ramesh</b>,

<i>Please see the Below sample code for the F4 Lookup.</i>

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_REVNR-HIGH.

  PERFORM GET_REVISION_NUMBER USING 'S_REVNR-HIGH' 'REVNR'.
*&---------------------------------------------------------------------*
*&      Form  GET_REVISION_NUMBER
*&---------------------------------------------------------------------*
*       F4 Lookup for Revision Service Order revision
*----------------------------------------------------------------------*
*      -->P_0123   fieldname
*      -->P_0124   fieldtype
*----------------------------------------------------------------------*
FORM GET_REVISION_NUMBER USING
              VALUE(FIELD_NAME) LIKE  HELP_INFO-DYNPROFLD
              VALUE(FIELD_TYPE) LIKE  DFIES-FIELDNAME.

  DATA: I_RETURN TYPE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

  DATA: BEGIN OF I_REV OCCURS 0,
           REVNR LIKE T352R-REVNR,
        END   OF I_REV.
  DATA: V_S TYPE C VALUE 'S'.
  IF I_REV[] IS INITIAL.
    SELECT REVNR
           INTO TABLE I_REV
           FROM T352R.
    SORT I_REV BY REVNR.
    DELETE ADJACENT DUPLICATES FROM I_REV COMPARING REVNR.
  ENDIF.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      RETFIELD        = FIELD_TYPE
      DYNPPROG        = SY-REPID
      DYNPNR          = SY-DYNNR
      DYNPROFIELD     = FIELD_NAME
      VALUE_ORG       = V_S
    TABLES
      VALUE_TAB       = I_REV
      RETURN_TAB      = I_RETURN
    EXCEPTIONS
      PARAMETER_ERROR = 1
      NO_VALUES_FOUND = 2
      OTHERS          = 3.
  IF SY-SUBRC = 0.
  ENDIF.

ENDFORM.                    " GET_REVISION_NUMBER

Read only

Former Member
0 Likes
2,207

Hi,

See the follwoing code example

REFRESH: I_DYNPREAD .

CLEAR : I_DYNPREAD .

I_DYNPREAD-FIELDNAME = 'P_KAPPL'.

APPEND I_DYNPREAD.

CLEAR I_DYNPREAD.

L_REPID = SY-REPID .

L_DYNNR = '1000' .

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = L_REPID

DYNUMB = L_DYNNR

TABLES

DYNPFIELDS = I_DYNPREAD.

IF SY-SUBRC EQ 0.

READ TABLE I_DYNPREAD INDEX 1.

P_KAPPL = I_DYNPREAD-FIELDVALUE.

ENDIF.

REFRESH: I_DYNPREAD .

CLEAR : I_DYNPREAD .

REFRESH: I_KSCHL.

TRANSLATE P_KAPPL TO UPPER CASE.

TRANSLATE P_KVEWE TO UPPER CASE.

SELECT KAPPL KVEWE KSCHL VTEXT FROM T685T

INTO CORRESPONDING FIELDS OF TABLE I_KSCHL

WHERE KAPPL = P_KAPPL

AND KVEWE = P_KVEWE

AND SPRAS = 'EN'.

IF SY-SUBRC <> 0.

  • MESSAGE E001(ZZ) WITH 'No Condition Type exist for Application'.

*p_kappl ' and Usage' p_kvewe.

ELSE.

REFRESH: I_FIELDS.

I_FIELDS-TABNAME = 'T685T'.

I_FIELDS-FIELDNAME = 'KAPPL'.

I_FIELDS-SELECTFLAG = ''.

APPEND I_FIELDS.

I_FIELDS-TABNAME = 'T685T'.

I_FIELDS-FIELDNAME = 'KVEWE'.

I_FIELDS-SELECTFLAG = ''.

APPEND I_FIELDS.

I_FIELDS-TABNAME = 'T685T'.

I_FIELDS-FIELDNAME = 'KSCHL'.

I_FIELDS-SELECTFLAG = 'X'.

APPEND I_FIELDS.

I_FIELDS-TABNAME = 'T685T'.

I_FIELDS-FIELDNAME = 'VTEXT'.

I_FIELDS-SELECTFLAG = ' '.

APPEND I_FIELDS.

CLEAR: V_SEL.

CALL FUNCTION 'HELP_VALUES_GET_NO_DD_NAME'

EXPORTING

  • CUCOL = 0

  • CUROW = 0

  • DISPLAY = ' '

SELECTFIELD = 'KSCHL'

TITEL = 'Cond Type'

IMPORTING

  • IND =

SELECT_VALUE = V_SEL

TABLES

FIELDS = I_FIELDS

FULL_TABLE = I_KSCHL

.

IF SY-SUBRC = 0.

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

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

ENDIF.

ENDIF. "SY-SUBRC.

And also go throw the link which it clears more about F4

Check the link below for creating collective search help

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee86446011d189700000e8322d00/content.htm

Check the ink below for creating elementary search help

http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21ee5f446011d189700000e8322d00/content.htm

http://help.sap.com/saphelp_erp2005/helpdata/en/3d/e53642e2a3ab04e10000000a1550b0/content.htm

<b>Reward with points if helpful.</b>

Regards,

Vijay