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

gui_run does not work

former_member254358
Participant
0 Likes
2,270

Hi,

I'm using gui_run function alternatively to gui_exec and CL_GUI_FRONTEND_SERVICES=>EXECUTE and testing with this easy sentence:

CALL FUNCTION ’GUI_RUN’

EXPORTING

COMMAND          = ’CALC.EXE’.

But this sentence returns the following error: "gui_run field unknown" 

Any suggestion is welcome.

Thanks a lot.

1 ACCEPTED SOLUTION
Read only

former_member222709
Contributor
0 Likes
2,069

Hey David,

If you refer the FM documentation for 'GUI_RUN', it clearly explains that you need to pass the file path.

So, update your code to:

CALL FUNCTION ’GUI_RUN’

EXPORTING

COMMAND          = ’%WINDIR%\SYSTEM32\CALC.EXE’.

There is another way of passing the file path via parameter field. Refer the FM Documentation.

Also, the FM works for 32 bit systems only.

Regards,

Pranav.

10 REPLIES 10
Read only

raphael_almeida
Active Contributor
0 Likes
2,069

Hi David!

You can execute like this:

CL_GUI_FRONTEND_SERVICES=>EXECUTE( APPLICATION = 'CALC.EXE') .

Regards.

Read only

0 Likes
2,069

Thanks Raphael,

it's clear, the only problem is that CL_GUI_FRONTEND_SERVICES=>EXECUTE does not return a returncode and I need it.

Regards.

Read only

0 Likes
2,069

David...

Which type of return code you mean?! Error, Sucess?!

If you read the documentation of CL_GUI_FRONTEND_SERVICES (Execute Method), you will see that have exceptions, like images below:

Read only

0 Likes
2,069

I want to run a bat file and would like to control whether it works fine or not.

The bat file may fail for various reasaon and I'm only interested when it fails.

Is it possible to control when it fails?

Read only

0 Likes
2,069

Hi David,

What this bat runs?! Is a OS routine? Can you explane more ?!

Good weekend for you.

Read only

0 Likes
2,069

Hi Raphael,

the bat runs a third party software, which requires as parameters the connection to Oracle and a txt file which contents the parameters the third party needs:

mysoftware.exe  /Lorauser/orapwd/oraconnection    /Fparamfile.txt /silent

third-party          oracle connection

                         (user, password, defined connec)  parameters file

Thanks.

Read only

former_member222709
Contributor
0 Likes
2,070

Hey David,

If you refer the FM documentation for 'GUI_RUN', it clearly explains that you need to pass the file path.

So, update your code to:

CALL FUNCTION ’GUI_RUN’

EXPORTING

COMMAND          = ’%WINDIR%\SYSTEM32\CALC.EXE’.

There is another way of passing the file path via parameter field. Refer the FM Documentation.

Also, the FM works for 32 bit systems only.

Regards,

Pranav.

Read only

0 Likes
2,069

Pranav,

This FM is obsolete...

Regards.

Read only

0 Likes
2,069

Thanks David,

it works fine.

Regards.

Read only

0 Likes
2,069

Sorry,

I wanted to say Thanks Pranav.

Regards.