09-09-2008 11:05 AM
Hi,
I need to make a program which takes output of one program as input to another program, could any one send me a sample code for the same.
thanks
bobby
09-09-2008 11:24 AM
hi ,
from the Programme A you can Export the Data to a memory ID as the Example Below and by using Submit , you can Call the Programme B.
EXPORT it_header1 TO MEMORY ID 'OPEN'.
SUBMIT zvr70_planprice_import_from_16 AND RETURN.
Inside the Programme B you retrive the Data from the Momory Which you passed by the Programme A from the same memory ID.
IMPORT it_header1 TO iit_download FROM MEMORY ID 'OPEN'.
Cheers,
Dilum
09-09-2008 11:08 AM
09-09-2008 11:09 AM
09-09-2008 11:18 AM
Use SUBMIT statement along with EXPORTING LIST TO MEMORY and retrieve the list using function module LIST_FROM_MEMORY.
DATA: ITAB LIKE ABAPLIST OCCURS 0.
SUBMIT REPORT1 EXPORTING LIST TO MEMORY.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = ITAB
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
09-09-2008 11:57 AM
Hi,
I got the list by using fm 'LIST_FROM_MEMORY' and 'WRITE_list' but it is displayed on screen, I need the output data in form of internal table, the internal table I got from above FM is encoded , how to get actual data is ther any other FM to convert the data
thanks
bobby
09-09-2008 11:24 AM
hi ,
from the Programme A you can Export the Data to a memory ID as the Example Below and by using Submit , you can Call the Programme B.
EXPORT it_header1 TO MEMORY ID 'OPEN'.
SUBMIT zvr70_planprice_import_from_16 AND RETURN.
Inside the Programme B you retrive the Data from the Momory Which you passed by the Programme A from the same memory ID.
IMPORT it_header1 TO iit_download FROM MEMORY ID 'OPEN'.
Cheers,
Dilum
09-09-2008 11:35 AM
Hi,
I am getting the output on 1st report as spool file, how to take the output from spool file and pass to second program input
thanks
bobby
09-09-2008 11:36 AM
09-09-2008 11:38 AM
09-09-2008 12:03 PM
Hi,
Check the following syntax:
SUBMIT <rep> TO SAP-SPOOL
[<params>|SPOOL PARAMETERS <pripar>]
[ARCHIVE PARAMETERS <arcpar>]
[WITHOUT SPOOL DYNPRO].
Ex:
The following executable program is connected to the logical database F1S:
REPORT SAPMZTS1.
TABLES SPFLI.
GET SPFLI.
NEW-LINE.
WRITE: SPFLI-MANDT, SPFLI-CARRID, SPFLI-CONNID,
SPFLI-CITYFROM, SPFLI-AIRPFROM, SPFLI-CITYTO,
SPFLI-AIRPTO, SPFLI-FLTIME, SPFLI-DEPTIME, SPFLI-ARRTIME,
SPFLI-DISTANCE, SPFLI-DISTID, SPFLI-FLTYPE.
The following program calls SAPMZTS1 and sends the output to the spool system:
REPORT SAPMZTST NO STANDARD PAGE HEADING.
DATA: VAL,
PRIPAR LIKE PRI_PARAMS,
ARCPAR LIKE ARC_PARAMS.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
LAYOUT = 'X_65_132'
LINE_COUNT = 65
LINE_SIZE = 132
IMPORTING
OUT_PARAMETERS = PRIPAR
OUT_ARCHIVE_PARAMETERS = ARCPAR
VALID = VAL
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
IF VAL <> SPACE AND SY-SUBRC = 0.
SUBMIT SAPMZTS1 TO SAP-SPOOL
SPOOL PARAMETERS PRIPAR
ARCHIVE PARAMETERS ARCPAR
WITHOUT SPOOL DYNPRO.
ENDIF.
Regards,
Bhaskar
Edited by: Bhaskar Chikine on Sep 9, 2008 4:33 PM
09-09-2008 12:07 PM
Try this code. It should work.
Regards,
Suresh
DATA: itab LIKE abaplist OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF int_ascitab OCCURS 0,
line(256),
END OF int_ascitab.
SUBMIT report1 EXPORTING LIST TO MEMORY AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = int_ascitab
listobject = itab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.