Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

save flat file in bdc

Former Member
0 Likes
436

in bdc we have to save the flat file in desktop or c drive?plz tell

Edited by: Alvaro Tejada Galindo on Feb 7, 2008 10:15 AM

in bdc we have to save the flat file in desktop or c drive?plz tell

Edited by: Alvaro Tejada Galindo on Feb 7, 2008 10:15 AM

3 REPLIES 3
Read only

Former Member
0 Likes
416

Hi,

you can store it any where,you just need to give the path..

preferably,

store in cdrive>documents&settings>your named folder(your desktop)..

<REMOVED BY MODERATOR>

regards.

Edited by: dinesh kumar on Feb 7, 2008 9:35 PM

Edited by: Alvaro Tejada Galindo on Feb 7, 2008 6:14 PM

Read only

Former Member
0 Likes
416

hi

u can store u r flat file any where i.e either on desktop or in c drive,

bcoz when u press f4 it will ask path so u can give the path of flatfile.

Read only

0 Likes
416

Hi,

check the code for better understanding.

Regards

Bala.M

REPORT  zi_flatfile_zisobj.

* Data Declaration
* Internal Tables
DATA : BEGIN OF itd_zisobj OCCURS 0 ,

zinref        LIKE  zisobj-zinref,

ziaccomtype   LIKE  zisobj-ziaccomtype,

zietgnr       LIKE  zisobj-zietgnr,

zioldnref     LIKE  zisobj-zioldnref,

zicnttyp      LIKE  zisobjcnt-zicnttyp,

END OF itd_zisobj.

DATA : file_length TYPE i.

START-OF-SELECTION.

PERFORM data_selection_join.

PERFORM gui_download_file.

END-OF-SELECTION.

*&---------------------------------------------------------------------*
*&      Form  data_selection_join
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM data_selection_join .
* Data selection and Inner join based on Contract Type Eq 'U'.

SELECT   a~zinref

a~ziaccomtype

a~zietgnr

a~zioldnref

b~zicnttyp

INTO  CORRESPONDING FIELDS OF TABLE itd_zisobj

FROM ( zisobj AS a INNER JOIN zisobjcnt AS b ON a~zicountry  = b~zicountry

AND a~ziplace    = b~ziplace

AND a~zihouse    = b~zihouse

AND a~ziaccom    = b~ziaccom

AND b~zicnttyp   = 'U' ) .

ENDFORM.                    " data_selection_join
*&---------------------------------------------------------------------*
*&      Form  gui_download_file
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM gui_download_file .

* FM to download to the presentation server

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING
*   BIN_FILESIZE                    =

filename                        = 'H:\TEST1.TXT'

filetype                        = 'ASC'

append                          = ' '

write_field_separator           = ','

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                      =  file_length

TABLES

data_tab                       = itd_zisobj
*   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

.

IF sy-subrc NE 0.

MESSAGE e398(00) WITH 'Error in Downloading File' 'TEST1.TXT' 'Retry'.

ENDIF.

ENDFORM.                    " gui_download_file