Skip to Content

How to copy files in azure Blob if the container does not exist?

Feb 01 at 06:46 PM


avatar image

Hello All,

First of all thanks to sap for SAP DATA SERVICES 4.2 SP10 .

The requirement in short is below: Getting data sap ecc and put the data in a file in a local shared directory where file name will be <file name>_<system date >.csv and then copy the file to Azure blob and then to Azure data lake store(ADLS).

I developed the job and upto ADLS and BLOB it is working absolutely fine.

But the problem that I am facing is :

Suppose the Blob container name is : 'bodsfile' ,so file that will be generated today should be placed in the path bodsfile/ <current Year>/ < current month>/ <current day> .

(eg. /bodsfile/2018 /02 /02 ) in the azure blob container.

In the sap Guide it clearly written that we can place the file in existing container as well as u can also create container in azure storage but I did not find any option in the flat file location object .I have created the flat file loc object with protocol azure container .

Can any one help me with this also can I use parameter or gv in the flat file location object as it can only be accessed using the function .

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sourav Kanjilal Feb 18 at 07:27 PM

Well we have found the solution. We have to use remote path prefix for creation of the sub folder under azure blob storage.

1.If a container does not exist it can create a new one.

2. If subfolder does not exist it can create under the blob container.

3. BODS can easily connect with Azure data lake(SP10, as I have installed ds 4.2 sp 10).

4.One thing u keep in mind that blob Azure lob does not support empty file. Suppose the BODS extraction file has created a blank file and you want to upload the blank file to the blob storage . It will give Error (divide by zero). Need to check the size/record count of file.I have used get_file_attribute() function for it.

5. BODS can connect AZURE data ware warehouse(use datastore -database as Microsoft > azure DW) ). But also keep in mind that template table in azure Data ware house is not accepted.

for the dynamic creation of folder in AZ blob ,it is still pending.


Sourav K.

10 |10000 characters needed characters left characters exceeded