Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

FIle path in Screen Programming

Hi I am new to screen programming.

My program would pick a file from desktop and process it.

I am a bit confused how would I give the file path. Should it be a input/output field??

I want something like,

PARAMETERS: filename TYPE text255 OBLIGATORY.

ANy suggestions.

Ster.

Tags:
replied

Hi,

Check below code will be useful.

PARAMETERS : p_flnm LIKE rlgrap-filename.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FLNM.

perform F4_HELP.

FORM F4_HELP.

  IF SY-UCOMM <> 'onli'.
    CALL FUNCTION 'WS_FILENAME_GET'
         EXPORTING
              DEF_FILENAME     = P_FLNM
              DEF_PATH         = 'c:\my documents'
              MASK             = ',*.*,*.*.'
              MODE             = 'O'
              TITLE            = 'Open PC File for Upload'
         IMPORTING
              FILENAME         = P_FLNM
         EXCEPTIONS
              INV_WINSYS       = 01
              NO_BATCH         = 02
              SELECTION_CANCEL = 03
              SELECTION_ERROR  = 04.
    IF SY-SUBRC <> 0.
      MESSAGE E000(0) WITH 'error locating upload file on PC' P_FLNM.
    ENDIF.
  ENDIF.

ENDFORM.             "F4_HELP

Regards

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question