2008 Mar 18 4:28 PM
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
2008 Mar 18 5:26 PM
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®
2008 Mar 18 4:32 PM
Please check thru Tranx SM69 whether the lv_cmnd is available in testing box?
a®
2008 Mar 18 4:34 PM
tHANKS ars...
iT IS AVAILABLE IN sm69...i DID CHECK THAT
aNY MORE CHECKS TO BE DONE.
sTER
2008 Mar 18 4:37 PM
what is the message(exceptions from fm) u are getting after failure?
a®
2008 Mar 18 4:49 PM
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
2008 Mar 18 5:08 PM
2008 Mar 18 5:11 PM
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.
2008 Mar 18 5:26 PM
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®
2008 Mar 18 5:45 PM
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.
2008 Mar 18 5:51 PM
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®
2008 Mar 18 6:01 PM
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
2008 Mar 18 6:12 PM
In AL11 whether can you able view the files from Unix server?
a®
2008 Mar 18 6:15 PM
2008 Mar 18 6:29 PM
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®