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

before calling an external program, check if the program is allready open

Former Member
0 Likes
422

I need to call an external program to print some labels, so i will use function WS_EXECUTE or the new one DSVAS_DOC_WS_EXECUTE_50 to call my program, but the problem that i have is:

when I call this function, the program open a small window, and if i have to call it again, it will open another window, and so on... obviously this is not a good solution.

Is there any one how knows how can i close the program, of perhaps it is enough if there is some way to know if the program is already open.

Many thanks in advance,

Miriam

1 REPLY 1
Read only

Former Member
0 Likes
326

Hi

you can use the ABAP Coverage Analyzer.

OR

This is a function module we use to limit the execution of a program to one instance at a time.

DATA: PRG LIKE INDX-SRTFD. PRG = SY-CPROG.

CALL FUNCTION 'ENQUEUE_ESINDX'

EXPORTING RELID = 'ZZ'

SRTFD = PRG

SRTF2 = 0

EXCEPTIONS FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2.

IF SY-SUBRC NE 0.

FORMAT COLOR COL_NEGATIVE INVERSE ON.

WRITE: / 'ERROR: Program Is Already Running'.

WRITE: / 'Program', PRG, 'has been stopped. Rerun in 1 minute.'.

STOP.

ELSE.

  • WRITE: / 'OK ',PRG.

ENDIF.

Regards,

Raj