Application Development 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: 

output of one program as input to another program

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

former_member451655
Active Participant
0 Kudos

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

10 REPLIES 10

Former Member
0 Kudos

use SUBMIT <first program> statement

in second program.

Former Member
0 Kudos

hi

use submit keyword or

use export and import

regards

vivek

Former Member
0 Kudos

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

0 Kudos

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

former_member451655
Active Participant
0 Kudos

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

0 Kudos

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

0 Kudos

Use function module

LIST_TO_ASCII

0 Kudos

there is no fm list_to_ascii , I am using ECC6

0 Kudos

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

0 Kudos

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.