Skip to Content
0
Former Member
Apr 26, 2007 at 07:40 AM

problem while downloadin in pariticular directory

15 Views

please check the pgm

there is no logic behind it

iam trying to download set of data present in t_bkpf

internal table in a flat file in the mentioned directory.

just correct me wats wrong in this coding

otherwise give some simple eg like this

&----


*& Report ZPGM1_AR *

*& *

&----


*& *

*& *

&----


REPORT ZPGM1_AR .

tables: bkpf. " Accounting Document Header

*"Selection screen elements............................................

parameters:

p_burks like bkpf-bukrs. " Company Code

select-options:

s_gjahr for bkpf-gjahr. " Fiscal year

"----


  • Type declaration of the structure to hold Accounting Document Header*

"----


data:

begin of fs_bkpf,

bukrs type bkpf-bukrs, " Company Code

belnr type bkpf-belnr, " Accounting Document Number

gjahr type bkpf-gjahr, " Fiscal year

blart type bkpf-blart, " Document type

bldat type bkpf-bldat, " Document date in document

end of fs_bkpf.

"----


  • Internal table to hold Accounting Document Header *

"----


data:

t_bkpf like standard table

of fs_bkpf.

"----


  • Type declaration of the structure to hold file data *

"----


data:

begin of fs_table,

bukrs type bkpf-bukrs, " Company Code

belnr type bkpf-belnr, " Accounting Document Number

gjahr type bkpf-gjahr, " Fiscal year

blart type bkpf-blart, " Document type

bldat type bkpf-bldat, " Document date in document

end of fs_table.

"----


  • Internal table to hold file data *

"----


data:

t_table like standard table

of fs_table.

field-symbols: <fs>.

*" Data declarations...................................................

"----


  • Work variables *

"----


data:

w_char(50) type c,

w_file_name(50) type c value '/sapio/aru.txt'.

select bukrs " Company Code

belnr " Accounting Document Number

gjahr " Fiscal year

blart " Document type

bldat " Document date in document

UP TO 10 ROWS

from bkpf

into table t_bkpf

where bukrs eq p_burks

and gjahr in s_gjahr.

if sy-subrc eq 0.

open dataset w_file_name for output in text mode encoding default.

IF sy-subrc EQ 0 .

loop at t_bkpf into fs_table.

transfer fs_table to w_file_name.

endloop.

ENDIF .

endif. " IF SY-SUBRC...

.