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

Re: How to send data to Application Server

Former Member
0 Likes
866

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

6 REPLIES 6
Read only

0 Likes
825

You can use OPEN DATASET concept.

Read only

Former Member
0 Likes
825

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

Read only

Former Member
0 Likes
825

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.

Read only

Former Member
0 Likes
825

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

Read only

Former Member
0 Likes
825

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

Read only

Former Member
0 Likes
825

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