cancel
Showing results for 
Search instead for 
Did you mean: 

How System Command can replace a file in Application Server

Former Member
0 Kudos

Hi Guys,

A new system Command is created. When that system command is executed, the client wants to take a file from one directory in application server and put that file into another directory on the application server itself. How this can be achieved?

What I know is we can create a function module and place that function module in the system command. But in that function module, I have to change the fielname and put that into another directory. I don't know how to do it.

Note: I shouldn't read the data from the file using Open Dataset statements..

Please let me the solution if any one has encountered such a scenario.

Regards.

Hari.

Accepted Solutions (1)

Accepted Solutions (1)

markus_doehr2
Active Contributor
0 Kudos

Create a script to rename and execute that script using SM49...

--

Markus

Former Member
0 Kudos

Hi Markus,

Thx a lot for your reply. But can you be more elaborate? How can we create a script using SM49. What to pass in the additional parameters?

Only by running the Command, does the file can be transferred to another directory?

Regards.

Hari.

markus_doehr2
Active Contributor
0 Kudos

A script means "operating system level". Since I don´t know which OS you use I can hardly give an advise.

Please give more details, what you want to do. "moving files" around is certainly not something you need a SAP system for

--

Markus

Former Member
0 Kudos

Hi Markus,

This is a directoy /interfaces/BI_Upload/GSM/IN on the application server. There are some files in this directory. When the system command is executed, a file in this directory needs to renamed and put into another directory /interfaces/BI_Upload/GSM/OUT..

The operating system is HP Unix..

Regards.

Hari.

Former Member
0 Kudos

This is the operating system commnad -f 1100 -t 4110. I don't know what it means?

markus_doehr2
Active Contributor
0 Kudos

That is not the command but just the parameters for the command.

this look to me like "iconv" to convert codepages (from 1100 to 4110).

Is the target filename known? I mean, does it follow any rules? Or will this be changed each time the command is executed?

--

Markus

Former Member
0 Kudos

Ok Mark. Now I got all the details that you need.

Command Name ZSAPICONV

Operating System LINUX

Type Customer

Operating system command /sapmnt/NWD/exe/sapiconv

Parameters for operating system command -f 1100 -t 4110

Additional Parameters Allowed.

I think this will help you to resolve my case. Please help ASAP.

Regards.

markus_doehr2
Active Contributor
0 Kudos

My name ist Markus - not Mark

no - this is the description of the ZSAPICONV command which has nothing to do with your requirement.

--

Markus

Former Member
0 Kudos

Sorry Markus..

When this command ZSAPICONV is executed, the file from one directory should be renamed and sent to another directory. That is the requirement...

Regards.

Hari.

markus_doehr2
Active Contributor
0 Kudos

I think you are mixing up things here.

The program "sapiconv" is for converting files into different codepages, it´s not for copying/moving files to other directories.

If you want to use the ZSAPICONV to you need to modify it, take out the "sapiconv" and put in the "mv" (move) command to move the file to the other directory.

I suggest though creating a NEW command. e.g ZMV and give the appropriate parameters.

--

Markus

Former Member
0 Kudos

Thx a lot Markus..

Iam really giving a lot of trouble to you. But one last question is What parameters should I give while creating the new command ZMV.

Regards.

Hari.

markus_doehr2
Active Contributor
0 Kudos

I can't answer this since you didn't give me an answer on the question if the target filename is known already - does it follow a specific naming scheme?

--

Markus

Former Member
0 Kudos

Yes the target file name is already known. It follows the naming convention base on the current date. The target directory is /interfaces/BI_Upload/GSM/OUT. The filename is system date.

Regards.

Harish.

markus_doehr2
Active Contributor
0 Kudos

System date as how?

You need to enter the same command as parameter as you would do if you would rename the file on operating system level. What would you use there?

--

Markus

Answers (0)