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

header in text file.

Hi expert,

wn i m downloading a text file into presentation server , hw can i add header there for heading of the particular fieds which is showing in file.plz suggest.

thanx and regards...

sunil.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 09:06 AM

    Hi Sunil,

    When you want to add header details for the records at the time of downloading it to presentation server, Just add the Header Values as the first Row of your internal table and then append other records.

    Then use your internal table in 'GUI_DOWNLOAD' FM to download it to presentation server.

    Hope this helps your requirement.

    Award points if helpful.

    Regards,

    Ananth

    Add a comment
    10|10000 characters needed characters exceeded

    • hello,

      you can try doing as mentioned above

      however, in some cases, the datatype of the internal table may not allow you to entire the text header string that you need

      in such cases you can use this method

      what i have done here, is to make a simple internal table with text values to insert the text

      i used that table with the FM first

      then i called the function module again and passed the data

      in the second call, i set the append parameter to 'X'.

      types: begin of header_type,
        field1(20),
        field2(20),
        field3(20),
       end of header_type.
      data: it_header type header_type occurs 0 with header line.
      
      it_header-field1 = 'field_1'.
      it_header-field2 = 'field_2'.
      it_header-field3 = 'field_3'.
      append it_header.
      
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename              = 'c:\test_xls.xls'
          filetype              = 'ASC'
          write_field_separator = 'X'
          DAT_MODE              = 'X'
          TRUNC_TRAILING_BLANKS = 'X'
        TABLES
          data_tab              = it_header.
      
      
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename              = 'c:\test_xls.xls'
          filetype              = 'ASC'
          append                = 'X'
          write_field_separator = 'X'
          DAT_MODE              = 'X'
          TRUNC_TRAILING_BLANKS = 'X'
        TABLES
          data_tab              = itab.
      
      

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 09:23 AM

    hi

    good

    declare the header fields as the character types, before moving the internal table data to the final internal table which will display data to the output try to move the header details to the particular internal table.

    thanks

    mrutyun^

    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.