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

without selection screen how can we featch the file.

Hi all,

without selection screen(parameter,select-options iam not using these both.) how can we featch the flat file what ever it may be (file format is xls.textor any thing) how ot do...plz it's urgent for me.

Regards,

Krishna,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 24, 2007 at 08:36 AM

    Hello,

    If u r not getting the file name from sel scr then u need to hardcode the filename with path in the report

    Regards,

    Vasanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 24, 2007 at 08:38 AM

    just hard code it in the program

    <b>Filename = 'D:\Documents and Settings\501030562\Desktop\Test.txt'.</b>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 24, 2007 at 08:50 AM

    Hi you need to hard code it and use it in your func mod, gui_upload.

    data: myfile type string value 'C:\file123.TXT'.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    filename = myfile

    • FILETYPE = 'ASC'

    • HAS_FIELD_SEPARATOR = ' '

    • HEADER_LENGTH = 0

    • READ_BY_LINE = 'X'

    • DAT_MODE = ' '

    • IMPORTING

    • FILELENGTH =

    • HEADER =

    tables

    data_tab =

    • 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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

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

    ENDIF.

    Hope this would be helpful for your information.

    Regards,

    Varun.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi varun,

      this is my sample code.here we are geting selection screen.without selection screen hoe to get file from out internal table.

      plz gothrough this code and replay to me varun.

      tables:pa0002.

      type-pools:truxs.

      *data:W_TRUXS_T_TEXT_DATA TYPE TRUXS_T_TEXT_DATA ,

      • it_p0001 type standard table of pa0001.

      *

      TYPES: BEGIN OF it_p0002,

      pernr like pa0002-pernr,

      nachn like pa0002-nachn,

      vorna like pa0002-vorna,

      end of it_p0002.

      DATA: t_p0002 type standard table of it_p0002,

      wa_p0002 type It_p0002.

      DATA: it_raw TYPE truxs_t_text_data.

      SELECTION-SCREEN BEGIN OF BLOCK S_BLK WITH FRAME TITLE TEXT-000.

      parameters: P_EXCEL TYPE RLGRAP-FILENAME.

      SELECTION-SCREEN end OF BLOCK S_BLK.

      AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_EXCEL.

      CALL FUNCTION 'F4_FILENAME'

      EXPORTING

      PROGRAM_NAME = SYST-CPROG

      DYNPRO_NUMBER = SYST-DYNNR

      FIELD_NAME = 'P_EXCEL'

      IMPORTING

      FILE_NAME = P_EXCEL .

      *

      START-OF-SELECTION.

      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

      EXPORTING

      • I_FIELD_SEPERATOR =

      I_LINE_HEADER = 'X'

      I_TAB_RAW_DATA = it_raw

      I_FILENAME = p_excel

      TABLES

      I_TAB_CONVERTED_DATA = t_p0002[]

      EXCEPTIONS

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

      end-of-selection.

      loop at t_p0002 into wa_p0002.

      write:/ wa_p0002-pernr,

      wa_p0002-nachn,

      wa_p0002-vorna.

      endloop.

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.