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

header information to gui_download

Hi all,

How will i pass the header information the fileds inthe internal table to the FM GUI_DOWNLOAD..?

thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 07:04 AM

    Hi,

    U have to use FIELDNAMES parameter under the tables parameter for getting the same.

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 19, 2008 at 07:05 AM

    hi,

    use this.

      DATA : BEGIN OF it_join_fields OCCURS 0,
             field_name(20),
             END OF it_join_fields.
    
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                        = file_name
          filetype                        = 'ASC'
          append                          = 'X'
          write_field_separator           = 'X'
        TABLES
          data_tab                        = it_join_det_new
          fieldnames                      = it_join_fields   < ----------  pass this
                .
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 07:06 AM

    Hi,

    You have to append one row into the Internal table with the header Data.

    For thsi Use the Field names Parameter.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 19, 2008 at 07:06 AM

    Hi,

    Use 2 time GUI_DOWNLOAD FM first to download an internal table with header details, and same FM with APPEND parameter with item internal table.

    Search the SCN you will find the coding for it.

    Regards

    Bala Krishna

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 07:07 AM

    Refer to FM documentation for detailed example on usage

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 07:07 AM

    Hi,

    In ECC6, you can pass the header(field names) to TABLES parameter - FIELDNAMES.

    In 4.6C, First pass header to the DATA_TAB of GUI_DOWNLOAD and the again call GUI_DOWNLOAD and pass the actual data to DATA_TAB and here pass 'X' to APPEND parameter.

    Regards

    eswar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 07:09 AM

    Neha,

    Try this code

     
    *    CALL FUNCTION 'WS_DOWNLOAD'	
    *      EXPORTING
    *        CODEPAGE            = 'IBM'
    *        FILENAME            = FILE
    *        FILETYPE            = 'ASC'
    *      TABLES
    *        DATA_TAB            = DATA_TAB
    *      EXCEPTIONS
    *        FILE_OPEN_ERROR     = 1
    *        FILE_WRITE_ERROR    = 2
    *        INVALID_FILESIZE    = 3
    *        INVALID_TABLE_WIDTH = 4
    *        INVALID_TYPE        = 5
    *        NO_BATCH            = 6
    *        UNKNOWN_ERROR       = 7.
    
    DATA : lv_filename type STRING.
    lv_filename = file.
    CONSTANTS: LV_FILETYPE TYPE CHAR10 VALUE 'ASC'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = lv_filename
        FILETYPE                        = 'ASC'
        CODEPAGE                        = 'IBM'
      TABLES
        DATA_TAB                        = DATA_TAB
      EXCEPTIONS
        FILE_WRITE_ERROR                = 1
        NO_BATCH                        = 2
        GUI_REFUSE_FILETRANSFER         = 3
        INVALID_TYPE                    = 4
        NO_AUTHORITY                    = 5
        UNKNOWN_ERROR                   = 6
        HEADER_NOT_ALLOWED              = 7
        SEPARATOR_NOT_ALLOWED           = 8
        FILESIZE_NOT_ALLOWED            = 9
        HEADER_TOO_LONG                 = 10
        DP_ERROR_CREATE                 = 11
        DP_ERROR_SEND                   = 12
        DP_ERROR_WRITE                  = 13
        UNKNOWN_DP_ERROR                = 14
        ACCESS_DENIED                   = 15
        DP_OUT_OF_MEMORY                = 16
        DISK_FULL                       = 17
        DP_TIMEOUT                      = 18
        FILE_NOT_FOUND                  = 19
        DATAPROVIDER_EXCEPTION          = 20
        CONTROL_FLUSH_ERROR             = 21
        OTHERS                          = 22.
    file = lv_filename.
    

    Thanks and Regards,

    Syf

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 02:16 PM

    Hi Neha,

    Say for example I'm downloading a internal table with 4 fields namely field1, field2, field3 and field4.

    I want these field name in the header, then this is the way to do it.

    TYPES: BEGIN OF ty_head, "Structure for header
                 h(10) TYPE c,
                 END OF ty_head.
    DATA: it_head  TYPE TABLE OF ty_head WITH HEADER LINE.
    
    "Adding header details
    it_head-h = 'Field1'.
    APPEND it_head.
    
    it_head-h = 'Field2'.
    APPEND it_head.
    
    it_head-h = 'Field3'.
    APPEND it_head.
    
    it_head-h = 'Field4'.
    APPEND it_head.
    
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = p_file
       filetype                        = 'ASC'
       write_field_separator           = 'X'
       header                          = '00'  "<= note this
      TABLES
        data_tab                        = it_tab
       fieldnames                      = it_head[] "<= Pass your header table here
     EXCEPTIONS
       OTHERS                          = 1.

    Hope this helps.

    Regards,

    Manoj Kumar P

    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.