Application Development 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: 

file browsing

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI,

I think you might want to clear the table IFILETABLE before the call method. This should probably help out.

REWARDS IF HELPFUL!!

6 REPLIES 6

Former Member
0 Kudos

HI,

I think you might want to clear the table IFILETABLE before the call method. This should probably help out.

REWARDS IF HELPFUL!!

0 Kudos

how to clear the table?

0 Kudos

thks i done it......

hw to convert my code to use a dialog screen instead of the selection screen?

0 Kudos

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.

0 Kudos

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?

0 Kudos

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