‎2007 Apr 16 7:42 AM
hi all,
my requirement is ,actually they need some datas according to their specific conditions from sap table
eg:sales order
vbap-matnr
vbap-werks
vbep-edatu
vbak-erdat
vbep-mbdat
vbap-kwmeng
vbfa-rfming
this datas shold b downlaoded to excel sheet,they pass this fiel to that server
my question wat technology can be used otherthan report
‎2007 Apr 16 7:46 AM
Hi....
use the function module <b>GUI_DOWNLOAD</b> to download
Reward points if useful...
Suresh...
‎2007 Apr 16 7:47 AM
Hi,
even u can use smart forms if u dnt want 2 do that using reports.
try the following code n let me know .
*"Table declarations...................................................
tables: kna1.
*"Selection screen elements............................................
select-options: s_kunnr for kna1-kunnr. " Customer Number 1
"----
Type declaration of the structure to hold Customer master *
"----
data:
begin of fs_kna1,
kunnr type kna1-kunnr, " Customer Number 1
adrnr type kna1-adrnr, " Address
anred type kna1-anred, " Title
erdat type kna1-erdat, " Date on which Record Was reated
ernam type kna1-ernam, " Name of Person who Created
end of fs_kna1.
"----
Internal table to hold Customer master *
"----
data:
t_kna1 like standard table
of fs_kna1.
"----
Type declaration of the structure to hold file data *
"----
data:
begin of fs_table,
str type string,
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.
select kunnr " Customer Number 1
adrnr " Address
anred " Title
erdat " Date on which Record Was reated
ernam " Name of Person who Created
from kna1
into table t_kna1
where kunnr in s_kunnr.
if sy-subrc eq 0.
loop at t_kna1 into fs_kna1.
do.
assign component sy-index of structure fs_kna1 to <fs>.
if sy-subrc ne 0.
exit.
else.
move <fs> to w_char.
if sy-index eq 1.
fs_table-str = <fs>.
else.
concatenate fs_table-str ',' w_char into fs_table-str.
endif. " IF SY-INDEX...
endif. " IF SY-SUBRC...
enddo. " DO...
append fs_table to t_table.
endloop. " LOOP AT T_KNA1...
endif. " IF SY-SUBRC...
call function 'GUI_DOWNLOAD'
exporting
BIN_FILESIZE =
filename = 'D:\backup\trainees_allocatin.xls'
FILETYPE = 'ASC'
APPEND = 'X'
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 = ' '
IMPORTING
FILELENGTH =
tables
data_tab = t_table
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 <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
reward points if helpful.
regards,
kiran kumar k.
Message was edited by:
kiran kumar
‎2007 Apr 16 7:47 AM
Hi Arun,
U can also generate the output with the required firlds using SMARTFORMS.
Thin it shud work.
try it out.
All the best.
‎2007 Apr 16 7:51 AM
hi arun ,
the data can be transferred or migrated from a legacy system to SAP system using following methods :
1) LSMW - Legacy System Migration Workbench,
2) BDC - Batch Dta Communication
3) ALE / IDOC
(Saving data in one system and distributing it to all other systems)
4) report can be displayed also using Smartforms
5) or thru Sapscript,
6) or thru List Display..
6) or thru ALV Grid Display (hence the data can be downloaded easily in excel format)
hope this information is useful to u...
reward points if helpful...
Ginni..
‎2007 Apr 16 7:51 AM
Hi,
If you want't create report or program, you can use Quick Viewer, tCode: SQVI.
Just create your View according user condition, and execute your view, it will give outpun in ALV Grid, and then you can download into Excel.
Regards,