Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Poll

What area of ABAP are you interested in?
 
Home arrow Sample Code arrow ABAP Reports arrow Downloading a file to your PC
Downloading a file to your PC PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Anon.   
Tuesday, 13 February 2007

Using GUI_DOWNLOAD to download a file to your PC.

 

DATA: filestring    TYPE string.

 

DATA: BEGIN OF fields OCCURS 2.

        INCLUDE STRUCTURE sval.

DATA: END OF fields.

 

      CLEAR fields.

      fields-tabname     = 'RLGRAP'.

      fields-fieldname   = 'FILENAME'.

      fields-value       = p_file.

      fields-field_attr  = '00'.

      APPEND fields.

 

      CALL FUNCTION 'POPUP_GET_VALUES'

           EXPORTING

                popup_title     = text-003

           IMPORTING

                returncode      = returncode

           TABLES

                fields          = fields

           EXCEPTIONS

                error_in_fields = 1

                OTHERS          = 2.

 

      CHECK returncode EQ space.

 

      filestring = fields-value.

      CALL FUNCTION 'GUI_DOWNLOAD'

           EXPORTING

                filename                = filestring

                write_field_separator   = ','

           TABLES

                data_tab                = itab_data

           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.

      IF sy-subrc <> 0.

        MESSAGE s999(b1) WITH 'File ' filestring

                              ' NOT created!'.

      ELSE.

        MESSAGE s999(b1) WITH 'File ' filestring

                              ' Created successfully!'.

      ENDIF.  "Check on download success


Related Items:

 
< Prev   Next >

Google Search

Statistics

Contribution Activity
Utilities: 38
Tips and Tricks: 333
Sample Code: 164
Total Contributions: 550

Member Activity
Members: 6182 since 2/1/2007!
New: 6 since yesterday!
Visitors: 1010961
We have 2 guests online

Newest Members

Welcome our newest members:

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor