‎2008 Jul 12 6:44 AM
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.
‎2008 Jul 12 6:48 AM
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
‎2008 Jul 12 6:48 AM
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
‎2008 Jul 12 6:53 AM
if you want other article about SAP and source codemany more go to http://saptechno.blogspot.com
‎2008 Jul 12 6:53 AM
if you want other article about SAP and source codemany more go to http://saptechno.blogspot.com
‎2008 Jul 12 6:57 AM
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?
‎2008 Jul 12 7:27 AM
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
‎2008 Jul 12 7:34 AM
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.
‎2008 Jul 12 8:11 AM
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