2007 Dec 24 6:55 AM
how to capture the output of an ALV report and place the values in the appplication server
here iam submitting the standard report
submit REPORT! and return
now the output of report1 should be placed in the app server
please help points will be rewarded as soon a good repily
2007 Dec 24 7:08 AM
2007 Dec 24 7:21 AM
Hi Samuel
I think may be if you can use the option of sending the report output to sap-spool. And use the FM "BAPI_XBP_JOB_SPOOLLIST_READ" to read the spool data.
Then that data can be used with Open and close data set to transfer the contents to Appl. server.
~ Ranganath
PS : Reward points for all useful answers !
2007 Dec 24 7:14 AM
2007 Dec 24 7:20 AM
Hi,
Take the internal table which is given to the alv to display, and do
open dataset.
Loop at itab.
trasfer itab to app.
endloop.
close dataset.
Plzz reward points if it helps.
2007 Dec 24 7:23 AM
hi Samuel,
This is kiran kumar.G.U will follow the below steps to resolve ur problem.I will send sample code too..check it once in ANOTHER PROGRAM (SUBMIT 'ANOTHER PROGRAME NAME').The code for this is .(WE HAVE MENTION SAME INTERNAL TABLE AND SELECT QUERY AS THE ORIGINAL PROGRAM)..
DATA: BEGIN OF gt_data OCCURS 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
END OF gt_data.
----
Append data to Internal Table
----
REFRESH : gt_data. "Clear Body of the Internal Table
CLEAR : gt_data. "Clear Header Line.
select vbeln
posnr
from vbap
into table gt_data
where vbeln in s_vbeln.
----
OPEN THE DATASET
----
OPEN DATASET 'ZBDCDEMO' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
----
Transfer the data to APPSERVER
----
LOOP AT gt_data.
TRANSFER gt_data TO 'ZBDCDEMO'.
ENDLOOP.
----
Close the Dataset
----
CLOSE DATASET 'ZBDCDEMO'.
SKIP 10.
WRITE:/30 'GOTO AL11 TRANSACTION CODE AND CHECK UR RESULT THERE'.
Award points if Helpful.
kiran kumar.G
Have a Nice Day..
2007 Dec 24 7:25 AM
hi,
In order to move the output of the report to application server, move the contents of the fields of output internal table to an internal table with single field (of type character and length 400 or so depending on the field content) and then loop on the internal table to move the content to application server. I am providing sample code for your reference.
In the below specified code,
l_fielout = variable that contains the file name to be created in the app.server.
Output1 = internal table that contains the content of the report output.
Type of output1 internal table is:
DATA: BEGIN OF output1 OCCURS 0,
record(170),
END OF output1.
Here the length of field "RECORD" in internal table is decided in accordance with the number of fields to be passed to the app.server.
code:
OPEN DATASET l_fileout FOR OUTPUT IN TEXT MODE.
IF sy-subrc <> 0.
MESSAGE w104(yg) WITH
'Could not open file '
l_fileout(50)
l_fileout+50(20)
' for output.'.
ENDIF.
LOOP AT output1.
TRANSFER output1 TO l_fileout.
ENDLOOP.
CLOSE DATASET l_fileout.
IF sy-subrc <> 0.
MESSAGE w104(yg) WITH
'Could not close file '
l_fileout(50)
l_fileout+50(20)
' after output.'.
ENDIF.