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

How can I call another program in current program?

Former Member
0 Likes
754

In the current report, when user choose records and click Add-on button "Print", it should call another print program. However, it just jumps to the selection screen of print program. When i choose serveral records, how can i call the print program????

6 REPLIES 6
Read only

Former Member
Read only

Former Member
0 Likes
733

Hi

use the SUBMIT command and call the other program

SUBMIT <report> and Return.

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

Former Member
0 Likes
733

Hi

U need to use the statament SUBMIT:

SUBMIT <ZREPORT> WITH <PARAM1> =
                                          <PARAM2> =
                                           <SEL1> IN
                                           <SEL2> IN 
                                           ..................... AND RETURN.

Max

Read only

Former Member
0 Likes
733

If you want to call Print program in background then use following statement.

DATA: SELTAB TYPE TABLE OF RSPARAMS, "Selection options

SELTAB_WA LIKE LINE OF SELTAB.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

JOBNAME = TBTCO-JOBNAME

IMPORTING

JOBCOUNT = TBTCO-JOBCOUNT.

IF SY-SUBRC NE 0.

RETURN-MESSAGE = 'Error in Job Opening'.

APPEND RETURN.

ELSE.

SUBMIT <Report Name>

USER sy-uname

VIA JOB TBTCO-JOBNAME

NUMBER TBTCO-JOBCOUNT

WITH SELECTION-TABLE SELTAB

WITH S_MAIL IN R_EMAIL

WITH S_TEXT IN R_TEXT

AND RETURN.

IF SY-SUBRC NE 0.

RETURN-MESSAGE = 'Error in Submitting Job'.

APPEND RETURN.

ELSE.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

JOBCOUNT = TBTCO-JOBCOUNT

JOBNAME = TBTCO-JOBNAME

STRTIMMED = 'X'.

IF SY-SUBRC NE 0.

RETURN-MESSAGE = 'Error in Closing Job'.

APPEND RETURN.

ENDIF.

ENDIF.

ENDIF.

Read only

Former Member
0 Likes
733

Submit or call or BDC

Read only

Former Member
0 Likes
733

Submit or call or BDC