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

Help using F4_INT_TABLE_VALUE_REQUEST

lijisusan_mathews
Active Contributor
0 Likes
801

I am using function module F4_INT_TABLE_VALUE_REQUEST to get an input help. But I need to get the importing feature as in Search Helps. ie. i need my values displayed in the help to be based on a value in a previous field. But during the POV and POH of this field, the previous fields value is not accessible using the screen field name, because the value is not getting populated in the screen field unless I press the Enter Key. Can someone please give me solution fast

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
753

Hey!

Check out this sample code.


REPORT  z_test11 .


PARAMETERS:
  p_carrid(2).



DATA: table1 LIKE
             ddshretval
    OCCURS 0 WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carrid.


CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
  EXPORTING
    tabname                   = 'scarr'
    fieldname                 = 'carrid'
*   SEARCHHELP                = ' '
*   SHLPPARAM                 = ' '
*   DYNPPROG                  = 'YH1146_TEST11'
*   DYNPNR                    = ' '
*   DYNPROFIELD               = 'p_carrid'
*   STEPL                     = 0
*   VALUE                     = ' '
*   MULTIPLE_CHOICE           = ' '
*   DISPLAY                   =  ' '
*   SUPPRESS_RECORDLIST       = ' '
*   CALLBACK_PROGRAM          = ' '
*   CALLBACK_FORM             = ' '
*   SELECTION_SCREEN          = ' '
 TABLES
   RETURN_TAB                 = table1
 EXCEPTIONS
   FIELD_NOT_FOUND           = 1
   NO_HELP_FOR_FIELD         = 2
   INCONSISTENT_HELP         = 3
   NO_VALUES_FOUND           = 4
   OTHERS                    = 5
          .
IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
 p_carrid = table1-fieldval.


start-of-selection.
write: p_carrid.

Regards

Abhijeet

7 REPLIES 7
Read only

Former Member
0 Likes
754

Hey!

Check out this sample code.


REPORT  z_test11 .


PARAMETERS:
  p_carrid(2).



DATA: table1 LIKE
             ddshretval
    OCCURS 0 WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carrid.


CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
  EXPORTING
    tabname                   = 'scarr'
    fieldname                 = 'carrid'
*   SEARCHHELP                = ' '
*   SHLPPARAM                 = ' '
*   DYNPPROG                  = 'YH1146_TEST11'
*   DYNPNR                    = ' '
*   DYNPROFIELD               = 'p_carrid'
*   STEPL                     = 0
*   VALUE                     = ' '
*   MULTIPLE_CHOICE           = ' '
*   DISPLAY                   =  ' '
*   SUPPRESS_RECORDLIST       = ' '
*   CALLBACK_PROGRAM          = ' '
*   CALLBACK_FORM             = ' '
*   SELECTION_SCREEN          = ' '
 TABLES
   RETURN_TAB                 = table1
 EXCEPTIONS
   FIELD_NOT_FOUND           = 1
   NO_HELP_FOR_FIELD         = 2
   INCONSISTENT_HELP         = 3
   NO_VALUES_FOUND           = 4
   OTHERS                    = 5
          .
IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
 p_carrid = table1-fieldval.


start-of-selection.
write: p_carrid.

Regards

Abhijeet

Read only

0 Likes
753

if you want other article about SAP and source codemany more go to http://saptechno.blogspot.com

Read only

0 Likes
753

if you want other article about SAP and source codemany more go to http://saptechno.blogspot.com

Read only

lijisusan_mathews
Active Contributor
0 Likes
753

HI Abhijeet,

thanx for the fast reply,

I need to get the values based on another screen field.. like, for eg.

I have 2 fields designed in se51, 'employee id' and 'files accessible'. I need a search help for the field 'files accessible'. But while coding, i need to display the files corresponding to a particular employee only. So i need to import the employee id from my screen field and use it in my search help. But my screen field is having that value only after a PAI or PBO, ie aftre I press the enter key.. Will that code be able to solve that problem?

Read only

Former Member
0 Likes
753

Hi try this code...

instead of werks-ur employee id

and bukrs - ur file interface.

IF NOT t499s-werks IS INITIAL.

SELECT bukrs FROM t001k INTO TABLE tab3

WHERE bwkey = t499s-werks.

ENDIF.

PROGNAME = SY-REPID.

DYNNUM = SY-DYNNR.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'BUKRS'

DYNPPROG = PROGNAME

DYNPNR = DYNNUM

DYNPROFIELD = 'T001K-BUKRS'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = TAB3.

IF SY-SUBRC <> 0.

MESSAGE E000(ZTP) WITH 'NO COMPANY CODE FOUND FOR THE PLANT'.

ELSE.

ENDIF.

ENDMODULE. " INPUT_CCODE INPUT

Read only

0 Likes
753

Hi Venkat..

Tht was exactly what i wanted. But the problem is t499s-werks is a screen field in my case, and that field will not get populated with values (even though it is already entered in thecrseen)unless i click enter. How can i get that value. Pls help.

Read only

Former Member
0 Likes
753

hi,

PROGRAM z101954_assignment1.

TABLES: zvbak_101954,zvbap_101954,zmara_101954,zorg_101954.

DATA: BEGIN OF itab OCCURS 0,

zkunag LIKE zvbak_101954-zkunag,

END OF itab.

In flow logic(PAI) of screen in which u want to display F4 help write this code.

PROCESS ON VALUE-REQUEST.

FIELD wa_salesorder-zkunag MODULE input_help_sold_to_party.

MODULE input_help_sold_to_party INPUT.

*Fetch the value of the field in an internal table*

SELECT zkunag FROM zvbak_101954 INTO CORRESPONDING FIELDS OF TABLE

itab.

MODULE input_help_sold_to_party INPUT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ZKUNAG'

  • PVALKEY = ' '

dynpprog = sy-cprog

dynpnr = '1000'

dynprofield = 'ZKUNAG'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

value_tab = itab

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

ENDMODULE.

dynpnr = screen no.

thanks

payal