‎2009 Feb 18 12:19 PM
Hi Experts,
I am using Function module F4_INT_TABLE_VALUE_REQUEST for F4 help funtionality . i have 30 to 40 fields for which i need to use this function module .
Every time i need to pass different fields and diferent tables.
Anbody please tell how to modularize so that i can call this FM only once. please if i need to write perform give me sample line.
thanks.
‎2009 Feb 18 12:21 PM
‎2009 Feb 18 12:25 PM
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME1.
PERFORM SEARCH USING P_FNAME1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME2.
PERFORM SEARCH USING P_FNAME2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME3.
PERFORM SEARCH USING P_FNAME3.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME4.
PERFORM SEARCH USING P_FNAME4.
FORM SEARCH USING PFNA.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
STATIC = 'X'
CHANGING
FILE_NAME = PFNA.
ENDFORM. "SEARCH
Edited by: Kanishak Gupta on Feb 18, 2009 1:29 PM
‎2009 Feb 18 12:25 PM
Hi,
perform XYZ using field.
form XYZ using field.
call function F4_INT_TABLE_VALUE_REQUEST .
endform.
‎2009 Feb 18 12:26 PM
Hi!
Use the modularizing techniques of Subroutines and includes....
the code that is repeatedly called in your program write it in the subroutines and then call those subroutines with Perform statement in your program.....
this makes the program small and also easy to read.......
also u can use Includes in which u can put your Decdlarations in that and introduce it in the program.....
this way your program gets modularized...
‎2009 Feb 18 12:28 PM
Hi:
you can put it in either in subroutine or in macro and call as per you requirement.
Regards
Shashi
‎2009 Feb 18 12:39 PM
HI
THIS IS TESTED CODE ....in this you can change the value of W_CHAR and W_TABLE and use it or take it as parameter
do sum modification to get your functionality
**********************************************************************************************************
REPORT YH1306_TESTPACK123.
TABLES:
sflight.
PARAMETERS:
p_conn TYPE sflight-connid,
p_carr TYPE sflight-carrid.
data:
w_char TYPE dfies-fieldname VALUE 'CARRID',
w_table type string value 'T_TABLE'.
TYPES:
BEGIN OF type_s_carr,
carrid TYPE sflight-carrid,
END OF type_s_carr.
DATA:
t_table TYPE
STANDARD TABLE
OF type_s_carr
WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carr.
SELECT carrid
FROM sflight
INTO TABLE t_table
UP TO 1 ROWS.
perform sub_2 TABLES T_TABLE
using w_char
.
&----
*& Form SUB_2
&----
text
----
-->P_W_CHAR text
-->P_T_TABLE text
----
FORM SUB_2 TABLES T_TABLE
USING P_W_CHAR.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = p_w_char
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'C'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = T_table
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.
ENDFORM. " SUB_2
regards
Edited by: Mohit Kumar on Feb 18, 2009 1:39 PM
‎2009 Feb 18 1:03 PM
Hi,
you can use macros
sample code :
define write_frame.
call function 'K_KKB_POPUP_RADIO2'
exporting
i_title = &1
i_text1 = &2
i_text2 = &3
i_default = 1
IMPORTING
I_RESULT = I_RESULT
EXCEPTIONS
CANCEL = 1
OTHERS = 2
.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
end-of-definition.
write_frame 'pop_up_window' 'display' 'change'.
Thanks & Regards,
Sateesh.