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

Application server

Former Member
0 Likes
1,443

Hello friends,

I am trying to get a file from UNIX server to the SAP application server. I am using the function module

CALL FUNCTION 'SXPG_CALL_SYSTEM'

it works fine in the DEV box but not performing in The testing box.


  CALL FUNCTION 'SXPG_CALL_SYSTEM'
    EXPORTING
      commandname                = lv_cmnd
      additional_parameters      = lv_parms
    IMPORTING
      status                     = lv_stat
    TABLES
      exec_protocol              = lt_btcxpm
    EXCEPTIONS
      no_permission              = 1
      command_not_found          = 2
      parameters_too_long        = 3
      security_risk              = 4
      wrong_check_call_interface = 5
      program_start_error        = 6
      program_termination_error  = 7
      x_error                    = 8
      parameter_expected         = 9
      too_many_parameters        = 10
      illegal_command            = 11
      OTHERS                     = 12.

Thanks,

Ster

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
1,419

Instead of using fm SXPG COMMANDEXECUTE please try with open dataset ... input mode from unix server and open dataset ... output mode in Appl server

a®

13 REPLIES 13
Read only

former_member194669
Active Contributor
0 Likes
1,419

Please check thru Tranx SM69 whether the lv_cmnd is available in testing box?

a®

Read only

0 Likes
1,419

tHANKS ars...

iT IS AVAILABLE IN sm69...i DID CHECK THAT

aNY MORE CHECKS TO BE DONE.

sTER

Read only

0 Likes
1,419

what is the message(exceptions from fm) u are getting after failure?

a®

Read only

0 Likes
1,419

The return code is 0. I dint see any errors.

However when i See in AL11 i dont see the files.

IN Development everythime I run it I see the file changed.

I have debuged both Dev and test simultaneously but didnt find any difference.

Ster

Read only

0 Likes
1,419

ANy More suggestions Friends,

Ster

Read only

Former Member
0 Likes
1,419

hi ,

check the append statement at the end ...this is one of the cause not to see the records in the o/p file..

regards,

venkat.

Read only

former_member194669
Active Contributor
0 Likes
1,420

Instead of using fm SXPG COMMANDEXECUTE please try with open dataset ... input mode from unix server and open dataset ... output mode in Appl server

a®

Read only

0 Likes
1,419

Thanks ARS for the suggestion.

Can you please elaborate on how to use the method that you are suggestion. any example..

Anyways,

AM explaining more in detail as what the problem is.

This programs exists from a long time in this system.

However the company has sold some of their plants to a different systema dn hence a new system is built which is a copy of the existing system.

everything is same else the file path and the ID and Password.

Read only

0 Likes
1,419

As per your replies my understanding is you are moving files Unix server to to Appl server and doing somthing?

My suggestion is first read files from unix using OPEN DATASET with addition INPUT MODE syntax and for writing to Appl server use OPEN DATASET syntax with addtion OUTPUT MODE

or try to fm SXPG_COMMAND_EXECUTE in place of SXPG_CALL_SYSTEM

a®

Read only

0 Likes
1,419

Thanks ARS.

You are right I am taking files from unix bringing to SAP and doing something.

As per your explanation How would I write the open data set statement, I also have an User ID, Password, IP address for the same. How would I use all of this.

Ster

Read only

0 Likes
1,419

In AL11 whether can you able view the files from Unix server?

a®

Read only

0 Likes
1,419

NO In AL11 I am not able to see the files.

Ster

Read only

0 Likes
1,419

Then OPEN DATASET will not get worked out.

My other possible solutions are :

You can use transactions CG3Y and CG3Z

Also check this FM.

ARCHIVFILE_SERVER_TO_SERVER

ARCHIVFILE_SERVER_TO_CLIENT

ARCHIVFILE_CLIENT_TO_SERVER

a®