[SAP PO] DYnamic folder for output file on sftp

Hi everyone,

Some situations, we need to write the output files on dynamic folders on SFTP.

So now, I would like to share the way to config dynamic output folder on SAP PO.

Step 1: Create UDF to set path of output folder

Create UDF in Message Mapping
 try
  {	
     String pathString = "YOUR_TEXT";
     DynamicConfiguration conf =      
          (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

     DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
 
     pathString = pathString +plDate;
     conf.put(key,  pathString  );
     return plDate;
  } 
catch (Exception exception)
  {
     return plDate;
  }

Step 2: use created UDF

Use UDF SetFolder in Message Mapping / Definition

Step 3: Config ASMA in Receiver Channel

Config ASMA in Receiver Channel

Now you can send file to dynamic output folder base on the date of integration transaction.

Output file in dynamic folder

Hope this blog can help you.

Bye bye and see you again 😀

Giang Nguyen.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.