2011 Feb 21 10:45 AM
HI Experts,
Can anyone tell me how to send alv report ouput data to the application server.
Regards,
p11272
HI Experts,
Can anyone tell me how to send alv report ouput data to the application server.
Regards,
p11272
2011 Feb 21 10:54 AM
2011 Feb 21 11:46 AM
Hi ,
You can 1st create a dataset in application server and than in your program do the following:
open dataset (i.e. your respective file name on application server)
loop your internal table into wa.
transfer the wa to dataset.
In this way you can download the file in application server with all the records of your internal table ( as contents).
Hope this will make your task a lot easier.
Regards,
Vinit
2011 Feb 21 12:03 PM
The responses so far are going to support downloading the table behind the ALV. Usually, that's what is downloaded, but be aware that the table will not be in report format! Most of us would probably convert the table to tab-delimited rows of data and download that, so that the data can be processed by desktop, or other system, software easily.
2011 Feb 21 4:58 PM
Hi dear,
Check the sample example....
LOOP AT it_file1 INTO wa_file1.
v_bet01 = wa_file1-bet01.
CONCATENATE chg_flag wa_file1-bukrs wa_file1-aedtm wa_file1-begda
wa_file1-lgtxt wa_file1-pernr wa_file1-pernr v_bet01
INTO wa_temp1-rec SEPARATED BY ','.
CONDENSE wa_temp1-rec NO-GAPS.
APPEND wa_temp1 TO it_temp1.
ENDLOOP.
LOOP AT it_temp1 INTO wa_temp1.
TRANSFER wa_temp1 TO
'D:test.txt'.
ENDLOOP.
ELSE.
MESSAGE e001(zemp).
ENDIF.
CLOSE DATASET
'D:test.txt'. U have to do this before transfering the file in Application server.
Try it out.
Thanks
Arbind
2011 Feb 22 10:22 AM
Hi,
Use these code, It will helps this code
OPEN DATASET APPPATH FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC NE 0.
WRITE: / 'There was an error opening the file in output mode:',
ENDIF.
TRANSFER ITAB TO APPPATH.
CLOSE DATASET APPPATH.
Regards,
Sekhar
Edited by: sekharch on Feb 22, 2011 11:23 AM
2011 Feb 22 11:20 AM
Hi,
You can use Open dataset to transfer internal tables to application server.
Given below is the Simple code that will help you to extend.
Parameters to enter the path
PARAMETERS FILENAME(128) DEFAULT '/usr/tmp/testfile.dat'
LOWER CASE.
Table Declaration
TABLES VBAK.
Data Declaration
DATA D_MSG_TEXT(50).
Get data for file transfer
DATA INT_VBAK LIKE VBAK OCCURS 100
WITH HEADER LINE.
SELECT * FROM VBAK INTO TABLE INT_VBAK.
SORT INT_VBAK BY VBELN.
LOOP AT INT_VBAK.
WRITE: / INT_VBAK-VBELN,
INT_VBAK-KUNNR.
ENDLOOP.
Opening the File
OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE
MESSAGE D_MSG_TEXT.
IF SY-SUBRC NE 0.
WRITE: 'File cannot be opened. Reason:', D_MSG_TEXT.
EXIT.
ENDIF.
Transferring Data
LOOP AT INT_VBAK.
TRANSFER INT_VBAK-VBELN TO FILENAME.
ENDLOOP.
Closing the File
CLOSE DATASET FILENAME.
-
Thanks
shankar
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |