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

Error with WS_FILENAME_GET

Former Member
0 Likes
885

Hi experts,

i have this piece of code, but I'm getting an ABAP dump. What could be wrong?

"A RAISE statement in the program "SAPLGRAP " raised the exception

condition "SELECTION_CANCEL".

Since the exception was not intercepted by a superior program

in the hierarchy, processing was terminated. "

PARAMETERS: p_file LIKE rlgrap-filename.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

  • DEF_FILENAME = ' '

DEF_PATH = 'C:\'

  • MASK = ' '

  • MODE = ' '

TITLE = 'Choose File'

IMPORTING

FILENAME = p_file

  • RC =

EXCEPTIONS

INV_WINSYS = 1

NO_BATCH = 2

SELECTION_CANCEL = 3

SELECTION_ERROR = 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.

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
769

Try below code...

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

mask = ',.,..'

mode = 'O'

title = text-006

def_filename = p_p_file

IMPORTING

filename = p_p_file

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

Hi experts,

i have this piece of code, but I'm getting an ABAP dump. What could be wrong?

"A RAISE statement in the program "SAPLGRAP " raised the exception

condition "SELECTION_CANCEL".

Since the exception was not intercepted by a superior program

in the hierarchy, processing was terminated. "

PARAMETERS: p_file LIKE rlgrap-filename.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

  • DEF_FILENAME = ' '

DEF_PATH = 'C:\'

  • MASK = ' '

  • MODE = ' '

TITLE = 'Choose File'

IMPORTING

FILENAME = p_file

  • RC =

EXCEPTIONS

INV_WINSYS = 1

NO_BATCH = 2

SELECTION_CANCEL = 3

SELECTION_ERROR = 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.

ENDIF.

5 REPLIES 5
Read only

Former Member
0 Likes
770

Try below code...

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

mask = ',.,..'

mode = 'O'

title = text-006

def_filename = p_p_file

IMPORTING

filename = p_p_file

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

Read only

Former Member
0 Likes
769

Hi

Check this link fro reference

Ranga

Read only

Former Member
0 Likes
769

Hi ,

try this

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

*SUBROUTINE TO GET THE FILE NAME.

PERFORM f_getfile CHANGING p_file.

FORM f_getfile CHANGING p_file TYPE ibipparms-path .

DATA : loc_fieldname TYPE dynpread-fieldname VALUE 'P_FILE'.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

field_name = loc_fieldname "P_FILE

IMPORTING

file_name = p_file.

Hope this will help.

Regards,

Rohan.

Read only

JozsefSzikszai
Active Contributor
0 Likes
769

you did not mention, which version of SAP do you use, but WS_FILENAME_GET is obsolate since... Better to replace it with a method, as it was suggested by Rich in your other question from yesterday:

Read only

Former Member
0 Likes
769

Thanks