Skip to Content
avatar image
Former Member

Name of function modile

Hello all,

Can anybody tell what is the function module name when f4 is pressed in the selection screen so that folder should be selected on local server.

Thanks in advance

srinivas

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • avatar image
    Former Member
    Aug 16, 2007 at 01:02 PM

    Hi,

    Use FM <b>F4_FILENAME</b>

    Reward points if useful.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 16, 2007 at 12:50 PM

    To select a file on the local system, you can use the function module F4_FILENAME

    Please mark points if the solution was useful.

    Regards,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 16, 2007 at 12:51 PM

    Hi

    check this prog

    here check this program i am spliting the record depend upon ',' and dont use ws_upload etc fm's are obsolete....

    data: begin of itab_string occurs 0,

    record type char255,

    end of itab_string.

    data: L_FILETABLE TYPE FILETABLE,

    L_FILETAB_H TYPE FILETABLE WITH HEADER LINE.

    data: p_file1 type string.

    • selection screen .

    PARAMETERS: P_FILE TYPE LOCALFILE.

    initialization.

    at selection-screen on value-request for P_FILE.

    • IF THE USER SELECT EXTENTION BUTTON IT WILL OPEN THE LOCAL DIRECTORY FOR SELECTING THE FILE LOCATION.

    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG

    • EXPORTING

    • WINDOW_TITLE =

    • DEFAULT_EXTENSION = 'CSV'

    • DEFAULT_FILENAME = 'C:\Documents and Settings\196093\Desktop\STATUS.csv'

    • FILE_FILTER =

    • INITIAL_DIRECTORY = 'C:\Documents and Settings\196093\Desktop\'

    • MULTISELECTION =

    • WITH_ENCODING =

    CHANGING

    FILE_TABLE = L_FILETABLE

    RC = RC

    • USER_ACTION =

    • FILE_ENCODING =

    EXCEPTIONS

    FILE_OPEN_DIALOG_FAILED = 1

    CNTL_ERROR = 2

    ERROR_NO_GUI = 3

    NOT_SUPPORTED_BY_GUI = 4

    others = 5

    .

    IF SY-SUBRC <> 0.

    ELSE.

    LOOP AT l_filetable INTO L_FILETAB_H.

    P_FILE = L_FILETAB_H-FILENAME.

    move p_file to p_file1.

    EXIT.

    ENDLOOP.

    ENDIF.

    • passing the selected file name to gui_upload for loading the data

    • into internal table

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    FILENAME = p_file1

    • FILETYPE = 'ASC'

    • HAS_FIELD_SEPARATOR = ' '

    • HEADER_LENGTH = 0

    • READ_BY_LINE = 'X'

    • DAT_MODE = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • CHECK_BOM = ' '

    • NO_AUTH_CHECK = ' '

    • IMPORTING

    • FILELENGTH =

    • HEADER =

    TABLES

    DATA_TAB = itab_string

    EXCEPTIONS

    FILE_OPEN_ERROR = 1

    FILE_READ_ERROR = 2

    NO_BATCH = 3

    GUI_REFUSE_FILETRANSFER = 4

    INVALID_TYPE = 5

    NO_AUTHORITY = 6

    UNKNOWN_ERROR = 7

    BAD_DATA_FORMAT = 8

    HEADER_NOT_ALLOWED = 9

    SEPARATOR_NOT_ALLOWED = 10

    HEADER_TOO_LONG = 11

    UNKNOWN_DP_ERROR = 12

    ACCESS_DENIED = 13

    DP_OUT_OF_MEMORY = 14

    DISK_FULL = 15

    DP_TIMEOUT = 16

    OTHERS = 17

    .

    IF SY-SUBRC <> 0.

    MESSAGE I000(Z00) WITH 'PLEASE PROVIDE CORRECT FILE NAME'.

    ENDIF.

    loop at itab_string.

    • now split the statuses

    split itab_string at ',' into itab_status-aufnr itab_status-asttx itab_status-asttx1.

    • and move one internal table

    append itab_status.

    clear itab_status.

    endloop.

    reward points to all helpful answers

    kiran.M

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 16, 2007 at 12:52 PM

    Hi,

    try this fm

    TMP_GUI_BROWSE_FOR_FOLDER

    thanks & regards,

    Venkatesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 16, 2007 at 01:00 PM

    F4_FILENAME

    regards,

    srinivas

    <b>*reward for useful answers*</b>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 16, 2007 at 01:01 PM
    PARAMETERS:p_file LIKE rlgrap-filename.
    
    *Input Help for the Download Directory
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                program_name  = v_repid
                dynpro_number = syst-dynnr
                field_name    = 'P_FILE'
           IMPORTING
                file_name     = p_file.
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 16, 2007 at 01:04 PM

    HI,

    SELECTION-SCREEN: BEGIN OF BLOCK IMP WITH FRAME TITLE TEXT-003.

    PARAMETERS: P_FN_IMP LIKE RLGRAP-FILENAME OBLIGATORY. "File Name

    SELECTION-SCREEN: END OF BLOCK IMP.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FN_IMP.

    *-- Get the File Dialog

    PERFORM SELECT_FILENAME.

    &----


    *& Form select_filename

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM SELECT_FILENAME .

    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

    EXPORTING

    PROGRAM_NAME = SY-REPID

    DYNPRO_NUMBER = SY-DYNNR

    CHANGING

    FILE_NAME = P_FN_IMP

    EXCEPTIONS

    MASK_TOO_LONG = 1

    OTHERS = 2.

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    ENDFORM. " select_filename

    Thanks

    Mahesh

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 16, 2007 at 01:06 PM

    Try this.

    
    report zrich_0001.
    
    data: folder type string.
    data: rc type i.
    
    parameters: p_file1 type localfile default'C:'.
    
    at selection-screen on value-request for p_file1.
    
      call method cl_gui_frontend_services=>directory_browse
         exporting
            window_title  = 'Pick a folder'
            initial_folder = 'C:'
       changing
            selected_folder             = folder.
    
      call method cl_gui_cfw=>flush( ).
      p_file1 = folder.
    
    
    
    
    

    Regards,

    RIch Heilman

    Add comment
    10|10000 characters needed characters exceeded