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 execute external application?

Former Member
0 Likes
2,564

Hi friends I want printing my barcodes a laser printer (Kyocera) it isn't a barcode printer. So I think (and I look kyocera web page my model doesn't support barcode printing in sap) print my barcodes using an external system. Before SAP we are using JollyPrint application for printing barcodes. It is using an Excel file.

I can create a excel file for this application. I must execute this (JollyPrint-it is a label application) application when I press a button. How can I execute this application?

Thanks

Mehmet

P.S. I have been writing this message with details may be somebody can give me a simple way for this

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,183

Hi mehmet,

1. We can use the FM

GUI_RUN

2. suppose we want to open NOTEPAD,

then pass

Notepad

to command parameter of this FM.

3. For your JollyPrint

(it should be having an EXE file)

4. Pass the filename

(along with the FULL PATH)

to this FM,

and it will run / execute it.

5. Same way, u can try with other

EXE files also, and they will simply execute.

regards,

amit m.

8 REPLIES 8
Read only

former_member181966
Active Contributor
0 Likes
1,183

Well, I can suggest you following steps. May be it works for you .

-Create an external OS command in SM69

-Test OS command in SM49 ( <u><i>about OS command if you search in SDN you’ll get lot of material</i></u> )

-Create a Script at your OS level, I’m assuming you might have some UNIX flavor or Sun solaria’s.

-Create a Shell script , which execute the printer job from OS .

-Shell script will have parameters . ( e.g. printer name, destination etc )

-set the path of shell script directory in SM69 ( the command you just created )

-Execute shell script using your ABAP program ( use FM "SXPG_COMMAND_EXECUTE" )

In the ABAP program you can pass the parameters and execute the command from ABAP as a result your job will start printing on the required destination. Moreover, you can also capture the spool at OS level .

FYI

For UNIX script, if you search in www.google.com ( UNIX forums) . you’ll get shell script .

Hope this’ll give you idea!!

<b>P.S award the points.</b>

Good luck

Thanks

Saquib Khan

"Some are wise and some are otherwise"

Read only

Former Member
0 Likes
1,183

I assume the application can exist independently as an exe file.

In such case you can use the CL_GUI_FRONTEND_SERVICES class's method EXECUTE.

call method CL_GUI_FRONTEND_SERVICES=>EXECUTE

exporting

APPLICATION = <Path and Name of Application>

Regards,

Ravi

Read only

Manohar2u
Active Contributor
0 Likes
1,183

You can execute any OS command from below transaction.

SM69 is to create a comman &

SM49 is to execute the same.

You can use SXPG_COMMAND_EXECUTE fm to execute from the program.

Regds

Manohar

Read only

Former Member
0 Likes
1,183

hi

use the FM

<b>gui_exec</b>

to execute external app

Read only

Former Member
0 Likes
1,183

Hi,

You can write a script to execute in a text file.

Store the file say abc.txt in the application server.

Execute the statement in the file when the button is pressed.

DATA DSN(20) VALUE '/usr/abc.txt'.

Case 'Sy-ucomm'.

When 'Button_click'.

OPEN DATASET dsn FILTER <filt>.

Endcase

The operating system command in the field <filt> is processed when the file <dsn> is opened.

where <filt> can be 'compress' or 'uncompress'.

Here the displayed data can be read into it in compressed form or uncompressed form.

Regards,

Tanveer.

<b>Please mark helpful answers</b>

Read only

Former Member
0 Likes
1,183

Hi Mehmet,

Refer the following link. It may help you.

http://www.sapsuperusers.com/forums/showthread.php?t=4861

<b>Reward points if it helps.</b>

Read only

Former Member
0 Likes
1,184

Hi mehmet,

1. We can use the FM

GUI_RUN

2. suppose we want to open NOTEPAD,

then pass

Notepad

to command parameter of this FM.

3. For your JollyPrint

(it should be having an EXE file)

4. Pass the filename

(along with the FULL PATH)

to this FM,

and it will run / execute it.

5. Same way, u can try with other

EXE files also, and they will simply execute.

regards,

amit m.

Read only

Former Member
0 Likes
1,183

This message was moderated.