Application Development and Automation 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: 
Read only

Regarding file name

Former Member
0 Likes
730

Hi friends,

When i give a file name, why is the directory not shown on the screen and only the filename is shown.

For example when i give address D:\bH.txt on the screen it shows as bh.txt only

What can i do for this.

Regrads

mahesh kumar

Hi friends,

When i give a file name, why is the directory not shown on the screen and only the filename is shown.

For example when i give address D:\bH.txt on the screen it shows as bh.txt only

What can i do for this.

Regrads

mahesh kumar

5 REPLIES 5
Read only

Former Member
0 Likes
700

This message was moderated.

Read only

Former Member
0 Likes
700

To Give a filename first you define a parameter of type rlgrap-filename. Then you call a function module on the event: at selection-screen on value-request for <parameter name>.

Refer to the code example below:

selection-screen: begin of block b1 with frame title text-024.

selection-screen: skip 1.

parameters: p_fl_nm type rlgrap-filename. " OBLIGATORY. "parameter to get file name

selection-screen: skip 1.

selection-screen: end of block b1.

at selection-screen on value-request for p_fl_nm.

call function 'KD_GET_FILENAME_ON_F4'

exporting

program_name = syst-repid

dynpro_number = syst-dynnr

mask = ',.,.,'

changing

file_name = p_fl_nm

exceptions

mask_too_long = 1

others = 2.

if sy-subrc <> 0.

endif.

Read only

Former Member
0 Likes
700

Hi Mahesh,

for selecting from the directory just follow the example code,


SELECTION-SCREEN : BEGIN OF BLOCK 001 WITH FRAME TITLE text-001.
PARAMETERS: p_upl       LIKE rlgrap-filename MODIF ID a           "Upload File
                         DEFAULT 'c:\temp\parbmat.xls',
SELECTION-SCREEN : END OF BLOCK 001.

for selecting just follow the example code,


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_upl.
  CALL FUNCTION 'WS_FILENAME_GET'
    IMPORTING
      filename         = p_upl
    EXCEPTIONS
      inv_winsys       = 1
      no_batch         = 2
      selection_cancel = 3
      selection_error  = 4
      OTHERS           = 5.

Edited by: suresh suresh on Aug 5, 2009 7:49 AM

Read only

venkat_o
Active Contributor
0 Likes
700

Hi Mahesh, <li> I think that you might be defaulting only file name without directory of the file in the PBO of selection-screen that is AT SELECTION-SCREEN OUTOUT event. Thanks Venkat.O

Read only

Former Member
0 Likes
700

Answered