Script to upload multiple LDT files for a Concurrent Program/Alert/Form/ValueSet/XML Definations in a Single time
Use-Case: In general during the migration process/Go-Live the downtime of the server will be less and in that less span of time we need to complete the migration process. So if we go for a standard process by executing each LDT upload at a time for each file it is time time-consuming process to overcome this scenario, we can write of script and execute it, so that it will read all the LDT files in the .txt file and starts uploading one by one which reduces the time of execution and prevents missing of files which need to be uploaded.
Introduction: It is generally a time-consuming process and task to create the same setup data on each instance separately. Hence to migrate setup data from one instance to another instance (E.g. from DEV to TEST to PROD), LDT & LCT files are used.
LDT (Data Loader Files)– These files are Used to upload & download setup data on different instances.
By using FNDLOAD we can achieve the process for moving data like Concurrent Programs, Executables, Key and Descriptive Flex fields, Profile Options, Forms and Form Functions, Value Sets and Values, and many others.
Standard Syntax will be the
FNDLOAD apps/<appspwd> 0 Y mode configfile datafile entity [parameter¦…]
- By using the mode we can make use of download or upload
- The configuration file is that Fndload needs to download or upload data.
- Data _file is the output file (which contains the downloaded data)
- The entity is nothing but what we need to download like value set or profiles..
FNDLOAD Command to upload multiple concurrent Program LDT’s
FNDLOAD username/password 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_CP. ldt
- Username and password refer to the database password of the instance from which you would like to upload the LDT file.
- ldt we need to mention the LDTFile Name that needs to be uploaded
We need to run the above command to upload the LDT file in the new instance once the upload is done only a log file will be generated which shows the status of the upload.
The above command will be helpful only when a new Concurrent Program is being registered in the new instance.
Note: If we would like to update the existing concurrent program (that means the concurrent program already exists in the new instance but we need to update the changes of the program from the old instance to the new instance) then we need to add – CUSTOM_MODE=FORCE
FNDLOAD username/password 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_CP. ldt – CUSTOM_MODE=FORCE
The above fndload command will update the changes in the concurrent program existing already in the instance without – CUSTOM_MODE=FORCE it will not update the changes
The above process might be time-consuming and when we want to upload multiple LDT files we do not have much time to execute commands individually, to overcome this we can follow the below steps
Step-1) We need to place all the LDT’s in a specific path or Directory as shown below
Step-2) Need to make of list of the LDT Files in a .txt File
Note:
1) Alone only one Compete Concurrent Program Name Should be mentioned in each line
2) No gap should be left between the Lines
3) The last line of the txt file should not be null i.e, the cursor should be ended with Test_File_CP(any file name ) but not null and should be saved with no spaces left in the file
4) It should be saved in the .txt format with a File Name in the same directory where the LDT Files are stored
Step-3) Preparing the Script for opening the .txt File, read each line, Execute the Upload command for each LDT File
cat “ldtfile.txt”|while read line
do
echo ${line}.ldt
FNDLOAD apps/password 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct ${line}.ldt – CUSTOM_MODE=FORCE
done
- Cat command is used to open the File – In the above code context we are mentioning cat “ldtfile.txt” so as open the file and also read the line in the file using the while read line
- Do and Done were mentioned as part of the loop where to start and end the process
- FNDLOAD apps/password 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct ${line}.ldt – CUSTOM_MODE=FORCE for the above line of code we are passing the .ldt file name through ${line}.ldt now the fnd load upload will start uploading for the specific LDT file name which is fetched in the loop.
- One after the other all the LDT File names will be fetched from the txt file, and executed. Once the last line is reached it terminates the process and stops the execution