10-17-2007 4:38 AM
Hi Folks,
I had declare the parameter p_fname1 as below,but it is not getting me the F4 help in the selection screen.What could be the reason
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS:P_FNAME1 LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK B1.
Thanks,
K.Kiran.
10-17-2007 4:42 AM
Just add this code
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME1.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_FNAME1
.
regards
shiba dutta
10-17-2007 4:42 AM
Just add this code
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME1.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_FNAME1
.
regards
shiba dutta
10-17-2007 4:42 AM
at selection-screen value request p_fname1.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS:P_FNAME1 LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK B1.
10-17-2007 4:43 AM
Hi Kiran,
You can use the following piece of code:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
REFRESH t_file.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select a File'
default_extension = '..*.XLS'
default_filename =
file_filter = '*.xls'
with_encoding =
initial_directory =
multiselection =
CHANGING
file_table = t_file
rc = rc
user_action =
file_encoding =
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 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.
ELSE.
READ TABLE t_file INTO wa_file INDEX 1.
p_file = wa_file-filename.
ENDIF.
Regards,
Himanshu
10-17-2007 4:45 AM
hi kiran,
For these use 'F4_FILENAME' Function Module .
check this code.
PARAMETERS: p_file LIKE rlgrap-filename. "File Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME' "F4 help for file browsing
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
IMPORTING
file_name = p_file
.
reward me if useful...........
Harimanjesh AN
10-17-2007 5:21 AM
hi,
do the following:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname1.
PERFORM f001_f4_filename CHANGING p_fname1.
FORM f001_f4_filename CHANGING exp_file TYPE ibipparms-path.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = exp_file.
ENDFORM.
10-17-2007 5:33 AM
Hi Kiran,
Pls check the code below.
----
Selection Screen *
----
SELECTION-SCREEN BEGIN OF BLOCK b01.
SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME TITLE text-b11.
PARAMETERS : p_local AS CHECKBOX DEFAULT 'X' MODIF ID grp,
p_output LIKE rlgrap-filename OBLIGATORY MODIF ID grp.
DEFAULT c_file. D-RD1K907385
SELECTION-SCREEN END OF BLOCK b11.
SELECTION-SCREEN BEGIN OF BLOCK b12 WITH FRAME TITLE text-b12.
SELECT-OPTIONS : s_paobjn FOR ykpcat_paobjnr-paobjnr MODIF ID mod,
s_type FOR ykpcat_paobjnr-type MODIF ID mod.
SELECTION-SCREEN END OF BLOCK b12.
SELECTION-SCREEN END OF BLOCK b01.
SELECTION-SCREEN BEGIN OF BLOCK b02 WITH FRAME TITLE text-b02.
PARAMETERS : p_delws RADIOBUTTON GROUP rd1 USER-COMMAND flag,
p_modify RADIOBUTTON GROUP rd1 DEFAULT 'X',
p_delete RADIOBUTTON GROUP rd1 .
SELECTION-SCREEN END OF BLOCK b02.
----
AT SELECTION-SCREEN *
----
*--Providing F4 help for the file.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_output.
PERFORM execute_f4help USING 'P_OUTPUT' 'P_LOCAL'.
*--Providing F4 help for the Profitability Segment Number.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_paobjn-low.
PERFORM execute_f4help_field.
&----
*& Form execute_f4help
&----
Form called for f4 help to the output file field.
----
FORM execute_f4help USING fp_file
fp_local.
*-- Local data declaration
DATA : l_local TYPE c,
tl_dynpread TYPE STANDARD TABLE OF dynpread WITH HEADER LINE.
CLEAR l_local.
REFRESH tl_dynpread.
*-- Populating tl_dynpread with screen elements ie checkboxes whose
*-- Values are tracked.
tl_dynpread-fieldname = fp_local. " Presentation Server
APPEND tl_dynpread.
*-- Check the Values from Screen
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog " Calling program
dynumb = sy-dynnr " Screen number
TABLES
dynpfields = tl_dynpread
EXCEPTIONS
OTHERS = 11.
IF sy-subrc NE 0.
MESSAGE e103(zz) WITH
'Exception raised while reading the Screen.'(002).
ENDIF. " IF SY-SUBRC NE 0.
*-- Getting server type
READ TABLE tl_dynpread WITH KEY fieldvalue = 'X'
BINARY SEARCH.
IF sy-subrc IS INITIAL.
l_local = 'P'.
ELSE.
l_local = 'A'.
ENDIF.
*-- Selects the directory list based on the dowmload location
*-- button selected.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = fp_file
dyname = sy-cprog
dynumb = sy-dynnr
filetype = 'P'
location = l_local
server = space.
ENDFORM. " EXECUTE_F4HELP
Jus copy the code as above and u can get the F4 help u want.
Reward if helpful.
Cheers...!!!!
Sharadendu
10-17-2007 5:52 AM
Shiba,
Thanks.It worked.But need some more info.
I have a selection screen with P_fname1 as paraemeter followed by a pushbutton print.When the user clicks on it is calling a smartform and later displays the error log.Everything is working fine.But when I included this f4 help logic for p_fname1,the moment I am selecting the file from the desktop it is calling the smartform etc.Working fine but I want the filename to be filled in the p_fname1 and later on pressing print button it should call the smartform.Now it is calling the smartform when I select the textfile from the desktop itself.Any idea what could be the reason?
Thanks,
K.Kiran.
10-17-2007 6:00 AM
hi kiran,
write ur code to call the function module of smartform in the PBO of ur screen where u have placed ur button.
If u r not using the module pool programming then call the function module of smartform in the AT USER-COMMAND Event of the report program and u have to create a button in GUI status. And call that status in ur report using SET PF-STATUS 'XXX" command.
reward me if useful.......
Harimanjesh AN
10-17-2007 6:41 AM
Hi Folks,
The problem got solved.I removed the push button and
<b>at selection-screen output.</b>
at selection-screen on value-request for p_fname1.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = p_fname1
.
<b>start-of-selection.</b>
perform getdata.
the statements in bold has helped me.
Thanks alot.
K.Kiran.
10-17-2007 6:13 AM
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
call the FM <b>KD_GET_FILENAME_ON_F4</b>
This will solve ur prob
Reward if helpful
10-17-2007 6:42 AM
10-17-2007 6:44 AM
Can you paste your code ? Because I think you are not coding the pushbutton code in AT SELECTION-SCREEN event.
Just check this format of coding.
tables : sscrfields.
PARAMETERS : P_FNAME LIKE RLGRAP-FILENAME .
selection-screen skip 2.
selection-screen pushbutton /10(20) push user-command inst.
initialization.
move 'Next' to push.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_FNAME
.
at selection-screen.
case sscrfields-ucomm.
when 'INST'.
<call tthe smart form or set any flag for further use>
endcase.
start-of-selection.
<further processing>
regards
shiba dutta