GUI_DOWNLOAD like SE16 format

Hi all,
i have a requirement to build a report to download standard tables dinamically in foreground to a .txt file in the same format like going through SE16, displaying a standard table and go to System --> List --> Save --> Local File (format unconverted, Encoding 0000).
To achive this, i am using GUI_DOWNLOAD but i am not able to download it with the same format as through SE16.
Can I achive this with FM GUI_DOWNLOAD? What  parameters and values in the export i have to provide?
If i cant do this using this FM, what can i do to reach my requirement?
Thanks in advance.

Hi
You can try something like this:
PARAMETERS: P_TABLE TYPE DD02L-TABNAME.
DATA: DFIES_WA TYPE TABLE OF DFIES WITH HEADER LINE.
DATA: MY_TAB   TYPE REF TO DATA.
FIELD-SYMBOLS: <MY_TAB>   TYPE TABLE,
               <WA_TAB>   TYPE ANY,
               <WA_FIELD> TYPE ANY.
DATA: W_RECORD TYPE STRING,
      T_FILE   LIKE STANDARD TABLE OF W_RECORD,
      L_LINE(10000) TYPE C.
DATA: L_OFFSET      TYPE I,
      L_LEN         TYPE I,
      L_OUT         TYPE I.
START-OF-SELECTION.
  CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      TABNAME        = P_TABLE
    TABLES
      DFIES_TAB      = DFIES_WA
    EXCEPTIONS
      NOT_FOUND      = 1
      INTERNAL_ERROR = 2
      OTHERS         = 3.
  IF SY-SUBRC <> 0.
    EXIT.
  ENDIF.
  CREATE DATA MY_TAB TYPE TABLE OF (P_TABLE).
  ASSIGN MY_TAB->* TO <MY_TAB>.
  CHECK SY-SUBRC = 0.
  SELECT * INTO TABLE <MY_TAB>
    FROM (P_TABLE).
* Header
  LOOP AT DFIES_WA.
    L_LINE+L_OFFSET = '|'.
    L_OFFSET = L_OFFSET + 1.
* Output lenght
    L_LEN = STRLEN( DFIES_WA-FIELDNAME ).
    IF L_LEN > DFIES_WA-OUTPUTLEN.
      L_OUT = L_LEN.
    ELSE.
      L_OUT = DFIES_WA-OUTPUTLEN.
    ENDIF.
    L_LINE+L_OFFSET(L_OUT) = DFIES_WA-FIELDNAME.
    L_OFFSET = L_OFFSET + L_OUT.
  ENDLOOP.
  IF SY-SUBRC = 0.
    L_LINE+L_OFFSET = '|'.
    MOVE L_LINE TO W_RECORD.
    APPEND W_RECORD TO T_FILE.
  ENDIF.
* Data
  LOOP AT <MY_TAB> ASSIGNING <WA_TAB>.
    CLEAR L_LINE.
    CLEAR L_OFFSET.
    CLEAR W_RECORD.
    LOOP AT DFIES_WA.
      L_LINE+L_OFFSET = '|'.
      L_OFFSET = L_OFFSET + 1.
* Output lenght
      L_LEN = STRLEN( DFIES_WA-FIELDNAME ).
      IF L_LEN > DFIES_WA-OUTPUTLEN.
        L_OUT = L_LEN.
      ELSE.
        L_OUT = DFIES_WA-OUTPUTLEN.
      ENDIF.
* Value field
      ASSIGN COMPONENT DFIES_WA-FIELDNAME OF STRUCTURE <WA_TAB> TO <WA_FIELD>.
      MOVE <WA_FIELD> TO L_LINE+L_OFFSET(L_OUT).
      L_OFFSET = L_OFFSET + L_OUT.
    ENDLOOP.
    IF SY-SUBRC = 0.
      L_LINE+L_OFFSET = '|'.
      MOVE L_LINE TO W_RECORD.
      APPEND W_RECORD TO T_FILE.
    ENDIF.
  ENDLOOP.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME = 'C:\temp\table_sap.txt'
      FILETYPE = 'ASC'
    TABLES
      DATA_TAB = T_FILE.

Similar Messages

  • I would like to format my printable into 8x10 so when I save it as a png it will be 8x10

    I would like to format my printable into 8x10 so when I save it as a png it will be 8x10

    Saflo33 you have posted to the Creative Cloud forum.  Which Adobe software or service is your inquiry in relation too?  I would recommend posting your inquiry to the forum specific to that software title.  You can find a list of the available forums at http://forums.adobe.com/index.jspa?promoid=JZEFM.

  • I would like to format cells with time only.  when I enter a time of day the current date is still in the cell which is not necessarily so

    I would like to format cells with time only.  when I enter a time of day the current date is still in the cell which is not necessarily so.  THere are  no options for just  date .

    christine275 wrote:
    ... (this is a time worked by date and not always entered on the date worked)--
    "Time" in Numbers is always "Time of Day", and is always part of a Date and Time value. "Amount of Time" is a Duration value, which may be displayed in a similar format to "Time of Day," but is a different type of value.
    If you are entering the number of hours and minutes worked, format the column as Duration, set the units and the format in which you want to have the value appear.
    The Date column will still contain a Date and Time value (Jan 1, 2011 00:00:00 in the cell shown in the example), but the "Time Worked" cells will contain only a Duration value.
    Incidently, the Date in A2 was entered as "jan 1" (without the quotes). Numbers automatically adds the current year and the default time value, then displays the result in the closest format to what you've entered, or in the Date and Time format you have chosen.
    The Duration value in B2 was entered as 3:15 (as displayed). Note that in the entry bar the duration is displayed as 3h 15m, probably to distinguish it from a similarly formatted (Date and) Time value.
    Regards,
    Barry

  • I would like to format the external hard disk.  I would like to use it in Mac as well as in Windows.  What format should I do, connect to Macbook Pro? MS-DOS (FAT) or ExFAT ?

    I would like to format the external hard disk.  I need to use it in Mac as well as in Windows.  What format should I do, connect to Macbook Pro?  MS-DOS (FAT) or ExFAT ?

    success1975 wrote:
    Thanks
    1) In 'ExFAT' format, is there a limitation on the file size?
    Not one that will matter.
    2) Is 'MAC OS Extended' format, only for MAC computers?
    Yes, only for Mac
    3) What are those (a) journaled (b) Encrypted & (c) Case-sensitive? or when to use those?
    Again, only for Mac.

  • I am a teacher and I would like to format my page in PAGES to have lines...similar to that of lined paper. Is this possible?

    I am a teacher and I would like to format my page in PAGES to have lines...similar to that of lined paper. Is this possible?

    Hi Jay,
    I've played with this before, but I was never happy with the result. I gave it another shot to answer your question, and I'm pretty pleased with this result. I'll say that you have a lot of latitude for adjustments in this template, so don't take it as being restrictive to what I'm illustrating. For instance, you can easily vary the line spacing, the weight of the lines, the color, etc.
    In this example, the pitch of the lines is 32 points per line, blue stroke, and I placed a light yellow shape in the background. Here's the approach...
    Open a blank Word Processing Template.
    View > Show Layout.
    Pages Preferences > Rulers > Ruler Units: Points.
    Insert > Table.
    Set the Table to 1-column, 0 Header Rows, and Footer Rows, Row Height = 32 points.
    In the Wrap Inspector, set the table to Floating, and Does NOT cause Wrap.
    Align the Top Left of the Table with the top Left of the Text Area.
    Increase the Column Width until the single column extends all the way across the Text Area.
    Increase the number of Rows until the table just fills the vertical Text Area of the page layout, plus one row..
    Set the Outside Cell Borders to None.
    Set the Mid Horizontal borders to Blue.
    With the entire Table Selected, Arrange > Send Object to Background. Format >Advanced > Move Objects to Section Master, Arrange > Lock
    If you want the colored background, Insert > Object > Rectangle. Graphics Inspector > Stroke > None. Color > your choice.
    Stretch the Shape to cover the entire page size. Arrange > Send Object to Background. Format > Advanced > Send Objects to Section Master.
    If the colored object is obscuring the lines, then: Arrange > Send Backward. In either case, Arrange > Lock.
    Paste a good size paragraph (several lines) into the document.
    Select the text. In the Text Inspector, set line spacing to Exactly and 32 Points.
    Inspect the alignment of the Text and the Lines. If you are not pleased, Select the Table and bump it up or down with the vertical Arrow keys.
    If you are satisfied, with the overall effect, Select all the Text and Type: Click here and enter text. Select the text "Click here and enter text." and Format > Advanced > Define as Placeholder Text. Lastly, File > Save as Template.
    As I mentioned at the outset, you can easily modify these instructions to increase or decrease the number of lines per page, the type size, etc.
    If you want to email me, I'll send you a copy of the template I displayed here.
    Regards,
    Jerry

  • I've usd RecMyFile to recover .JSON file but I get "Unable to process the backup file" be like Unknown format

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/887204]]</blockquote>
    I've usd RecMyFile to recover .JSON file but I get "Unable to process the backup file" be like Unknown format
    like this > http://goo.gl/pHTkr < Please help me Please

    All worked very well - this is a good solution. The key was finding the Profiles in my Users folder.

  • Layout baisc settins like page format not allowedin dev 100 client.....!!!

    Hi all,
    i have copied standard lay out set in to Zform in client 100 (Dev).
    now i m trying to change it's page fornat ( like Landscape Format).
    It is not allowing to change  or display Zform basic settings (Attributes) in 100 . it is giving message "Language En Locked original Language DE Being Processed".
    pls check & revert.

    hi,
    While downloading form from client 000 to 100 first u should cange langauge,
    than procees the form.
    Here THERE is navegation to convert language from DE to EN.
    whn down loading process is complited  than open form in DE language itself than whn u r entering into first screen in cange mod GOTO UTILITIES inthat there is one options called COnVERT origbal language in that make cahges to language DE to EN than it will work out.
    Thanks.
    Patil

  • GUI_DOWNLOAD with XLS format Issue

    Hi,
    I am using gui_download option to download my final internal table to excel sheet. But when i tried to open the downloaded file it gives me the pop up saying "THE FILE WHICH YOU ARE TRYING TO OPEN IS IN THE DIFFERENT FORMAT THAN SPECIFIED BY THE FILE EXTENSION' and I used ASC as a file type and file name with XLS extension. I would like to know how to avoid this pop up message. I tried to use other function module which is for the excel download but it does not have parameter for the custom header records. Can anyone suggest how to solve the issue ?
    Some of the other function module I tried for the excel download but they have certain limitations like the all the fields should be in Char format to populate the header. But my fieldls in the internal table is the dynamic one based on the condition check. It would be great if anyone suggests with suitable answer.
    Thanks,
    Ram

    Hi all,
    I have been facing the same problem a few days back.
    I tried multiple things and found that there are multiple ways for achieving this.
    One fo the options is the one suggested by "remitra_cap".
    The other option is to use FM 'SAP_CONVERT_TO_XLS'.
    The advantage of this FM is its simple and u don't have to convert anything u just pass the File name and the internal table and u have a native Excel ready.A fast and simple method.
    The limitation of the above FM is that ur GUI should be above 7.2.
    IF it is then this is the best option.
    One more way to accomplish the same is to use OLE.
    The advantage of using OLE is it creates a native excel and you have all possible options which are in excel.
    But the disadvantage of using OLE is it takes long to generate based on the data to be populated.
    U will get many examples on the net for OLE
    IF the format of the file u need generate is fixed then u can go for BDS.
    BDS is also a fast method.
    May this help u.
    Cheers.

  • Problem in Downloading the file by using FM : GUI_DOWNLOAD in XLSX format

    Dear Experts,
        We are using FM: GUI_DOWNLOAD to download the data in .XLSX Format,But it is giving ERROR while opening the Excel file.
    So,Please help me how to download the file in .XLSX format.
    checked DC30 - for file extensions..there we were observed the suffix field is taking only 3 characters,it is not accepting 4 characters,kindly tel me how to increase the field size for SUFFIX field.
    and USED : CL_GUI_ALV_GRID and CL_GUI_FRONTEND_SERVICES.
    Still Not possible to download the data  in XLSX format.
    Kindly Provide the Solution.
    Regards,
    Nagaraju

    hi
    Try to use like below
    Display save dialog window
          call method cl_gui_frontend_services=>file_save_dialog
            exporting
              window_title      = 'FILE PATH'
              default_extension = 'XLS'
              default_file_name = 'CREDIT LIMIT DATA'
         INITIAL_DIRECTORY = 'c:\temp\'
            changing
              filename          = l_filename
              path              = l_path
              fullpath          = l_fullpath
              user_action       = l_result.
    Check user did not cancel request
          check l_result eq '0'.
          call function 'GUI_DOWNLOAD'
            exporting
      BIN_FILESIZE                    =
              filename                        = l_fullpath
             filetype                        = 'ASC'
      APPEND                          = ' '
             write_field_separator           = 'X'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
      WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
      SHOW_TRANSFER_STATUS            = ABAP_TRUE
    IMPORTING
      FILELENGTH                      =
            tables
              data_tab                        = it_crdt_limit
      FIELDNAMES                      =
    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
        endif.
      endif.
    Thanks
    Gupta

  • Problem in GUI_DOWNLOAD in Binary format

    Hi All,
    We have upgraded from 4.6C to ECC6.0.
    When I use GUI_DOWNLOAD function module in binary (BIN) mode with the filename without any extension, the data will be downloaded with the SPACE inbetween charecters.
    EX: We have data 'bangalore is garden city' to be downloaded, the data after downloading will apear as 'b a n g a l o r e   i s  g a r d e n   c i t y '.
    Kindly provide input to solve the issue
    Regards,
    Prabhu.

    HI
    Take reference of below code.
    TYPE-POOLS: ABAP.
    * Binary download table
    DATA: BEGIN OF line_bin,
             data(1024) TYPE X,
          END OF line_bin.
    DATA: data_tab_bin LIKE STANDARD TABLE OF line_bin.
    * Ascii download table
    DATA: BEGIN OF line_asc,
             text(1024) TYPE C,
          END OF line_asc.
    DATA: data_tab_asc LIKE STANDARD TABLE OF line_asc.
    * DAT download table
    DATA: BEGIN OF line_dat,
             Packed   TYPE P,
             Text(10) TYPE C,
             Number   TYPE I,
             Date     TYPE D,
             Time     TYPE T,
             Float    TYPE F,
             Hex(3)   TYPE X,
             String   TYPE String,
          END OF line_dat.
    DATA: data_tab_dat LIKE STANDARD TABLE OF line_dat.
    * Get filename
    DATA: fullpath      TYPE String,
          filename      TYPE String,
          path          TYPE String,
          user_action   TYPE I,
          encoding      TYPE ABAP_ENCODING.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
       EXPORTING
         WINDOW_TITLE         = 'Gui_Download Demo'
         WITH_ENCODING        = 'X'
         INITIAL_DIRECTORY    = 'C:\'
      CHANGING
         FILENAME             = filename
         PATH                 = path
         FULLPATH             = fullpath
         USER_ACTION          = user_action
         FILE_ENCODING        = encoding
      EXCEPTIONS
         CNTL_ERROR           = 1
         ERROR_NO_GUI         = 2
         NOT_SUPPORTED_BY_GUI = 3
         others               = 4.
    IF SY-SUBRC <> 0.
      EXIT.
    ENDIF.
    Regards,
    Pravin
    Edited by: pravin s. on Dec 15, 2009 1:55 PM

  • GUI_DOWNLOAD in Excel format

    Hi Gurus,
    I am using GUI_DOWNLOAD for excel (.XLS) format
    I Used
    *FILETYPE                        = 'ASC'   / DAT
    WRITE_FIELD_SEPARATOR           = 'X'
    My problem is the data not getting  proper excel format.
    thanking you.
    Subash

    You can create a file with extension .xls,
    but in fact the file contains only plain text, but when you open a file by using ms.excel,  it will be generated so that it becomes a table.

  • HT4623 Just updated mt ipad, don't like new format, can I un update it !

    I have just updated my ipad, I don't like the new format CAN I un- update it?

    You might find instructions elsewhere on the internet - but you won't get help on these forums, including if anything goes wrong if you try it.

  • Can I set up Entourage-like reply formatting in Mail.app?

    Hi all,
    I just switched to Mac Mail.app (and iCal, etc.) from Entourage. In Entourage, I liked using the "Reply & Forward: Mail Attribution" preference that states:
    "Place reply at the top of message and include From, Date, To, and Subject lines from original message".
    I greatly prefer this formatting to the "on [Date], [Name] <Address> wrote:" style that seems to be the only option in Mail.app (10.5.1)
    i.e. I prefer the messages in my e-mail thread to be separated by headers that look like this:
    From: [email protected]
    Subject: It's Easy to Manage Your Referrals
    Date: December 29, 2005 7:38:41 AM PST
    To: [email protected]
    not like this:
    On Dec 29, 2005, at 7:38 AM, [email protected] wrote:
    Does anyone know if I can use the Entourage style formatting when replying to mail with Mail.app, and, if so, how to set it up?
    Many thanks,
    Dave

    Not sure how much use this will be or if it's different in Leopard, it might help get you on the right path.
    http://www.hawkwings.net/2005/09/28/apple-mail-hacking-the-reply-string/

  • PROBLEM REGARDING GUI_DOWNLOAD IN .TDF FORMAT

    hi ,
    i am append the data into one internal table (iresult) . and internal table contain data row by row . when data is downloaded into destop it is storing in .TDF FILE FORMAT IS NOT DOWNLOADING IN .TDF FORMAT FILE  AS IN FORMAT OF INTERNAL TABLES LINES ARE COMING DOWN. plz help me its urgent .points must be rewarded**
    BEGIN OF iresult OCCURS 5,
    rec(450),
    END OF iresult,
    FILE =  C:
    IN.FILENAME.TDF
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    filename = file
    filetype = 'ASC'
    mode = mode
    TABLES
    data_tab = iresult
    EXCEPTIONS
    file_open_error = 1
    file_write_error = 2
    invalid_filesize = 3
    invalid_type = 4
    no_batch = 5
    unknown_error = 6
    invalid_table_width = 7
    gui_refuse_filetransfer = 8
    customer_error = 9
    OTHERS = 10.
    Edited by: manoj kv on Feb 18, 2008 5:19 AM

    I do not understand what is TDF(please elaborate). Do u mean PDF format.

  • Pdfs attached to my incoming emails come in what looks to me like html format of a pdf

    how do I view a pdf email attachmet that comes in html format?

    Dear Pat,
    I have solved the problem.
    My email program has three options to click on for any attachment:
    click on the attachment;
    click on "Download";
    click on "View".
    I had tried View and the attachment itself and got that screenshot above, neither of which were any good to me.
    Then I tried Download and the attachment downloaded itself as a .pdf, which of course I was able to open.
    Thanks for your time and patience.

Maybe you are looking for