Pages

Saturday, August 10, 2019

Dynamic names for export files

PBCS or better known as Planning with the recent rechristening by Oracle, gives us an ability to export data into a flat file using our very own DATAEXPORT command in business rules. Lets see how this command have some interesting feature in cloud version vs the on-premise one.

In the on-premise version (the one I am using is Planning 11.1.2.4.004.5 and Calc Manager 11.1.2.4.013.005) if we tried to generate a file name using any RTP, it would not allow us to validate the rule.


image


Let’s say, we ignore the validation error and still deploy the rule, the rule executes but generates the file with the name “VisionData_{Year}.txt”, leaving no option to generate a file which could have dynamic names.

Though this doesn’t seems to be showstopper in anyway as the data would have the RTP member inside the file, but considering we like to append date in YYYYMMDD format to the name, it would be impossible.

Come to the world of cloud and Oracle has changed the way Calc Manager processes the RTP in the file name. A similar script to export data for a specific year identified by RTP and the same RTP used as file name in the DATAEXPORT command.

image

The script validates without giving the validation error as in the case of on-premise. When we run the script providing a RTP value, it executes and creates a file in the inbox/Outbox folder

image

image

What if we like to add the date to the file name? Though it cannot pick the system date as we can while writing a script using groovy, but can provide a RTP option to choose date which can be added to the file name to give us file with date in it. Date is a RTP of type DateAsNumber and when providing a value with generate the file having this date in its name.


image


image


Hope this helps !!!