Dynamic CSV file name in target (Multiple workflow calling same dataflow with new global variable value)

Hi their,
I have multiple data flows doing 90% of the process same. The difference is in source query where clause and target flat file.
I used the global variables to dynamically change the query where clause easily, but I need help in dynamically changing the target flat file (CSV file).
What I want to do is have multiple workflows, which will first set the global variable to new value in the script box and then call the same data flow.
Please let me know if you have any solution or any idea which might put me in the direction to my quest for solution.
thank you,

Hi Raj - in your content conversion for lineitem .. read the additional attribute as well.
Change your source strcture and additional field company_code
As you are already sending the filename for each line item using the UDF.. it's just you need to modify your UDF to take another input i.e. Company Code.
or
If your PI version is > 7.1 use the graphical variable to hold the filename..
and while sending the company code information for every item just use the concat function to append filename & company code..
http://scn.sap.com/people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable

Similar Messages

  • To retain the same file name in target(File) that coming from source system(AS2).

    Hi All,
    I have a requirement to send the two file from the third party system(GXS) to SAP ECC via SAP PI(version - 7.4). We are using AS2 adapter at the sender side to pick the file and using File Adapter to place the file in ECC.
    Its a pass through scenarion(No ESR part is used).
    Requirement:
    We are going to get 2 files ->Example:  one from Axis and another one from ICICI -> each bank file will have a file name ->
    We have to post the file at the target system with the same name as source file name, the source file name could come dynamically(with diff time stamp).
    Please let me know, Is it possible to achieve the above requirement(we have to retain the file name in target that coming from source system) with Sender AS2 adapter, If yes then please suggest the best approach.
    Regards,
    Pradeep Bawlia

    Hi Guys,
    The above requirement is solved now.
    Solution - I used java mapping for extracting the same source file name and assignning the same to the target system.
    Code:
    public class ExtractFileName_ASMA extends AbstractTransformation{
    public void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException  
    DynamicConfiguration conf=in.getDynamicConfiguration();
    DynamicConfigurationKey key_AS2FileNmae = DynamicConfigurationKey.create("http://sap.com/xi/XI/AS2/AS2", "AS2Filename");
    DynamicConfigurationKey key_FileNmae = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File", "FileName");
    String As2FileName=conf.get(key_AS2FileNmae);
    conf.put(key_FileNmae, As2FileName);
    try{
    byte b[]=new byte[in.getInputPayload().getInputStream().available()];
    in.getInputPayload().getInputStream().read(b);
    out.getOutputPayload().getOutputStream().write(b);
    catch(Exception e)
    2. Another solution we can use the graphical mapping and need to use the dynamic config UDF at mapping level to acheive this requirement but here is one drawback - we need to do content conversion is this case.
    In case of Java mapping, no need to play with source file.
    WITHOUT USING ESR, WE CAN NOT ACHEIVE THIS REQUIREMENT.
    Regards,
    Pradeep Bawlia

  • Need to load data from source .CSV files to oracle target database.

    Hi,
    This is the my scenario
    I have .CSV files in ftp folder and need to load the data into target tables.
    For that i need to create package and load the data into daily basis.
    But some time .csv file name will vary daily basis.
    can you any one suggest me???
    Thanks in Advacne.
    Zakeer

    Dear Roy,
    Thanks for your response
    Now I am able to extract the .zip file OdiUnZip (file). and loading data into target this is chapping in static way
    and my scenario is that some time i will get .zip files with different names with different .csv files
    i need to dynamically find the new .zip file and extract it and load the data into target.
    Please advice me..
    Thanks in advance
    Zakeer

  • Creating dynamical flat file name in mapping?

    Hi.
    I know about the variations on how to use an input parameter and/or sysdate to create a dynamic output file name in a mapping.
    My challenge is nearly the same, but I cannot make OWB generate the correct code.
    Problem:
    - got a one column table that holds an identifier in a string field
    - got a function that reads and returns said identifier
    - imported function into OWB
    - trying to use the function call in the Flat File Operator's Target Data File Name, e.g. fixedfilename||fn_get_id()||sysdate||'.ext
    OWB creates the code:
    UTL_FILE.FOPEN(
    'my_location',
    'fixedfilename'||fn_get_id()||'_'||SYSDATE||'.ext',
    'w',
    32767
    However, when compiling the package code, it returns the warning:
    ORA-06550: PACKAGE BODY, line 2214, column 29: PLS-00201: identifier 'FN_GET_ID' must be declared
    which results in an error when trying to execute the mapping.
    I've tried substituting the function call in the FOPEN call:
    myId := fn_get_id();
    UTL_FILE.FOPEN(
    'my_location',
    'fixedfilename'||myId||'_'||SYSDATE||'.ext',
    'w',
    32767
    and this works fine, the mapping creates a file with the desired filename. But obviously not a good solution rewriting the generated code all the time....
    Anyone solved something similar?
    Could I use an input parameter and the autogenerated function GET_<PARAMETER>?
    But can I set the value of an input parameter inside the very same mapping?
    Regards,
    -Haakon-

    (It always helps writing out one's problems...)
    I managed to get it working :-)
    Added an input parameter to the mapping, and gave the outgroup variable a default value by calling my imported function.
    Then concatenated the implicitly generated function (GET_PARAMETER) in the Target Data flat file name.
    I now have a target file name that changes according to a departement id stored in a parameter table.
    Regards,
    -Haakon-

  • When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the original file name being replaced during the downloading process?

    When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the file name being changed during this downloading process?

    Hi Glenyse,
    Here are my steps.
    1.  I upload multiple image (jpg) files onto my photo album.
    2.  I select the "sharing" by email option for this album.
    3.  I enter the recipient's email address.
    4.  The recipient receives my message and clicks on the link.
    5.  The recipient accesses my photo album and clicks on one of the images.
    6.  The image opens up to its own screen.
    7.  The recipient selects the "download" and then save file option.
    Here is the part I do not understand.  For some reason, during this "download" process, the original name which I have given to the file is replaced by different name.  So I was hoping that someone knows how to prevent the file name from being changed during the "download and save" process.
    Much appreciated if you can help me find a solution to this problem.
    Mary  

  • Dynamic Receiver file name in AS2 adapter

    Hi Experts,
    How to get dynamic receiver file name in AS2 adapter. We need receiver file name same as of sender file name.
    We tried selecting dynamic attributes file name but we are getting followin error in CC.
    Message processing failed. Cause: javax.resource.ResourceException: Fatal exception: com.seeburger.xi.connector.queue.TaskBuildException: Mandatory attribute dtAS2FileName is not present in XI message., Mandatory attribute dtAS2FileName is not present in XI message.
    Thanks,
    Hari

    hi hari,
    You can't do it manually. As both adapter are in different context.
    You can go with UDF to slove ur problem.
    Just extract the input file name using Dynamic configuration
    Store that in some variable.
    Use same name in the dynamic file name in AS2 receiver. Below code might be useful.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://seeburger.com/xi/common/dtAS2FileName", "DYNFILENAME");
    conf.put(key,strfilename);
    Thanks
    Jai
    Edited by: Jaideep Baid on Apr 9, 2010 9:16 AM

  • Dynamic Logo file names in PO XSL-FO stylesheet

    We have different company logo files for different operating units. Hence , we require to use a dynamic logo file name in XSL-FO template.
    When I use the below for a single file it works.
         <fo:inline>
    <fo:external-graphic content-width="50pt" content-height="50pt" src="url({'${OA_MEDIA}/Logo_medium_COMCEL.jpg'})" />
    </fo:inline>
    However, I would need to make the filename dynamic.
    When a tried usng an xsl variable tos tore fielname, it didnt work.
    Any pointers as to how we can achieve that would be helpful

    Thanks for your quick reply Dave, I appreciate your time.
    But I couldn't test the new template as I was neither able to create a new PO nor was able to run the PO Output for communication Report. When I tried to create a PO the Purchase Order form did not open saying I am not setup as an employee, even the PO Output for communication did not give any LOV for the PO's.
    I tried to define employee name in the employee's login
    information (System administrator/Security/User/Define) for my user, but some how my name doesn't appear in LOV. Any help is appreciated.
    Thanks,
    Sharmila

  • Include the file dynamicly by file name

    in my jsp,I want include another jsp dynamicly
    <%@ include file="thefile.jsp" %>
    thefile.jsp should be dynamic like:
    <%=String filename=="thefile.jsp" %>
    <%@ include file=filename%>
    I know above is not working since file only take static name.
    is there any way to include the file dynamicly by file name?

    String path = "..."; // to the ressource to include
    javax.servlet.RequestDispatcher dispatcher
              = getServletContext().getRequestDispatcher(path);
    dispatcher.include(request,response);

  • Dynamic attribute file name

    Hi All,
              I am trying to use dynamic attribute file name using UDF in message mapping:
    <i>String filename = null;
    filename = "Yahoo";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://seeburger.com/xi/common" , "dtSubject");
    conf.put(key1,filename);
    return "";</i>
    But its just giving me the name on the receiver side as in the sender side.
    I have checked FileName in Dynamic attributes in the reciever adapter.
    Regards,
    XIer

    your return statement looks like <i>return "";</i>
    Return the filename that you have assigned inside the UDF and can be achieved by
    conf.put(key1,filename);
    <b>return filename;</b>
    Do refer this blog as well
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

  • Check CSV file name while uploading file?

    Hi All,
    I am uploading data from CSV file.. That part is working fine.
    Now i want to check CSV file name. Ex : CSV file name = W1234H4321AB.
    I want to check 6th letter, if 6th letter is eq 'H', i want to upload data otherwise should display some message.
    I tried by reading this attribute, but i declared this type as XSTRING, i checked value after using get_Attribute in  lv_datasouce. It contains some XSTRING value. How to get CSV file name??
    Cheers,
    Venkys.

    >
    Thomas Jung wrote:
    > >I want to check 6th letter, if 6th letter is eq 'H', i want to upload data otherwise should display some message.
    >
    > Everything that you have been told about using the filename property of the FileUpload is correct. However you should note that the filename will not be available until after the file has already been upload to the server. So you can't stop the fileUpload based upon a check of the filename - its too late and the upload has already occured.
    yeah that is true. but is there anyway to check it otherwise.
    or we need to wait for something in coming versions 7.3 or 7.4.

  • In mini bridge, is it possible to view the file name and the rating at the same time?

    Hello,
    In mini bridge, is it possible to view the file name and the rating at the same time?
    Thank you.

    if you know when a new image arrives and you can retrieve that new image file name ...
    Well, that's precisely my doubt, how can I know the file name? Is there a property/method for it?
    function loadImages() {
    for (var i:int=0; i<imagesNames.length; i++) {
    var imgLoader:Loader=new Loader;
    imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,imgLoaded);
    imgLoader.load(new URLRequest(imgPath + imagesNames[i]));
    function imgLoaded(par:Event):void {
    trace(par.target,par.target.content,par.target.content.name);
    Output window:
    [object LoaderInfo] [object Bitmap] instance160
    [object LoaderInfo] [object Bitmap] instance159
    [object LoaderInfo] [object Bitmap] instance161    

  • Is it possible to edit multiple images description, time, title with new OSX Photos? I find this option very useful in Iphoto

    Is it possible to edit multiple images description, time, title, with new OSX Photos? I find very useful this option in Iphoto

    why? i find this opportunity very useful, there is an alternative way?

  • Same file name at Target with change in file extension

    Hi,
    I am working on File to File scenario. I need to create target file name similar to the source file name. This can be achieved by using ASMA. But my requirement is to change the file extension for the target file.
    For example:
    Source File u2013 InvoiceNotification.txtu2026.Then target file should create as
    Target File - InvoiceNotification.csv
    This can be achieved by using OS Command unix script in the receiver communication channel.
    Is there any better way of doing this..say something like Dynamic Configuration or Variable substitution?
    Thank you.

    Hi Achuth,
    I think you are doing content conversion at the receiver side. Go ahead with ASMA, get the file name.
    DynamicConfigurationconf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKeyFileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, a);
    return "";
    In the receiver file adapter, keep the extension as .CSV. That's enough.
    Else you can follow as said by Abhishek Salvi. Either way you can achieve the requirement.
    Thanks,

  • Need help with Dynamic Excel File Name please.

    I am try to output an excel file with dynamic date. 
    Here what I done.
    I am using SQL 2012.
    Create Execute SQL Task Connect Type: Excel
    Create Data Flow Task set to DelayValidation: True
    Create OLE DB Sourc
    Create Data Converstion
    Excel Destination
    Excel Connection, Expression, select ExcelFilePath
    @[User::sXLFilePath] +  @[User::sFileName] + RIGHT("0" + (DT_WSTR, 2) DATEPART("DD", GETDATE()), 2)+ RIGHT("0" + (DT_WSTR, 2) DATEPART("MM", GETDATE()), 2) + RIGHT((DT_WSTR,
    4) DATEPART("YYYY", GETDATE()), 2) +".csv"
    C:\ExcelOutPut\SOX_CAM_SQL_Report_010215.xls
    What I try to accomplish is output the file with each day append to it, date must be DDMMYY.
    I google it and found many samples, tested it, and none of them is work for me. 
    Any suggestions or some examples to share is greatly appreciate. 
    I am new to SSIS.  I found one poster have similar issue and inside the posted below, there was one suggestion to create variable and connection string but how do I bind that variable to Excel Connection manger.
    Please help.
    Thank you so much in advance.
    Ex: SOX_CAM_SQL_Report _020215.csv
           SOX_CAM_SQL_Report _030215.csv
    --Similar issue:
    https://social.msdn.microsoft.com/Forums/en-US/bda433aa-c8f8-47c9-9e56-efd20b8354ac/creating-a-dynamic-excel-file?forum=sqlintegrationservices
    Suggestion in the above posted but where can bind this to Excel Connection Manger. 
    Please help provide step by step.  Thanks.
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\temp\\" + "ExcelTarget" + (DT_WSTR,4)DATEPART("yyyy",GETDATE())  +
    ".xls" + ";Extended Properties=\"EXCEL 8.0;HDR=YES\";"
    And yes, as you were intimating, the delay validation on the dataflow should be set.

    Hi NguyenBL,
    According to your description, you created ssis package to export data from database to excel, when the package runs, you want to create new excel and name the file with time stamp. If that is the case, we can achieve the goal by following steps:
    Create a script task used to create excel files.
    Create a data flow task to export data from database to excel.
    Add OLE DB source to data flow task.
    Add Excel Destination to data flow task.
    Create connection manager for OLE DB and Excel.
    Click Excel Connection Manager, in Properties window, click (…) button next to Expressions, then set ExcelFilePath with expression like below:
    "C:\\ETL Lab\\CreateNewExcel\\ExportData_"+REPLACE((DT_STR, 20, 1252)(DT_DBTIMESTAMP)@[System::StartTime], ":", "")+".xls"
    For detail information, please refer to the document:
    https://sqljourney.wordpress.com/2013/01/12/ssis-create-new-excel-file-dynamically-to-export-data/
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Variables to pass the input CSV file names

    Hi,
    I have created an interface source from 2 different CSV files.
    Do I need to generate 2 different scenarios or one scenario with variable to pass 2 file names one after the other
    2 CSVs are of same type
    Thanks for the help

    Step1. Create an Interface and load first file and test if that is working fine.
    Step 2. Change the resource Name in File to Variable
    Step 3. Set variable pass the file 1 and call interface 1 and set variable again with File 2 and call Interface and run the package.
    This way you can use the same interface to load file with same structure.
    In case you need to carry this same logic with multiple file then
    Declare variable and call interface and package and create scenario. Now trigger the scenario and pass the file name.

Maybe you are looking for

  • Is there a way to edit the songs in my library?

    I have a song in my library that is actually two songs. Is there a way that I can edit it and turn it into 2 separate tracks?

  • How to transfer music from an Ipod to a computer

    I bought a brand new computer after my last one quit working altogether. I have over 250 songs on my iPod that were not purchased on Itunes, and I need to transfer them to my new computer. Is there a way to transfer music that was uploaded from CDs?

  • Update 4.1.2 wifi turns off when mobile data is on.

    Since the latest update from Verizon whenever I connect to Wifi it connects then drops back to 4G right away. When I turn off the mobile data the wifi will connect again. This was never the case prior to the update.

  • Exported iPhoto images not showing in folder

    Hi, When I export a group of NEF images from iPhoto 06 Library, as JPG, to a new folder the files do not appear. If I repeat the export for the other export options the images appear. I did repeat this exercise and exported the images as JPG onto a U

  • Class * not found - Applet error

    Hello! I was just wondering how I would make it so my java applet would work with MSJava as well. At least that's what I'm assuming is the problem. It works fine just about everywhere, but my school computers use MSJava, and when trying to view the a