Java Message Mapping : Dynamic FileName and Directory for ASMA

How to Put Dynamic FileName and Directory for ASMA Properties of File Receiver adapter in Java Message Mapping ???
I know How to Do this in UDF , But In Java Type Message Mapping . How to do this ????
Regards
PS.

Hi
chk this:
http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
Thanks
Amit

Similar Messages

  • Dynamic FileName and Directory - UDF

    My scenario is to get Target Directory Name based on part of Filename. How can I do that using UDF. I will select adapter specific parametrs and like to change using UDF. TO achive this I will create a dummy field names in the target structure. Can someone let give me UDF code?.
    For Example: Source FileName : SD00123456Prod.csv
    Target Directory Should be /Sales/
    Target File: Prod.csv
    Thanks for any help.

    I changed function this time. I took exact coy of Michals Blog.
    Function:
    public String SourceFileName(Container container){
    container.getTransformationParameters().get
    (StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create
    ("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return  ourSourceFileName; 
    Now the error when activate message mapping:
    Activation of the change list canceled Check result for Message Mapping Source_2_Target | http://test.com:  Starting compilation  Source code has syntax error:  /usr/sap/DPI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map36d73f104e5e11db977f001125a56eca/source/com/sap/xi/tf/_Source_2_Target_.java:55: cannot resolve symbol symbol : variable conf location: class com.sap.xi.tf._Source_2_Target_ String ourSourceFileName = conf.get(key); ^ 1 error

  • File Scenario with Dynamice Filename and Directory

    Hi All,
    we have a requirement that PI has to pickup the file from 2 FTP Server.
    First PI has to pickup an XML file from Server1 , this XML file has a details about the Filename and Directory of the second FTP server., then PI should login to the server2 and pickup the file form the directory.
    Regards,
    Mani

    Hi Mani,
    Can you try below approach ,
    Read file 1 from Server 1 using sender file Communication channel and read 2nd filename and directory details and pass these values to UDF/Java mapping to log in to server 2 and retrieve the data/file2 ?
    Thanks
    Hari.

  • Getting an Error Message: AA 698  ANLB and ANLC for asset not in Sync

    Hi all Experts
    I know there were previous thread on the similar issue. I read those and tried to follow the procedure mentioned but didn't work. First of all We are working on ECC 6.0 verion. We have couple of assets Which is giving a problem even when we display the asset. The error message AA 698 ANLB and ANLC for asset not in Sync.
    We added a new depreciation area which was added to all the assets. the depreciation calculation for the new depreciation area is not updated in table ANLB. The asset were capitalized in 2009. I think the asset transfer was done using AS91. I initially thought it was fiscal year change problem but now as i open fiscal year 2009 and try to calculate the depreciation it keeps giving me the same error AA 698. There were various OSS notes mentioned which are all implementd in our system.
    One more thing I see is that on the depreciation area which has issue which is not populated in ANLB table doesnot have ordinary depreciation  start date. Which I tried to maintain using AS92 and reran the depreciation caluclation (AFAR) this also didn't work as its giving me the same error. Also this depreciation area doesn't have Operational rediness date, I think this date should populate from the value date of the asset.
    Please let me know if you have suggestion
    Thanks
    Rajan

    Hi bernhard,
    thanks for your reply. Below are my observation
    1) Have ANLB-LGJAN and ANLC-GJAHR the same depreciaiton areas:
              I had checked this earlier....ANLC doesnot have an entry for that specific deprectiation area. ANLB has an entry. This is where all the issue started.
    2) Is the field T082AVIEWB-AUTHORITY on 2 (note 900767).
             This note has been applied and the view is on 2
    3)Are the following fields synchrone: ANLC-GJAHR = T093C-LGJAHR
                  These field are not synchrone: ANLC doesn't have an entry for depreciation area 82 other depreciation area are at 2009 in ANLC and in T093C-LGJAHR is in 2010. How can we sysnc these tables? Also how can I get depreciation area into ANLC table?
    Thanks
    RDK007

  • For preparing the filenames and paths for the oracle database files..

    Hi,
    I am preparing the filenames and paths for the oracle database files.....but I am not able to complete this one...Will you Please help for filling this one.
    Controlfile ---- > select name from v$controlfile;
    Redologfile -- > select member from v$logfile;
    Datafile --------- > select tablespace_name,file_name from dba_data_files order by 1;
    Tempfile --------> select tablespace_name,file_name from dba_temp_files;
    Spfile -----------> show parameter spfile
    Pfile --------------->
    Passwordfile ---->
    tnsnames.ora -->
    listener.ora------>
    sqlnet.ora ------>
    oratab ------------->
    Thanks
    Shiju

    orashiju wrote:
    Hi,
    I am preparing the filenames and paths for the oracle database files.....but I am not able to complete this one...Will you Please help for filling this one.
    Controlfile ---- > select name from v$controlfile;
    Redologfile -- > select member from v$logfile;
    Datafile --------- > select tablespace_name,file_name from dba_data_files order by 1;
    Tempfile --------> select tablespace_name,file_name from dba_temp_files;
    Spfile -----------> show parameter spfile
    Pfile --------------->spfile and pfile are located under $ORACLE_HOME/dbs/
    Passwordfile ----> passwordfile is located under $ORACLE_HOME/dbs
    tnsnames.ora -->
    listener.ora------>
    sqlnet.ora ------>all above files are under $ORACLE_HOME/network/admin
    oratab ------------->depends on operating system. Usualy under /etc/oratab

  • Get filename and directory name during runtime

    Hi guys,
    I am developing a file to file interface without content conversion, just a simple file transfer from one ftp server to another. I have to read the same filename (invent.txt) from multiple folders (mstransfer/M01/IN1, mstransfer/M02/IN1, mstransfer/M03/IN1....) that represent different stores and transfer it as it is with the same name to exactly the same directory name in the target ftp location.
    My problem is found inside a dummy mapping that I have created in order to specify the target directory and the name of the file. I am doing the following:
    A) A Java UDF to specify the filename
    trace = container.getTrace();
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String filename = conf.get(key);
    trace.addWarning("filename = "+filename);
    conf.put(key, filename);
    return "";
    //return filename;
    B) A Java UDF to specify the directory name
       //write your code here
    trace = container.getTrace();
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    String directory  = conf.get(key);
    trace.addWarning("directory before = "+directory);
    directory = "/usr/sap/trans"+directory;
    trace.addWarning("directory after = "+directory);
    conf.put(key, directory);
    return "";
    //return "/usr/sap/trans"+directory;
    In receiver file adapter I do not specify neither a filename nor a target directory.
    When I am testing it, I always get a mapping runtime error.
    Any ideas?
    --Evaggelos

    Guys,
    First of all, I am doing an end to end testing, i.e. I let the FTP adapter pick the file up and another FTP adapter delivers the file to target folder. I am definitely not testing the mapping in mapping editor.
    I get the error in Request message mapping (pipeline step, which I can see in SXMB_MONI transaction) which is a dummy mapping between two message types that I have created and are based on two data types with two fields each.
    The UDF's that I have created go in-between the source and target fileds of the message types/data types.
    The error that I see in the trace section of the XML message in SXMB_MONI is the following:
    "<Trace level="1" type="T">RuntimeException during appliction Java mapping com/sap/xi/tf/_MM_G_SRS_FileTransfer_MNS_</Trace>
      <Trace level="1" type="T">java.lang.NullPointerException at com.sap.aii.mappingtool.tf3.AMappingProgram.exceptionCaught$(AMappingProgram.java:59) at com.sap.aii.mappingtool.tf3.Transformer.checkParserException(Transformer.java:182) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:149) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:64) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:91) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:90) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:95) at"
    I have included some trace.addWarning() lines in Java code to help me debug my code, but I cannot see them anywhere inside the trace to be getting executed.
    I will try Bhavesh's idea and I will write the code in the Java Section of my message mapping ( either Intialization or Destrcution ) section.

  • Calling Message mapping Dynamically based on a field value

    Hi gurus,
    I have
    1 source inteface
    1 target interface
    3 Message mapping programs based on the 1 source and 1 Target Interfaces
    I need to decide Dynamically as which message mapping program should be called based on the Input provided by the source system.
    For example:
    If the souce side file sends a field value=1 then message mapping 1 should be called
    If the source side file sends a field value=2 then message mapping 2 should be used...
    Pls provide me help on this ASAP.

    As ur source and target structures are always same, u should have used same mapping with multiple conditions instead of using three different mappings.
    Right now for ur requirement, in ID -> standard Interface Determination, u can use multiple interface mappings based on condition.
    Check heading "Specifying Conditions (for Multiple Inbound Interfaces)" here
    http://help.sap.com/saphelp_nw04s/helpdata/en/42/ea20e737f33ee9e10000000a1553f7/content.htm
    Regards,
    Prateek

  • Message Mapping(Display queue and Suppress Value)

    Hi Experts,
    In Message Mapping(graphical mapping), upon checking the properties of the nodes,there's one property display queue, in which suppress is there??
    What does it mean?? Which queue it points and what value is suppressed??
    Thanks & Regards,
    Sushama

    Hi Sushama,
    SUPPRESS means no value.
    suppose we are checking one condition (tdid = "RE" then pass tdline) based on the condition we will send one output. if the condition fails then suppress value goes to the target.
    > What does it mean?? Which queue it points and what value is suppressed??
    es:  if(tdid.equals("WE") ifwithoutelse pass tdline value as output.    [tdid is in E1EDKA1 segment and this segment occurance is multiple]
    In this case if the condition is satisfied once and failed once (means E1EDKT1 segment comes 2 times) then first time it sends the corresponding tdline value and second time it sends the SUPPRESS value.
    Regards
    Ramesh

  • Each message shows same date and time for sent and received.

    Each of the thousands of messages in Mail shows that the message was sent and received at the same time. Somehow, Mail is displaying incorrect information. In other words, the "date sent" and "date received" columns are identical. What can I do to Mail to get it to put the correct "sent" time in the column?

    Are you asking a question or making a suggestion? If you're asking if you can change Messages to show the time stamp for every message, no, you can't. If you are trying to make a suggestion to Apple, the appropriate place to do that is here:
    http://www.apple.com/feedback

  • Dynamic File and Directory Name without Mapping

    Hello Experts,
    We have following requirement:
    1) Files will be picked from R/3 AL11 directory and would be placed in corresponding folder in target system.
    2) On source side ,there would be only one folder for all types of files(around 20),but on target side,there would be one folder for each kind of file(20 folders)
    3) File name should be same on the target side but target directory should be selected based on file name.
    I have gone through a number of posts related to similar requirements and hence,sorry for a new post but I am not yet able to find a solution to this.
    I could understand,this can be achieved using DynamicConfiguration UDF .
    But I have no possibility to have mapping in my scenario.It would just be a pass through scenario.
    Can anyone please suggest a solution to this?
    Thanks.
    Regards,
    Shweta

    Hello,
    Thanks a lot for suggesting solution to this problem.
    I could achieve this using following Java mapping:
    import com.sap.aii.mapping.api.*;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    public class GetDynamicConfiguration implements StreamTransformation {
        private Map param;
        public void setParameter(Map map1) {
            this.param = map1;
        public void execute(InputStream inputstream, OutputStream outputstream) throws StreamTransformationException {
            try {
                   AbstractTrace  trace = null;
                // a) Set ouput File name
                String directory=null;
                   trace = (AbstractTrace)param.get(StreamTransformationConstants.MAPPING_TRACE );
                param.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic", StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
                DynamicConfiguration conf = (DynamicConfiguration) param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
                DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
                   DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
                String filename =conf.get(key);
                conf.put(key, filename);
                   trace.addInfo("File name is "+filename);
                if(filename.equals("in.txt"))
                directory = "/home/ftpxi/in";
                   if(filename.equals("test.txt"))
                   directory = "/home/ftpxi/in/test";
                   if(filename.equals("shweta27.txt"))
                   directory = "/home/ftpxi/in/test";
                   trace.addInfo("Directory name is "+directory);
                   conf.put(key1, directory);
                // b) Just copy input file to output file
                byte[] b = new byte[inputstream.available()];
                inputstream.read(b);
                outputstream.write(b);
            } catch (Exception exception) {
                exception.printStackTrace();
    Thanks again.
    Regards,
    Shweta

  • Dynamic username and password for UsernameToken in Receiver Soap Adapter.

    Hi All,
    I am using AXIS Frame work for WS Security Authentication in Receiver SOAP channel. I deployed AXIS and used WSDoAllSender handler. I want to set the username and password parameters in the module dynamically. These have to be extracted from the payload. 
    kindly give me pointers to dynamically assign Username and Password.
    Regards,
    Saipriya.

    continued from the previous entry
    1.  configure the following four handlers in the request chain
    Handler dc
    Handler xireq
    Handler wssec
    Handler trp
    For the xireq and trp handler, you can use the default setting.
    For the dc and wssec handlers, you use the following setting:
    dc: handler.type =  java:com.sap.aii.axis.xi.XI30DynamicConfigurationHandler
    dc: key.1 = write http://sap.com/xi/axis username
    dc: value.1 = user
    wssec: handler.type = java:org.apache.ws.axis.security.WSDoAllSender
    wssec: action = UsernameToken
    wssec: passwordType = PasswordText
    wssec: passwordCallbackClass = com.sap.aii.axis.security.DefaultPasswordCallbackHandler
    2. Create an external password file with user password pairs. For example, if you have three users: orange, banana, and apple, with their passwords: orange, yellow, red,  you create a file with content:
    orange:orange
    banana:yellow
    apple:red
    You name this file to ".password" and place it at the engine's classloader directory (e.g.,
    /usr/sap/E07/JC90/j2ee/cluster/server0)
    3. Prepare the input message containing the user name in the dynamic configuration header that looks like:
    <ns3:DynamicConfiguration xmlns:ns3="http://sap.com/xi/XI/Message/30">
      <ns3:Record name="username" namespace="http://sap.com/xi/axis">orange</ns3:Record>
    </ns3:DynamicConfiguration>
    The namespace and name must match the value used in the key.1 property of the dc handler. As long as they match, you can use any names.
    In this example, the user name value "orange" will be extracted by the dc handler and inserted into the message context.
    4. Send a test message.
    Best regards, Yza

  • How to get only the filename and extension for a text item?

    Suppose there is a non-database text item called :myfilename
    :myfilename := 'C:\SomeFolder\SomePath\myfile.doc';
    I would like to get the file name only without the full path,
    i.e. myfile.doc
    and the file extension, i.e. 'doc', 'bat', 'java', 'xhtml' etc., i.e. the last few chars from the right to the period.
    Any help is welcome.

    Thanks for the hints.
    I defined the non-database Text Item called FULLFILENAME and another two text items called FILE_NAME, FILE_EXTENSION. The following can extract the file extension,
    select substr(:FULLFILENAME,instr(:FULLFILENAME,'.')+1) into :FILE_EXTENSION from dual;
    e.g.
    :FULLFILENAME := 'C:\MyFolder\AnotherFolder\file.doc';
    FILE_EXTENSION becomes 'doc'
    but I would also like to extract only the filename without path into FILE_NAME,
    i.e. file.doc
    Please give more hints. Thanks.

  • Message mapping of sort and repeated

    Dear all,
    I am new to SAP XI. I have a scenario where my Input message and out put message will be like this:
    Input Messgae:                                                    Output Message:
    Emp_DT                                                               EmpOut_DT  
    Info - Element - 1-infinity                                     EmpInfo           1-1
      Department ID  1-1                                                Manager      1-1
    Details 1-1                                                           Department      1-Infinity
      EMpNO 1-1                                                            NoofEmployee 1-1
      Manager 1-1                                                          Department   1-infinity 
    Ihave to map by following rules:
    1. Sort output message by taking inputmessage Details- Manager
    2. Have to count totla no of employee of respective manager
    3. have to check how many department under that manager.
    Thanks in advance.

    Also, check out the SDN Wiki's. There are a good number of examples out there.
    [Help with mapping|http://wiki.sdn.sap.com/wiki/display/XI/GraphicalMapping-Standard+functions|Wiki link to help with mapping]
    [Step by Step guides to PI Scenarios|http://wiki.sdn.sap.com/wiki/display/XI/Step-by-Step+Guides|SDN Wiki link for Step by Step guides to PI Scenarios]

  • Programmatically change filename and path for PDFCreator

    Hello,
    I know that creating PDFs is a common question on the forum but I've yet to see someone with the same problem that I am encountering.  I'm following the example at http://decibel.ni.com/content/docs/DOC-4552#comment-12005.  I posted a question on this page but am posting again here for hopes of a faster response.
    I am able to create a pdf of the test.txt file.  However, I am unable to change the path or filename.  No matter what I select the file is created with the name and path defined in the autosave options of PDFCreator.  Since the file is created, I know that the reference is correct.  It seems that the cOption invoke nodes are not working.  If I turn on autosave in the PDFcreator options, I am prompted with a save as window.  This means that my command to use auto-save (in the config subvi) is not working.  Likely, the autosavedirectory and autosavefilename are also not doing anything.
    I'm at a loss because everything appears to be correct.  Any thoughts on what could be wrong?   (labview 8.6.1     PDFCreator 0.9)
    Solved!
    Go to Solution.
    Attachments:
    Testing PDF Creator.vi ‏9 KB

    Hello,
    Have you tried downloading the latest version of PDF Creator? It looks as though it is at 1.0.1 now. If this is a problem with the ActiveX interface, it may be resolved in the latest version.
    -Zach
    Certified LabVIEW Developer

  • Message-Mapping: Use same RFC lookup for different target fields

    Hello,
    I need to apply an RFC Lookup which delivers a boolean flag back (true or false). This RFC lookup should be used for different target fields.
    Is there a way to execute the RFC lookup just once and then store the result in an internediate variable that I can use for all futher checks for different target fields?
    If this is not possible and I have to apply the RFC lookup for all necessary target fields is it then executed for each target field ? This is exactly what I want to avoid in order not to slow down performance.
    The input parameter (=source field value) would be the same.
    Thank you for your advice!

    Exactly.
    Here is a UDF example I have that you could adapt to your needs.
    Set
    public String setCounter(String a,String b,Container container){
    /* Store values in global datacontainer
    a: mapping value and return valueparameter
    b: name for stored value parameter
    GlobalContainer myGlobalContainer;
    myGlobalContainer = container.getGlobalContainer();
    myGlobalContainer.setParameter(b.toUpperCase(), a);
    return a;
    Get
    public String getCounter(String a,Container container){
       //write your code here
    GlobalContainer gc = container.getGlobalContainer();
    if (gc.getParameter(a) != null) {
      return String.valueOf(gc.getParameter(a));
    } else {
    return "1";

Maybe you are looking for

  • Suspending UI in automation plugin

    Is there a way to suspend UI during execution of automation plugin (C++ Windows, Photoshop cs5-cc). I mean updating display when plugin opens closes docs, add or remove layers. Cna i suspend that and resume it after execution of the plugin. I think t

  • Using Flex Performance Profiler for Profiling Flex  with Java Applications

    Hi , I am planning to use Flex Profiler to profile my Application . I have developed a sample Application using Flex MXML ,some ActionScript classes for Events and Cairngorm , Java , Oracle as database and Blazeds .  Can i use Flex Performance Profil

  • TS3305 I can't access my you tube favorites, forgot username and password

    I never had to sign to you tube to view my favorites, the Ipod is now asking for me to sign in because I can't pull up my favorites and I don't recall username or password used for you tube. Where do I reset the you tube username and password or wher

  • Brand new iMac 24 inch does not start

    I went to best buy and bought the 24 inch 2.66 GHz iMac. We loved it when the apple guy gave us a demo. I brought the brand new iMac home and set it up. Pushed the power button - IMac does not power on. Tried diff options like changing plug socket, e

  • Company Vs Company Code?

    Dear All, Can you please let me know the exact difference between company and company code? How can we assign different company codes to a company? Regards Prasanth