Ansicht
Dokumentation

04169 - Start an OS400-Command from an ABAP-Programm

04169 - Start an OS400-Command from an ABAP-Programm

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

Start an OS400-Command from an ABAP-Programm

Juergen,
I found the following two solutions in my archive from a formerly discussion
on this forum. Thanks to Klaus, Jim and Volker.

BM__Toc532182488* 1. Execute an OS400 command from an ABAP program.
This is documented in the SAP Red Book section 5.5 on page 102.
ABAP code:
PARAMETER CMD(250) DEFAULT 'CALL COLIN/CGTEST01'.
CALL 'SYSTEM' ID 'COMMAND' FIELD CMD.
Note that this is pretty crude in that not much information is returned back
as to its success or otherwise, but it does work.

* 2. Testprogram that can execute AS/400 commands.
* Author: 981028 - Klaus Lindegaard RW-DK
*
* For result check as400 joblog under job(AS4DIREXE) user(SAPxx)
* Idea of Jim Doll, Perrigo:
* (in order to solve really strange problems!)
* old ABAP: call RPGPGM
* new ABAP: call CLPGM
* CL:
* CLPGM
* - CHGJOB generate joblog
* - CHGJOB log CL
* - SNDMSG QSECOFR "Running test job..."
* - DLYJOB or SNDMSG *INQ
* - CALL RPGPGM
*
report zcall_system2.

* Standard-Parameter for this pgm
parameters:
as4cmd(200) default 'CPY OBJ(''/tmp/allsys'') TOOBJ(''/tmp/aa1'')'.
*
data: begin of msg occurs 0,
field(199) type c,
end of msg.
data: wa_msg like line of msg.

* Call of the SAP-API
call 'SYSTEM' id 'COMMAND' field as4cmd
id 'TAB' field msg-*sys*.

* Write Output to the screen
loop at msg into wa_msg.
write: / wa_msg.
endloop.

-----------------------------

hope this helps

Karl Grauer
Amphenol-Tuchel Electronics
August-Haeusser-Str. 10
DE 74080 Heilbronn
phone: +49 7131/929327
mailto:karl.grauerZa... <mailto:karl.grauerZa...>
www.amphenol.com




-----Ursprüngliche Nachricht-----
Von: jspranzZg... [mailto:jspranzZg...]
Gesendet am: Donnerstag, 6. Dezember 2001 14:29
An: DoNotReply@consolut.eu
Betreff: Start an OS400-Command from an ABAP-Programm
Why should I create a Programm to start an OS/400 Command.

I think there are a lot of experts, they created an solution.

I tried with call 'system".
But it can be that there is an better solution...????

If someone have the solution ready it is very possible for me.
Also it can be possible for a few members from the mailinglist.

Have someone Source-Code for the solution?

Is it only an ABAP-Programm?
Or must be created an CL-Programm on the AS/400.

If it is only an ABAP-Programm it is very good.


I am very happy if i get an useful example.

Thank you for you help.


Jürgen Spranz
not a ABAP-Developer (*** smile ***)



--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net <http://www.gmx.net>



consolut Sponsor



<http://rd.consolut.net/M=178320.1681224.3270152.1261774/D=egroupweb/S=17050073
89:HM/A=879171/R=0/*http://www.fastweb.com/ib/consolut-57f>

<http://us.adserver.consolut.net/l?M=178320.1681224.3270152.1261774/D=egroupmai
l/S=1705007389:HM/A=879171/rand=453053515>

DoNotReply@consolut.eu

Your use of consolut is subject to the consolut Terms of Service
<http://www.consolut.net> .



Durban Tours - Südafrika Safari

Fill RESBD Structure from EBP Component Structure   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 4808 Date: 20240620 Time: 003546     sap01-206 ( 3 ms )