Oracle Apps Notes

A collection of my random notes, primarily on Oracle Apps

Monthly Archives: June 2014

Custom Commands in WinSCP

The WinSCP tool provides a couple of handy features which allow users to execute custom commands directly on the server without having to open a separate terminal.
One such feature is the Command Line which you can enable from Options – Command Line. This will display the command line at the bottom of the GUI where you can execute arbitrary commands. The restriction is that you cannot enter any commands which require user-inputs or involve data transfer. You can enter commands like ‘ls -ltr’ to list files and the results will be displayed in a console window which pops up to display the output.
The second feature can be enabled from Options – Toolbars – Customer Command Buttons. Once enabled, a set of pre-existing commands such as Execute, Touch, Grep etc will be displayed. So if , for example, you want to execute a shell script on the remote server, you select the appropriate file and then click on the Execute command. The shell script will get executed. This saves you from the trouble of having to open a new terminal and then typing the command to execute the script.
However, the most interesting thing about this feature is the little gear symbol. Click on this gear symbol and you will realise that you can modify the pre-existing commands and add your own ones. This is especially useful when you have to do some repetitive task such as compiling a form or uploading a workflow in Oracle EBS.

Custom commands overview

You can write you own custom command to compile a form or to upload a workflow file. So the next time you make changes to the form or workflow you can just copy it to the server, select the file on the server and click on your custom command. You do not have to perform the additional step of opening a server session on PuTTY to execute the compile or upload command. The screenshot below shows the details of the XXUploadWF custom command which I use to upload workflow files.

Custom command details

Another useful custom command I have defined is XXCompile_Form. The command for this is

frmcmp_batch module="!"; userid=apps/temp4 output_file=`echo "!"; | awk '{print substr($0,0,index($0, ".fmb")-1)}'`.fmx module_type=form compile_all=specialĀ 

It compiles the selected .fmb file(in an EBS R12 environment) and generates an .fmx file of the same name.

More details on writing custom commands for WinSCP is available here.