cancel
Showing results for 
Search instead for 
Did you mean: 

OS command line is not working

0 Kudos

Hi All

I have a scenario where in the existing file in the folder has to be renamed with current timestamp.

I have given the following under OS command line before messge processing.

But the file name is not renaming.

mv /path/FileA.csv /Path/FileA 'date+ %m%d%y%H%M%S'.csv

Not sure whether the above mentioned is correct or not.

Looking for your suggestions.

regards

Venkatesh

Accepted Solutions (0)

Answers (4)

Answers (4)

tobiasberneck
Explorer
0 Kudos

Hi, use the complete path for the command (e.g. /bin/mv). Regards, Tobi.

Former Member
0 Kudos

Hi Venkatesh,

Another suggestion, take the command as you have it:

mv /path/FileA.csv /Path/FileA 'date+ %m%d%y%H%M%S'.csv

And execute it as OS level (or ask someone that has OS level access to help) and see the result.

Another suggestion, make sure that your cases are coherent for your 'actual' source and target paths:

i.e. /path & /Path

Regards, Trevor

Eoin_Kierans
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can you check if the command can be successfully run through the Java Runtime.exec(...) API. Also note that the command is run as user "<sid>adm" (Unix) / "SAPService<SID>" (Windows).

When you set the file adapter location to Debug within the Visual Admin\NWA and then retest you may see the root cause of the OS command not executing

Former Member
0 Kudos

Hi,

You can use:

mv /path/FileA%f

in Run operating system command after message processing.

Thanks,

Sudhansu

Former Member
0 Kudos

Hi,

I suggest adding the timestamp to the filename using the standard functionality of the file adapter. You find it when configuring the file receiver communication channel under the Processing tab page -> File Construction Mode -> Add Time Stamp. Also refer to SAP help.

Alternatively you can set the filename with DynamicConfiguration in message mapping. There are both blogs and threads available on SCN.

Regards, Martin