Skip to Content
author's profile photo Former Member
Former Member

File Select Dialog Box parameters Screen

Hi,

How can i have a file selection dialog box in abap.

Parameters : fname(100) type c.

In the above code i want a search help button, by clicking it it should display a file dialog box.

In the file select dialog box if i select a file and click open the file name should be displayed in the fname text box.

Is this possible in SAP.

Thanks,

Bala.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Oct 29, 2008 at 10:56 AM

    Hi Bala ,

    Use the following function modules

    1 ./SAPDMC/LSM_F4_FRONTEND_FILE or F4_FILENAME

    PARAMETERS : p_upload TYPE rlgrap-filename
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_upload.
      CALL FUNCTION '/SAPDMC/LSM_F4_FRONTEND_FILE'
    * EXPORTING
    *   PATHNAME               =
        CHANGING
          pathfile               =p_upload
       EXCEPTIONS
         canceled_by_user       = 1
         system_error           = 2
         OTHERS                 = 3
                .
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

    or

    PARAMETERS : p_upload TYPE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR  p_upload .
     CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = p_upload.

    Thanks & Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 10:18 AM

    hi,

    You can do this as explained below.

    • Data Declaration.

    PARAMETERS : p_file TYPE rlgrap-filename.

    now,

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

    PERFORM f4_filename.

    FORM f4_filename.

    and now the definition for the form is,

    • FM to obtain the popup screen when F4 is clicked for uploading file

    CALL FUNCTION 'F4_FILENAME'

    EXPORTING

    program_name = syst-cprog

    dynpro_number = syst-dynnr

    IMPORTING

    file_name = p_file.

    ENDFORM.

    hope this is your requirement.

    regards,

    Anoop R.S

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 10:19 AM

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

    CALL FUNCTION 'F4_FILENAME'

    EXPORTING

    PROGRAM_NAME = SYST-CPROG

    DYNPRO_NUMBER = SYST-DYNNR

    FIELD_NAME = 'P_FILE'

    IMPORTING

    FILE_NAME = P_FILE.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 10:21 AM

    Hi,

    use FM 'F4_FILENAME'.

    PARAMETERS: p_file LIKE rlgrap-filename.
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 10:35 AM

    Try this,

    PARAMETERS FILE_NAME LIKE RLGRAP-FILENAME.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 10:37 AM

    Hi Bala,

    Try thr below code

    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME,

    BEGIN OF BLOCK B2 WITH FRAME.

    PARAMETERS: P_FNAME LIKE RLGRAP-FILENAME OBLIGATORY.

    SELECTION-SCREEN: END OF BLOCK B2,

    END OF BLOCK B1.

    *E V E N T : AT S E L E C T I O N - S C R E E N *

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME .

    CALL FUNCTION 'F4_FILENAME'

    EXPORTING

    program_name = syst-cprog

    dynpro_number = syst-dynnr

    IMPORTING

    file_name = P_FNAME

    .

    Cheers!!

    VEnk@

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.