Skip to Content
0
Aug 25, 2023 at 10:29 AM

Merge multiple files recieving from GCS Bucket & Consolidat File using SAP CPI

178 Views

We have received Business scenerio, as we will receive the multiples files from GCS Bucket using HTTP adapter from 9AM to 9PM CET Time.All files should be merge in to single consolidated file and place it in SFTP or AL11

  • As the 2 iflows can execute in parallel (ex: we receive a new file at 20:45), we can have concurrent access problems on the consolidated file
  • Please think on a solution for that
  • Example:
  • The consolidated file name is “int_stp15_consolidated_<date>.tdf”
  • The 1st action of the 2nd iflow is to
  • Rename the consolidated file with a “.lock” suffix (ex: “int_stp15_consolidated_20230818.tdf.lock”)
  • Create a new one with tomorrow date (ex: “int_stp15_consolidated_20230819.tdf”)
  • Then it pushes the file in S/4, archive it and delete it from the workspace bucket
  • When the 1st iflow wants to write on this consolidated file,
    • He looks for a file with name “int_stp15_consolidated_<date>.tdf” with date = today
    • if he finds it, he writes on it
    • if he does not (even if there is “int_stp15_consolidated_20230818.tdf.lock” file), he looks for a file with date = tomorrow
    • If he does not find it => error