cancel
Showing results for 
Search instead for 
Did you mean: 

External Command/Program execution - Need urgent Help

tamil_arasan
Active Contributor
0 Kudos

    Hi Experts,

We have ECC 6.06 landscape on AIX 7.1 and SCM server 7.02 landscape on Windows 2008 R2. Our development team wants to execute python scripts from SM69.

As default Python is delivered along with Windows 2008 R2 but there is no python on AIX. we tried to install but getting error that is different story.

hence we planned to call python from ECC on Windows server 2008. we have done the following,

1. registered python program at OS level:

     When we try to register the program by the command, rfcexec -g <host>-a python -x sapgw00 the command prompt shows nothing but PID python is registered if we see in SMGW-->goto-->logged on clients temporarily (if i close the cmd prompt it is not showing in the list of registered program)

2. Created TCP/IP RFC:

     RFC is working fine when the program ID shows as registered.

when we execute the external command x_python using the target destination with earlier created RFC, which is giving the error "PROGRAM_START_ERROR"

could you please let me know where is the problem ?

I am attaching the error logs below

Please help to resolve this issue.

Regards,

Pradeep

Accepted Solutions (1)

Accepted Solutions (1)

willi_eimler
Contributor
0 Kudos

Hi Pradeep,

do you use virtual hostname for DB-host? If yes you need to check if the RFC-Destination SAPXPG_DBDEST_<virt.Hostname> exists and works.

Best regards

Willi Eimler

Answers (7)

Answers (7)

tamil_arasan
Active Contributor
0 Kudos

Hello All,

Thanks a lot for your input and support. I have created the TCP/IP RFC between PI 7.4 and ECC. I selected the option "Start on explicit host" and provided the program sapxpg. it is working fine. we are able to execute simple python scripts now.

Many Thanks to Willi, Alwina, Stefan and all  for your inputs.

Regrads,

Pradeep

stefan_schnell
Active Contributor
0 Kudos

Hello Pradeep,

your development team can easily use Python server applications, you can find a non-stylish Python example here. This example is good to understand the technic, but it is better to use Srdjans Python RFC connector, you can find it here. I think it is an easy task to run a Python script via a subprocess from another Python script. Also you can transfer the source code from your ABAP System to your target Windows Server and send the result back. Sure, this answers not your question, because it is not via SM69 and RFCEXEC, but this way works stable, very good, offers a lot of possibilities and relieves you from this requirement. I think an architectural approach via SM69 is in this case not very felicitous.

Cheers

Stefan


Former Member
0 Kudos

Hi Pradeep,

what is current value of gw/acl_mod . If it 0 then it should be registered. But, however, i see you have already deactivated the GW security.

1. Try to execute the command again rfcexec -g PIQAS -a python -x sapgw00 - > but, this try running it as background i.e add "&" at the end

2. Also, i feel that another program is already registred in the target server with the same program ID. Hence, un register the progam ID or delete the existing RFC connection and test it again .

Regards,

Pavan Gunda

alwina_enns
Employee
Employee
0 Kudos

Hello Pradeep,

please take a look at the note:

1328083 - Exit code of an external program is not 0

if it can help to analyse the issue.

Regards,
Alwina

tamil_arasan
Active Contributor
0 Kudos

Hi Alwina,

I will check this note and update you.

Thanks,

Pradeep

willi_eimler
Contributor
0 Kudos

Hi,


sorry for the old note. I was on hurry.

Did you activate the gateway security (gw/acl_mode = 1)?

The registration of external server program is controlled by profile parameters (gateway security)
gw/acl_mode
gw_reg_info
gw/sec_info

If you don’t want to use gateway security,  gw/acl_mode can be used to control registration of external programs on the system.

gw/acl_mode = 0 will deactivate gateway security and allow registration of external server program

gw/acl_mode = 1 will use gateway security and the files reg_info and sec_info needs to be maintained.

See:
http://wiki.scn.sap.com/wiki/display/Security/Gateway+security+settings+-+extra+information+regardin...

Best regards
Willi Eimler

tamil_arasan
Active Contributor
0 Kudos

Hi Willi,

Yes I already deactivated the gw/acl_mode and the RFC is working fine but I am affraid the registration itself is issue since the command prompt not returining anything if i execute the below comand

rfcexec -g PIQAS -a python -x sapgw00

But whenever I execute the command in SM69 i am getting below msg in command prompt as below,

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SXPG_COMMAND_EXECUTE not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Unknown function module: Function SAPXPG_START_XPG_LONG not found

Could you please let me know any workaround to resolve this.

Regards,

Pradeep

alwina_enns
Employee
Employee
0 Kudos

Hello Pradeep,

"SAPXPG_START_XPG_LONG" is a function in sapxpg. Is sapxpg installed on the server, where you are trying to call the external command? How you have defined the command in SM69?

Regards,
Alwina

tamil_arasan
Active Contributor
0 Kudos

Hi Alwina,

I am trying in the host where SCM server 7.02 has been installed. yes, I have checked the file sapxpg in the kernel path, it is there. what should i do eliminate this error.

Kindly advise

Many Thanks,

Pradeep

srinivasan_vinayagam
Active Contributor
0 Kudos

Hi Pradeep,

First check the user whether locked or not.

======> User is locked. Please notify the person responsible

And Refer the below SAP Note:

Note 437648 - DB13: External program terminated with exit code 1/2

Note 446172 - SXPG_COMMAND_EXECUTE (program_start_error) in DB13

Regards,

V Srinivasan

tamil_arasan
Active Contributor
0 Kudos

Hi Srini,

Thanks for your reply. Sorry I guess the line "User is locked. Please notify the person responsible" is for other log which is for CCMS.

Please ignore that and look at the bottom of the same log file the error was "=====> Function SAPXPG_START_XPG_LONG not found"

The notes are talking about if DBA jobs gets failed. I could not find relevant details for generic external command call fails.

Could you please advise.

Many Thanks,

Pradeep

willi_eimler
Contributor
0 Kudos

Hi!

Take a look at "Note 1093054 External RFC server program cannot be started" .

Best regards

Willi Eimler

tamil_arasan
Active Contributor
0 Kudos

Hi Willi,

Thanks for your reply. The note is applicable for till kernel 700. we are in 721 kernel release. can you please advise any other SAP notes. I have searched a lot couldn't find

Regards,

Pradeep