09-21-2007 6:58 AM
Hi all..
i gt this program and is working well. But it can only select a file once. Second time select, the file in the textbox belong to the first select. It does not change to the second file.
eg. first select abc.txt
second select efg.txt
the textbox only capture the first select instead the second. Below is the code
Pls help me to amend the code. thks
REPORT ZGARY_FILE.
data: ifiletable type filetable.
data: xfiletable like line of ifiletable.
data: rc type i.
parameters: p_file1 type localfile.
at selection-screen on value-request for p_file1.
call method cl_gui_frontend_services=>file_open_dialog
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILENAME =
FILE_FILTER =
INITIAL_DIRECTORY = 'C:\Documents and Settings\Administrator\Desktop\gary'
MULTISELECTION =
changing
file_table = ifiletable
rc = rc
USER_ACTION =
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
others = 4.
.
read table ifiletable into xfiletable index 1.
if sy-subrc = 0.
p_file1 = xfiletable-FILENAME.
endif.
09-21-2007 7:02 AM
HI,
I think you might want to clear the table IFILETABLE before the call method. This should probably help out.
REWARDS IF HELPFUL!!
09-21-2007 7:02 AM
HI,
I think you might want to clear the table IFILETABLE before the call method. This should probably help out.
REWARDS IF HELPFUL!!
09-21-2007 7:15 AM
09-21-2007 7:17 AM
thks i done it......
hw to convert my code to use a dialog screen instead of the selection screen?
09-21-2007 8:25 AM
If you want to use a dialog screen instead of a Selection Screen. Use Statement 'Call Screen' in your Program, and remove the Parameters and Select-Options declarations.
eg. CALL SCREEN 100.. or 101, and Double Click on this Screen Number to go to Screen Painter and Create the Screen. You can then write the logic for buttons or fields created in PBO and PAI modules.
For information on how to call a screen from a program, visit:
Reward points if useful.
Thanks.
09-21-2007 9:23 AM
I had remove all the parameter and selection statement.
After which i implement the dialog, i execute and give me this error msg
DYNPRO_NOT_FOUND. what is this error?
09-21-2007 10:07 AM
may be its showing this error as you are not using the CALL SCREEN statement, but using PAI and PBO modules in your program. Or, it may also happen if you are writing CALL SCREEN statement in your program, but there is no PAI and PBO available.
The PAI and PBO modules should be supported by a Screen, which you call using the CALL SCREEN statement in your program, and create by Double Clicking on the Screen No. in the CALL SCREEN statement, which will take you to the Screen Layout, where you can design your Screen.
Let me know if u require further information.
Message was edited by:
Aziz Shan