Ansicht
Dokumentation

06064 - Calling a CL using RFC

06064 - Calling a CL using RFC

PERFORM Short Reference   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

Calling a CL using RFC

Hi Fernando,

It's easy to do.

First you need to create a logical destination in SM59 to start
RFCEXEC on your AS/400. If the AS/400 is the same that runs one of
your SAP instances, you can use the 'SERVER_EXEC' destination. If
not, you need to install an standalone gateway instance on this
machine because AS/400 does not support remote pipes or remote
shells, and you need to create a logical destination that launches
RFCEXEC on this machine. You can test if all is right with a little
ABAP program:

REPORT zzprog001 .

TYPES: tlinia(80) TYPE c.
DATA: ret TYPE TABLE OF tlinia,
wlinia TYPE tlinia.
PARAMETERS: program(256) TYPE c DEFAULT
'/QSYS.LIB/MYLIB.LIB/TEST_RFC.PGM'.

CALL FUNCTION 'RFC_REMOTE_EXEC' DESTINATION 'SERVER_EXEC'
EXPORTING
command = program
TABLES
pipedata = ret.

LOOP AT ret INTO wlinia.
WRITE wlinia.
ENDLOOP.

This program will execute the CL called TEST_RFC located in MYLIB. Of
course, you must ensure that your instance user ( SAPXX or <SID>XX
depending on R/3 release )
has right permissions for this objects. Function module
RFC_REMOTE_EXEC does not need to be created in SM37 because RFCEXEC
implements this call.

The second step involves IDOC port configuration. Use right syntax
for the CL call: '/QSYS.LIB/MYLIB.LIB/TEST_RFC.PGM'.

Do not hesitate to contact me for any question.

Best regards,
Joan Altadill
Certfied SAP consultant on iSeries and OS/DB migrations
Realtech Spain


--- In SAP on System iZy..., "Ubiria, Fernando" <fubiriaZg...> wrote:
> Hi all.
>
> I have always called a CL using the command EXEC SQL in an ABAP
program and
> it works great. Now we are trying to call a CL using a logical
destination
> (SERVER_EXEC). We are configuring EDI in our system and we want to
call a CL
> in the AS/400 to execute an FTP when an IDOC is generated. We can
do that
> configuring a "command file" in the port of the EDI. The parameters
I have
> to use are:
> Logical destination, directory and shell script.
>
> I think I have to use SERVER_EXEC as logical destination but I
don't know
> how to fill the other parameters.
>
> Can anybody help?
>
> Thanks in advance,
>
> Fernando Ubiria
> GSB
>
> By the way, we are on 4.0B V4R5.


Durban Tours - Südafrika Safari

RFUMSV00 - Advance Return for Tax on Sales/Purchases   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 2872 Date: 20240520 Time: 155426     sap01-206 ( 3 ms )