Pass ftp filename to RFC

Hi
I have a scenario in which I need to pull a file from a ftp location and move it to another ftp location. When I am doing this, I need to pass the file name to an rfc ( This is not synchronous..means the file name is passed to rfc and it will trigger a function to do some other process) . How I can achieve this?  Your suggestions highly appreciated
Thanks
Skaria

Hi,
1. Set Adapter-Specific Message Attribute in the sender file adapter.
2. Use the following UDF to get the filename from the dynamic configuration and pass it to the RFC.
DynamicConfiguration conf = (DynamicConfiguration) 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; 
Thanks
SaNv...

Similar Messages

  • FTP how to pass dynamic filename/directory location - reading a file in 11g

    Hi All,
    We r using FTP adapter(SOA 11g) for getting files in remote server, May i know how to pass dynamic filename and directory where the file exists for reading in server.
    Thanks,
    Rak

    Hey according to my understanding, the Dynamic partner links are set only for the Outbound invocations only. Is my understanding right? if so, how do we create the dynamic partnerlinks for the ftp get kind of stuff...??
    Thanks in advance

  • Passing EDI filename for 850 from B2B Gateway to BPEL

    Hi,
    Is there any way to pass the EDI filename for 850 from B2B Gateway to BPEL via AQ? we want to store the inbound filename in the database along with the PO.
    we are using 10g.
    Thanks,
    Naveen

    Hi Naveen,
    Generally this could be done using the message id only as mentioned by ew. Just what you need to do is to lookup in the table and find the payload corresponding to that message id.
    However, WORKAROUND would be to use "Preserve Filename" feature of 11g B2B (which works only for FILE,FTP and SFTP transport protocols). In this case you have to pass the filename in the header "ACTION", as mentioned by Nitesh.
    Regards,
    Anuj

  • Passing the structure to rfc function module

    hi,
    iam having a rfc function module which is importing structure.
    i have to pass only one field value to that structure.
    how can i pass that field value to that structure.
    it is very urgent.
    thanks in advance

    Hi..
    You have to Declare the ACTUAL PARAMETER (workarea) with the Same Structure as that of the FORMAL PARAMETER.
    but you can fill only the FIELD that you want pass in the workarea and pass it to the RFC.
    <b>Reward if helpful.</b>

  • Sun Studio 12u1 cc passes empty filename strings to the linker

    Hi,
    Sun Studio 12u1 cc passes empty filename strings to the linker, as demonstrated with the following
    trivial test case.
    This problem occurs while trying to compile the Boost 1.42 beta 1 libraries with Sun Studio 12u1.
    goanna% cat e.c
    int main()
    return 0;
    goanna% cc -V
    cc: Sun C 5.9 SunOS_i386 Patch 124868-11 2009/11/21
    usage: cc [ options] files. Use 'cc -flags' for details
    goanna% cc "e.c" ""
    goanna% kde12u1
    goanna% cc -V
    cc: Sun C 5.10 SunOS_i386 Patch 142363-03 2009/12/03
    usage: cc [ options] files. Use 'cc -flags' for details
    goanna% cc "e.c" ""
    ld: fatal: file : open failed: No such file or directory
    ld: fatal: File processing errors. No output written to a.out
    goanna%
    Thanks, Mark

    Thanks for filing the bug report. It will be visible at [http://bugs.sun.com] in a day or two as bug 6921481.

  • How to pass dynamic filename to Receiver JMS channel

    Hi experts,
    I want to pass the dynamic filename to receiver JMS message Properties.
    for example
    I am passing directory name via adapter module AF_Modules/DynamicConfigurationBean with key and value combination like below. How to pass dynamic filename value to a dynamic property ( say DCJMSMessageProperty1)
    eg.
    key.0 - >insert http://sap.com/xi/XI/System/JMS DCJMSMessageProperty0
    value.0 - >  testdirectory ( which is static value)
    Note: Im have not created any ESR object . i just have to bypass the file to a jms queue. I have used AAE integrated configuration scenario ( file to jms )
    Regards,
    Balaji
    Edited by: Balaji Pichaimuthu on Jan 27, 2011 4:45 PM
    Edited by: Balaji Pichaimuthu on Jan 27, 2011 4:46 PM

    Already given link for the dynamic configuration code snippet in the earlier reply... Below is the code snippet
    Note: Use Adapter Specific Message Attributes for the target Communication Channel(CC).Check the indicator for filename in the advanced tab of CC
    //UDF code
    String filename="";
    String NameSpace = "http:/"+"/sap.com/xi/XI/System/JMS";
    try{
          DynamicConfiguration conf = (DynamicConfiguration) param.get(
            StreamTransformationConstants.DYNAMIC_CONFIGURATION);
          DynamicConfigurationKey key  =  DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File",   "FileName");
           // read filename value
           filename = conf.get(key);     
          // So far we extracted filename value .. now do your logic  something like this...
          DynamicConfigurationKey key2 = DynamicConfigurationKey.create(NameSpace,"yourjmsvalue goes here");
           conf.put(key2,filename);
         } catch(Exception e){

  • How to pass a filename to MQHRF2 header in IBM MQ using JMS Adapter in SAP PI

    Hi Expers,
    Can you please help on ...
    how to pass a filename to MQHRF2 header in IBM MQ using JMS Adapter in SAP PI
    Thanks,
    Chandar

    Hi Chandar,
    Could you check the following post Re: Inserting custom header fields inside MQRFH2 (JMS Receiver adapter)?
    I hope you find it useful.
    Regards!

  • Call ABAP program from Unix script passing dynamic filename

    Hi,
    Does anyone know if it is possible to call an ABAP program from a Unix script passing a dynamic filename to the ABAP program?
    We are receiving a file from an external company and on receipt of the file want to call an ABAP program passing the filename.  The filename is made up of File ID, Date and Time which we need to read in the ABAP program.  We usually use Events to trigger a program which is fine when the filename if static however since this filename will be dynamic we cannot do this.  In addition we cannot just rename the file to a static name in the Unix script as we need to know the value of the date and time from the file ID in the ABAP program.  I can change the ABAP program to check our /in directory for a Filename that starts with the fixed File ID however I thought there must be a better way of doing this.  We want the external company to put this information in a file header record but they don't want to change the file contents.  Any ideas would be appreciated.
    Thanks,
    Sinead.

    You could follow the following method
    1.Let the external file reside in the SAP application layer in a defined path e.g. /usr/sap/tmp/interface/working/
    2.Write an ABAP program which will include the following steps:-
       i) read all files in the file path using function module EPS_GET_DIRECTORY_LISTING
      ii) Read the data from files existing in the directory using OPEN_DATASET statement
    iii) After the files have been read move the files to another directory e.g. /usr/sap/tmp/interface/backup/ or you can delete the file.
    3.Schedule this program to be executed depending on the frequency of the external file being generated.

  • Passing input data to RFC

    I have Date,Name and Telephone number input fields ,once user enter these values i have to pass this input to RFC.
    1) I created three context attributes Date,Name,telephonenumber (both in view and Custom controller)
    2)There is a mapping between view and custom attributes(Date,Name,telephonenumber)
    3)i have imported model
    4) I have set the RFC attributes and input attributes
    public void excuteMMDtestBapi( ){
    wdContext.currentContextElement().setDate(new java.sql.Date(System.currentTimeMillis()));
         //  wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setErdat( wdContext.currentContextElement().getDate());
           wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setErnam(wdContext.
              currentContextElement().getName());
            wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setPhone(wdContext.
                   currentContextElement().getTelephonenumber());
    5) On action of send button i am excuting the method excuteMMDtestBapi();
    i am getting null pointer exception
    any suggestions
    Murali~

    Hi
    in CustomControllers WDInit() method
    public void wdDoInit()
        //@@begin wdDoInit()
         mmdTest = new Z_Bapi_Mmd_Create_Input();
        wdContext.nodeZ_Bapi_Mmd_Create_Input().bind(mmdTest);
        //@@end
    in the following method
    public void excuteMMDtestBapi( )
        //@@begin excuteMMDtestBapi()
        MessageManager msgMgr =
                        (MessageManager) wdThis
                             .wdGetAPI()
                             .getComponent()
                             .getMessageManager();
    wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setErdat( wdContext.currentContextElement().getDate());
           wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setErnam(wdContext.
              currentContextElement().getName());
            wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setPhone(wdContext.
                   currentContextElement().getTelephonenumber());
                    try {
                        this
                             .wdContext
                             .currentZ_Bapi_Mmd_Create_InputElement()
                             .modelObject()
                             .execute();
                   } catch (Exception e) {
                        msgMgr.reportException("Error while executing Bapi:", true);
                   wdContext.nodeOutput().invalidate();
        //@@end
    I am getting null pointer exception when setting date,name and phone number
    i canot set mmdTest.setPhone beacuse
    I have a Bapi Z_Bapi_Mmd_Create in which parameter T_Zmmdvendg in which ERNAM,PHONE,ERDAT Ihave to set each of these values getting userinputted values from webdynpro
    is there i am missing something
    Regards,
    Murali

  • How to passing lowercase values to RFC/BAPI using webdynpro for JAVA

    Hi Exerts,
    When we sending values to RFC/BAPI through webdynpro (JAVA), the values are sent in capital (uppercase) letters to ECC.
    So if we fill xxxx, it is send like XXXX. Why? and how to avoid this?
    Thanks in advance,
    Joeri

    Hi,
    There could be two possibility if you are storing this value in ABAP table.
    1. You are entering value in UPPERCASE in your webdynpro application.
    2. The data stored in ABAP table, converts value in small to upper case.
    1.  Can you tell me how you are passing this value, is user entering value in some input field which is binded to some context and this value are you passing to RFC/BAPI...???
    Or else before passing value to RFC/BAPI you can use toLowerCase string function and the npass this value to RFC/BAPI
    e.g String name = wdContext().currentContextelement().getName().toLowercase();
    Now pass this name to RFC/BAPI is should go as lowercase only..
    This is from webdynpro java side..
    2. If you are storing this value in ABAP table, check the domain/type of variable in ABAP table for which you are storing the value. Ask ABAPper, so that this value are stored in small case letter.
    There is one tick in domain which you need to remove so that it stores in lower case. I dont have exact information but you can consult this with ABAPer.
    Hope this information helps guy ..!!!!
    Regards,
    Jigar

  • Passing a filename for Playsound()?

    Hi!I have to call a function inside a dll for pocket pc 2002 from labview7: the function contains Playsound, in fact I want my pocket pc to play a file.wav, the problem is passing the filename as a parameter..as a CStr?PlaySound doesn't recognize it!
    what's the right way to pass a string/filename for Playsound?
    thank you very much!!!
    Marta

    To call a DLL from your PDA application requires you do what is reported in THIS DOCUMENT. There are several steps to perform to make your code suitable for PPC.
    HERE you will find an example that shows what needs to be done.
    Passing the Filename parameter to the Playsound Function in Winmm.dll is pretty straightforward. Use StdCall conventions and use CString for file name.
    Regards,
    AlessioD

  • HttpURLConnection -- getting error 502 passing ftp url  w embedded password

    I am connecting to http proxy server which supports cern ftp.
    I specify the -DftpProxySet command line options to point java to the http proxy.
    I specify a ftp url like following and it works OK:
    ftp://machine.company.com/readme.txt
    it works fine.
    But when I change the ftp server to require password and pass ftp url such as
    ftp://user:[email protected]/readme.txt. , it fails.
    It works OK when I type above password ftp Url manually into the IE browser that is pointing to same http proxy the java is using.
    Error:
    java.io.IOException: Server returned HTTP response code: 502 for URL: ftp://user:[email protected]/readme.txt
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:562) at com.mycompany....Line 300
    Line 300:
    InputStream stream = connection.getInputStream();

    Hi, I have exactly the same problem!
    Could you solve it?
    Regards, Markus

  • Passing a filename  as parameter in core java?

    Hi All,
    Instead of using a hardcoded filename i want to use a filename as
    parameter so that i can include any file without hardcoding it.For eg,
    Here is my sample code:-
    import java.io.*;
    class ParameterFile
    FileInputStream fin;
    public void open( String source) throws IOException
    fin=new FileInputStream(source); //The filename should be included instead of a hardcoded one.
              BufferedReader br=new BufferedReader(new InputStreamReader(fin));
              String line="";
              while(((line=br.readLine())!=null))
              System.out.println(line);
              fin.close();
    public static void main(String args[])
    try
    File source=new File(args[0]);//passing the filename as commandline argument
    ParameterFile pf=new ParameterFile();
    pf.open(source);
    }catch(IOException ee)
    Here when i run the program i want to pass the filename in commandline argument.Like java ParameterFile Readme.txt.
    Here it is giving an error in pf.source(source)saying cannot resolve symbol.What is the problem here pls. do rectify it.
    Thanx,
    m.ananthu

    public void open( String source) throws IOException <--- you put String type as your parameter in the "open" method.
    File source=new File(args[0]);//passing the
    the filename as commandline argument
    ParameterFile pf=new ParameterFile();
    pf.open(source); <---- but you pass in your parameter using File type...so, java compiler cannot find a method which take File as the parameter.
    try change
    public void open( String source) throws IOException
    to
    public void open(File source) throws IOException

  • Dynamic filenames in RFC to FTP scenario

    Hi all,
    i am working on two interfaces, and have doubts about each of them, here they go:
    - Scenario1: RFCtoFTP --> some info is sent in some fields and i need to use these fields to generate files with the proper filenames (by concateating them or whatever). In addition, depending on the filenames, XI will have to send them to the proper directory in target system.
    Lets say, XI receives and rfc wit two fields: field1 and field2; i´d need to create a file named "field1field2.txt" and send it to the field1 directory.
    - Scenario2: FTPtoRFC --> XI takes a file and creates target fields with the value of several strings that are part of the filename it took.
    Lets say: XI takes a file named "field1field2field3.txt" and maps to three fields of the respective RFC; field1; field2; field3
    I d rather not use BPM if possible.
    Could you please guide me about some steps in order to be able to build there two scenarios?
    best regards,
    David

    Hi Sebin,
    In scenario1, i am receiving a field called FILENAME, and i have created a UDF with your code (and with one input parameter FILENAME:
    public String DynamicConfiguration(String FILENAME,Container container){
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey dck = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String filename = "FILENAME";
    conf.put(dck,filename);
    However when i insert the UDF in the graphical mapping, the function comes with an input and output parameters, i know what to do with the input but no with the output.
    Question is, which is the target field of the output of the UDF??
    In scenario2, May i use the Michal´s UDF?
    public String DynamicConfiguration(Container container){
    DynamicConfiguration conf = (DynamicConfiguration)
    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; 
    I think this would take the filename and later on i could split this name into several target fields.
    Could you please help? i am stuck on this.
    Thanks in advance and best regards,
    david

  • How to pass a filename dynamically in incoming email and process that file

    Hi,
    We have to process an incoming file with XI, the name of which we don't know to design time. The filename is passed dynamically in an incoming email, in the body section. We can parse the filename from the mail already. However, file adapter-sender does not accept variables (whereas receiver does), so we have no way to pass this name to the file-sender.
    What would be the best way to implement this scenario? I'd really appreciate a bit more explanation than 1-liner answers (e.g. links to help.sap.com We have SAP XI 7.0 SP15.
    TIA

    Thanks. This is similar to our plan B That is, using a wildcard, processing all files in the incoming directory, and moving them after processing. This way, only the unprocessed files would be in the source folder. IMHO, it's not elegant.
    Besides, should a second mail get received, before the first file is processed completely (e.g. due to an error, slow FTPS transfer rate, etc.), the second process would try to pick up the first file as well, which would mess up everything.
    There should be a way to set a parameter for the sender-file adapter...

Maybe you are looking for