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

Run batch code (DOS) from SAP.

Former Member
0 Likes
553

Exist a FM? I put the code in an internal table.

Thanks for answers.

1 ACCEPTED SOLUTION
Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
517

Hi,

Use the F.M <b> GUI_EXEC or GUI_RUN </b>

COMMAND and PARAMETER are combinde into a command line that must contain the name of a program and its corresponding parameters.

The function DOES NOT associate applications with file extensions.

Eg::

COMMAND Notepad' PARAMETER 'c:\temp\test.txt'

or

COMMAND = 'Notepad c:\temp\test.txt'

Hope this helps..

cheers,

Simha.

Reward points if this is needful..

3 REPLIES 3
Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
518

Hi,

Use the F.M <b> GUI_EXEC or GUI_RUN </b>

COMMAND and PARAMETER are combinde into a command line that must contain the name of a program and its corresponding parameters.

The function DOES NOT associate applications with file extensions.

Eg::

COMMAND Notepad' PARAMETER 'c:\temp\test.txt'

or

COMMAND = 'Notepad c:\temp\test.txt'

Hope this helps..

cheers,

Simha.

Reward points if this is needful..

Read only

Former Member
0 Likes
517

HI

GOOD

GO THROUGH THESE LINKS

/people/sap.user72/blog/2005/11/17/reinitialize-mi-client-without-reinstallation-in-seconds

http://abap4.tripod.com/download/BatchInputInstructions.pdf

THANKS

MRUTYUN

Read only

Former Member
0 Likes
517

Hi avalor,

1. I put the code in an internal table.

Your whole code (for ms DOS batch file)

is in internal table.

2. then u can do like this.

3. Just copy paste in new program.

(note : ITAB contains your batch code)

4.

REPORT ABC.

*----


DATA : BEGIN OF ITAB OCCURS 0,

LN(50) TYPE C,

END OF ITAB.

*----


Your Batch Code, Can put more lines

ITAB-LN = 'DIR'.

APPEND ITAB.

*ITAB-LN = 'DIR'.

*APPEND ITAB.

*ITAB-LN = 'DIR'.

*APPEND ITAB.

*----


CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

FILENAME = 'D:\MYBATCH.BAT'

TABLES

DATA_TAB = ITAB

.

*----


CALL FUNCTION 'GUI_EXEC'

EXPORTING

COMMAND = 'D:\MYBATCH.BAT'

  • PARAMETER =

  • IMPORTING

  • RETURNCODE =

.

BREAK-POINT.

regards,

amit m.