Skip to Content
avatar image
Former Member

hi what the use f4_filename plz send some example code.?

hi iam shabeer iam abap fresher i want to select a file which i have saved in c drive of harddisk through sap report iam confuse what values would give import and export will u plz help me.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    May 06, 2008 at 11:10 AM

    hi check this...

    TABLES : MARA.

    *----


    INTERNAL TABLE DECLARATION

    TYPES : BEGIN OF ITAB,

    MATNR TYPE MARA-MATNR,

    MEINS TYPE MARA-MEINS,

    ERNAM LIKE MARA-ERNAM,

    AENAM LIKE MARA-AENAM,

    MTART LIKE MARA-MTART,

    END OF ITAB.

    DATA : IG_ITAB type ITAB OCCURS 0.

    DATA : V_FILE TYPE STRING.

    DATA : T_FILE TYPE RLGRAP-FILENAME.

    *----


    RETRIVE DATA FROM DATABASE

    SELECT

    MATNR

    MEINS ERNAM AENAM MTART FROM MARA

    INTO CORRESPONDING FIELDS OF TABLE

    IG_ITAB

    up to 10 rows.

    *----


    CALLING FUNCTION MODULES

    CALL FUNCTION 'F4_FILENAME' "PASS THE FILE NAME AS U NEED.

    EXPORTING

    FIELD_NAME = 'T_FILE'

    IMPORTING

    FILE_NAME = T_FILE.

    V_FILE = T_FILE. "STRING CONVERSION

    *----


    CALLING GUI DOWNLOAD TO EXTRACT

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    filename = V_FILE

    FILETYPE = 'ASC'

    WRITE_FIELD_SEPARATOR = 'X'

    WRITE_LF = 'X'

    tables

    data_tab = IG_ITAB .

    regards,

    venkat appikonda

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 06, 2008 at 11:12 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 06, 2008 at 11:12 AM

    hi,

    Check out the below related link

    http://www.sap-img.com/abap/using-function-modules-f4-filename.htm

    Regards,

    Santosh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 06, 2008 at 11:16 AM

    Hi,

    Check this sample code from Standard program.

    PROCESS ON VALUE-REQUEST.

    FIELD IBIPPARMS-PATH MODULE HELP_PATH.

    MODULE help_path INPUT.

    PERFORM buttons_pressed.

    IF ibipparms-pc = 'X'.

    CALL FUNCTION 'F4_FILENAME'

    EXPORTING

    field_name = 'IBIPPARMS-PATH'

    IMPORTING

    file_name = ibipparms-path.

    ELSEIF ibipparms-unix = 'X'.

    CALL FUNCTION 'F4_FILENAME_SERVER' DESTINATION ibipparms-server

    EXPORTING

    pfad = ibipparms-path

    IMPORTING

    FILE_NAME =

    EXCEPTIONS

    no_file_on_server = 1

    OTHERS = 2.

    ENDIF.

    ENDMODULE. " HELP_PATH INPUT

    Regards,

    Shiva.

    Add comment
    10|10000 characters needed characters exceeded