SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

GUI_DOWNLOAD with POPUP filename request



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Mon Sep 10, 2007 7:34 pm    Post subject: GUI_DOWNLOAD with POPUP filename request Reply with quote

Code:
PARAMETERS: p_file TYPE rlgrap-filename.
DATA: returncode TYPE sy-subrc.

DATA: filestring    TYPE string.
DATA : itab_data TYPE TABLE OF 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     = 'Select File Name'
     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   = ','
          trunc_trailing_blanks   = 'X'
     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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.