Skip to Content
author's profile photo Former Member
Former Member

Dynamic file Name generation

Hi Experts,

i have the requirement

I need to extract some records from Database (Scenario is Database to file) and we need to put it into file.

then i need to change the file name based on certain conditions and send it to relevent file server which are globally located across the world.

My Doubts are :-

1- After extracting the records from Database From where i can get file name?? Can i get the file name from SXMB_MONI. If yes then How??

2- Now I got the file name then i need to change this file name into different file names (Dynamically) based on some conditions to send it to different file servers. Can i do it in my mapping Or i need to write a module for it.??

Thanks in Advance

Regards Prajwal

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 06:54 AM

    You can write file it in mapping

    Refer

    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

    modify UDF as per your requirement

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 18, 2008 at 06:59 AM

    Hi Naluvala,

    Based upon your condition you can directly set the file name using this UDF:

    DynamicConfiguration conf = (DynamicConfiguration) container

    .getTransformationParameters()

    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

    DynamicConfigurationKey key = DynamicConfigurationKey.create(

    u201Chttp://sap.com/xi/XI/System/Fileu201D,

    u201CFileNameu201D);

    String valueOld = conf.get(key);

    if (valueOld != null) {

    String valueNew = valueOld.replaceAll(u201Cinputu201D,u201Doutputu201D);

    conf.put(key, valueNew);

    Instead of using get function to populate the valueOld, you can use your own logic.

    Regards,

    Sanjeev.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 10:50 AM

    Hi,

    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

    Give the File name at Runtime.

    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

    What ever the file name given in the sender you will get that name in the target side.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.