How to send file to FTP on conditional basis.

Hi SAP Guru's,
Can somebody please tell me how to create a file on conditional basis in FTP.
My requirement is that I have to create a file in different directory according to the sender port field.
Interface
IDOC -
> XI -
> File
SNDPRN(DGE008,DGE006,..............) now I need to create the file according to the SNDPRN field.
Example
SNDPRN (DGE006)----
> Target (DGE006/xyz/abc/filename.xml)
SNDPRN (DGE008)----
> Target(DGE008/xyz/abc/filename.xml)
Also how do I send the data to the specific directory because I only get the SNDPRN(DGE008) from the idoc but how to send the data to /xyz/abc/ directory.
I have tried dynamic configuration but it is not working.
DynamicConfiguration conf = (DynamicConfiguration)
container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
String MyDirName=DirName;
String ourSourceFileName = conf.put(key,MyDirName);
return "";
Error in Adapter Monitoring
Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'Directory' was configured as mandatory element, but was not supplied in the XI Message header
CAN SOMEBODY PLEASE HELP ME.
Edited by: Muhammad  iqbal on Jul 12, 2010 3:04 PM

Off course I did.
I have done the following in Int Rep.
Step 1,
Create an udf for dynamic configuration and mapped it with the MT
DynamicConfiguration conf = (DynamicConfiguration)
container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
String MyDirName=DirName;
conf.put(key,MyDirName);
return "";
Steps in Int Dir
Target Directory: /
File Name: filename.xml
Use Adapter Specific Message Attribute = checked
Fail if Adapter Specific Message Attribute missing = checked
Directory = checked
Error in Adapter Monitoring
Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'Directory' was configured as mandatory element, but was not supplied in the XI Message header
CAN SOMEBODY HELP ME IN THIS MATTER.

Similar Messages

  • How can I send files by FTP with Oracle Portal?

    I want to send some file by FTP.
    How can I send files by FTP with Oracle Portal?
    Any ideas?

    Enrique,
    Are you trying to transfer more content from remote locations to expose as items within a portal page? By itself, the Oracle Portal runs within the context of the database so I'm not sure how FTP at the OS level will help. However, if you're attempting to transfer files from a remote PC to upload within the Portal, here are a couple of suggestions.
    Option 1:
    A. Create a portal page.
    B. Convert a region to Items.
    C. When you're challenged to upload a file from the local OS, ensure you've a drive mapped to your remote location and pick the file to upload into the Oracle9iAS Portal.
    Option 2:
    Alternatively, the Oracle9iAS Portal 9.0.2 supports the WebDAV protocol(Web-based Distributed Authoring and Versioning Protocol) allowing endusers with a WebDAV client to upload content into the Portal seamlessly from their desktop.
    Pls. check out:
    http://portalcenter.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/OTN_CONTENT/MAINPAGE/PUBLISH_CONTMGMT/TECHNOTE_WEBDAV.HTML
    Hope that helps!
    Thanks,
    Sudi Narasimhan
    Oracle9iASPortal Partner Management/Development
    I want to send some file by FTP.
    How can I send files by FTP with Oracle Portal?
    Any ideas?

  • Using wildcards (*) in sender file adapter - FTP type

    Hi guys!
    Dooes it work using wildcards in sender file adapter (FTP type(!) (filesystem obviously work))? I tried it and it failed. it works only for exact name..
    I read some articles about FTP and the result is, that ftp work always only with 1 file, so I'm wondering, if this is possible.
    Thanks for info!
    Olian

    Thanks for all replies..
    I know of course, that * can be used, I use it in many scenarios too. But on a FileSystem. It is not working if the sender type is FTP.
    *, ., *.dat, ...  nothing like that works..  Just exact file name.
    I am able to pick up file, if I specify it's exact name, so there should be no problem with permissions..
    Please, I'd appreciate one reply with comfirmation: yes, we are using asterisk (*) , we access source files via FTP and they are processed.
    Is there anybody with this experience, that it works?
    Thank you!
    Olian

  • How to delete file on ftp server

    hello,how to delete file on ftp server?thank you!

    I was trying to hint to the fact that you gave no where near enough information.
    Have you already written anything? Such as software that will connect to an FTP server?
    Are you using a 3rd party package?
    Are you doing it by hand, using sockets?

  • Not able to send file Using FTP in SSIS 2005

    I am using SSIS 2005
    I am trying to send file to ftp server using FTP task in SSIS but i am getting following error.
    Error Message-:An error occurred in the requested FTP operation.
    Detailed Description-:550 /FileName.txt: Access is denied.
    RemotefilePath is /
    I need a advice.
    Thanks in advance.

    I got this error recently from the FTP task in SSIS:
         Unable to send files using "FTP".
    I had everything correct, by the book.  I was trying to send a file, but I got the same error when trying to receive a file. 
    I already verified that I could send the file via command line FTP, so the FTP was not "secure FTP" (which wouldda required FileZilla or WinSCP or something similar) and my credentials were fine. 
    But I still got the above error.  Heck, I was beginning to thing that the FTP task in SQL Server 2008 was broken and just couldn't send files.
    Well, this issue is now resolved.  The problem was in the
    destination folder.  I was assuming that the root folder for my FTP account held the files. 
    So I entered the destination folder as this:   
    /data_in/
    But... the FTP task sees the root folder as one up from that. 
    So I had to use my account name in the path... meaning I had to change the destination folder to this:    
        /myaccountname/data_in/
        (where "myaccountname" was my login to the FTP site.)
    I hope this post helps someone else.
    Donna

  • How do you change name of the files before sending files to FTP site?

    Hi guys,
    my environment is SQL Server 2008 R2.
    Currently, I'm trying to figure out how to tackle the following project:
    I have over 100 files that I need to send via FTP on daily basis.
    Before doing so, I must change the extension of the file to a specific characters stored in a sql server table, for example if the file name is Store1.txt the new name will be Store1.111
    I was hoping that you guys can point me in the right directions :-)
    Codernater

    I would use a script task for renaming, Pass the data from the SQL table with the extension you want via a object variable to the script task iterate the files in the directory and rename as requried
    this code and link would help you
    http://stackoverflow.com/questions/12347881/renaming-files-in-folder-c-sharp
    DirectoryInfo d = new DirectoryInfo("....");
    FileInfo[] infos = d.GetFiles();
    foreach(FileInfo f in infos)
    File.Move(f.FullName, f.FullName.ToString().Replace("abc_","");
    Abhinav http://bishtabhinav.wordpress.com/

  • Sender File Adapter - FTP

    XI is picking up While File is being written in the Specified Directory. XI uses File adapter ( FTP transport Protocal ) . If file being written is very large ( It may take couple of minutes ) XI picks it up in parts for every 1 minute ( It was configured like that ) and try to send over Which is not correct. Is there any workaround to this issue. In PI 7.0, for NFS file system,  SAP included modification check but it doesn't work for ftp file adpater. Basically XI should wait to pickup file until the file written completely in the Source System.
    Anyone have any Idea how to overcome this issue ?

    Hi,
    You could use the Advanced mode checkbox in the file adapter, to specify the time the adapter has to wait, before it checks if the file has been modified.
    In case, the file has been modified, after the adapter read the file, the data in the adapter cache is discarded and the updated/modified file is taken from the source path specified.
    This would work, only if you have not specified "recordsets per message" during content conversion.
    Regards,
    Smitha.

  • How to send file as attachment and call RFC to trigger event in ECC?

    Hello,
    A file is retrieved from FTP into PI (w/ NO MAPPING required - just pass through) and placed on the ECC appl. Server. Then, a RFC is made to trigger an event to process the file in ECC.  However, a RFC cannot be called in the graphical mapping if there is no mapping required.
    I have seen this Blog, u201CFile to R/3 via ABAP Proxyu201D, http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1847. [original link is broken] [original link is broken] [original link is broken]  But we are told not to touch the file as it will be converted in ECC by a program.
    Also, I read that using ABAP proxy-PI-FTP, I can do a pseudo mapping, simple one node, (just so a RFC can be triggered) and also pass the file as an attachment.  Letu2019s say this works:
    Question 1:  What configuration steps in the FTP adapter that will allow me to u201Calsou201D send the file as an attachment? 
    Question 2: (Continue with ABAP proxy option) How do I control where will it be deposited so that the program can access it?
    Question 3:  If this is not the best approach, how many steps would I need to do it in BPM (i.e. pick up the file from FTP, place it on appl server, and trigger a RFC to call an event to process file)?
    Thanks for any suggestions!
    John_Xi

    I have read those two help file and was able to use it in the ABAP proxy code.  Thanks.
    This is the current outcome.  I totally understand that SAP PI communicates via XML.  So when PI picks up a file that contains XML tags, the Inbound proxy is triggered.  I can see its processing in SM50.  However, when I give the Sender FTP adapter a non-XML file to pick up, the Inbound Proxy does not trigger.  The file itself should be read into memory so that I can save it to the application server via ABAP code (with no mapping).  That is why there is no operation mapping
    The reason I am using using FTP to ABAP proxy is because I need to call a subsequent RFC step to process the file.  Else, I will just use FTP to File Adapter scenario.
    Question 1: I am thinking that that file is the attachment.  Is that where I am incorrect and I still need to send in an XML file with the attachment as an addition?
    Question 2: Is this the best approach or should I use BPM?  If BPM, what steps do I need?

  • How to send file with original name through Mail adapter

    I have to send file with original name as attachment through Mail Adapter. I am picking the file from FTP server through File Adapter. I am not using message mapping because files do not have any standard format.

    Hi,
    Have you solve your problem ?...
    I have exactly the same scenario : pik up a file (file adapter) and send it in attachment by mail adapter without mapping (no IR)...
    I activated Adapter specific paramters properties in the File adapter sender and i can see the FileName tag in DynamicConfiguration section of SoapHeader in SXMB_MONI...
    I want to use MessageTransformationBean... BUT, how can i 'access' to FileName tag ???...
    Thanks...
    I setup modules like this :
    AF_Modules/DynamicConfigurationBean 1
    AF_Modules/MessageTransformBean rename
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean mail
    1 key.0 write http://sap.com/xi/XI/System/File FileName
    1 value.0 message.FileName
    rename Transform.ContentDisposition attachment;filename=message.FileName
    rename Transform.ContentDescription message.FileName
    rename Transform.ContentType application/csv-tab-delimited-table;name=message.FileName
    But my file name attachment is message.FileName....
    Edited by: Emmanuel JORAND on Sep 29, 2008 9:23 PM
    Edited by: Emmanuel JORAND on Sep 29, 2008 10:25 PM

  • How to send File on application server for Attachment

    Hi,
    Friends in my application file is to be sent with Email as an attachment.
    all this to be done via servlet for that i have to send the file to application server from there servlet will send mail via Email server.
    How can send this file to server.
    plz help me .
    Thanks

    Hi,
    The following program illustrates the creation of ifle in app server and reading the file from appli server:
    DATA: ITAB LIKE vbakOCCURS 0 WITH HEADER LINE.
    PARAMETERS: P_VBELN LIKE VBAP-VBELN.
    START-OF-SELECTION.
      SELECT *
        FROM VBAP
        INTO TABLE ITAB
    WHERE VBELN = P_VBELN
        PERFORM WRITE_DATA.
        PERFORM READ_DATA.
    *&      Form  WRITE_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM WRITE_DATA.
    OPEN DATASET 'VBAP_DATA' FOR OUTPUT IN TEXT MODE.
    LOOP AT ITAB.
    TRANSFER ITAB TO 'VBAP_DATA'.
    ENDLOOP.
    CLOSE DATASET 'VBAP_DATA'.
    CLEAR: ITAB, ITAB[].
    ENDFORM.                    " WRITE_DATA
    *&      Form  READ_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM READ_DATA.
    OPEN DATASET 'VBAP_DATA' FOR INPUT IN TEXT MODE.
    DO.
    READ DATASET 'VBAP_DATA' INTO ITAB.
    IF SY-SUBRC <> 0.
    EXIT.
    ENDIF.
    APPEND ITAB.
    ENDDO.
    CLOSE DATASET 'VBAP_DATA'.
    LOOP AT ITAB.
    WRITE:/ ITAB-VBELN,
            ITAB-POSNR.
    ENDLOOP.
    ENDFORM.                    " READ_DATA
    If it is helpful rewards points
    Regards
    Pratap.M

  • Sender File Adapter (FTP Protocol)

    Hi Every Body,
    I have a problem in using Sender File Adapter of (FTP Protocol Type)
    I have given all required settings to get connected to the FTP Server.
    When i give ( Source Directory and Exact File Name ex : MDMERP.xml)
    File gets picked up.
    But When i give (Source Directory and Exact File Name ex : *.xml)
    it gives below exception
    Error occurred while connecting to the FTP server "mdmerp6:21": java.net.ConnectException: Connection refused: connect
    Strange any guess !! :(((
    Regards
    Srinivas

    Hi,
    If that is connection error then it should have not allowed to pick up when i have given the specifif file name ,
    .xml is too not working
    my problem all starts if i use other than file name declarartion it throws error
    of below kind
    Error occurred while connecting to the FTP server "mdxxxp6:21": java.net.ConnectException: Connection refused: connect
    Can i use " Advanced Selection of Source File" and make it run\
    With regards
    Srini

  • SENDER FILE ADAPTER (FTP) ERROR

    Hi,
    Iam getting the following error in sender file adapter:
    Could not process due to error: com.sap.aii.adapter.file.ftp.FTPEx: 550 *** ERROR *** NO BATCHES FOR TRANSMISSION
    Could anyone help me in this.
    Thanks &Regards,
    Kiran

    Hi Kiran,
    This problem is not related to PI but rather related to FTP server settings.
    Try changing the name of the file in your adapter settings to a string without any dots and ".
    Try this and let me know if its successful.
    Regards,
    Divya

  • How to send file as attachment in Email in Oracle UCM

    Hi All,
    I have created a simple html form which executes my custom service( internally calls java method) to send a email "forms data" to the user. I need to send file as attchment in email so how i can do it in oracle ucm.Currently i am using intradoc api.I am using a jquery plugin for sending forms data including uploaded file.
    function which i am using in java for sending emails:-
    InternetFunctions.sendMailTo(emailStr, "MyMail", subject, this.m_service);
    I have set method="post" and enctype="multipart/form-data" in the form
    So plz help to provide a solution to send a file as attchment in email
    Thanks,
    user9018217

    From what I remember, there isn't an "out of the box" solution since InternetFunctions only provides some basic email functions (try decompiling the class to see what's available).
    Here's the link for the original Stellent 10gR3 sample components: http://www.oracle.com/technetwork/middleware/content-management/index-092832.html. Take a look at the AcmeMail component within the HowTo Components sample. It shows how to create a custom idcservice that sends basic emails. You can use that as a baseline for creating your own email service and then use something like JavaMail to implement attachments. That's what I did.
    Good luck, and please award points as necessary.

  • HOW to read file using ftp???

    Hi to all,
    I have problem with reading file using ftp connection, i want to read only 1024 bytes for one time, and i have
    next code wich read this:
    byte buffer[] = new byte[1024];
    while( (readCount = input.read(buffer)) > 0) {
    bos.write(buffer, 0, readCount);
    but I dont know how to put all read data in one byte[] if i dont know length of file.
    I can't do some like: byte file[] = new file[1000000];
    Thanks for all sugestions!

          * Download a file from a FTP server. A FTP URL is generated with the following syntax:
         * <code>ftp://user:password@host:port/filePath;type=i</code>.
          * @param ftpServer FTP server address (incl. optional port ':portNumber').
          * @param user Optional user name to login.
          * @param pwd Optional password for <i>user</i>.
          * @param fileName Name of file to download (with optional preceeding relative path, e.g. one/two/three.txt).
          * @param destination Destination file to save.
         * @throws MalformedURLException, IOException on error.
         public void download(String ftpServer, String user, String pwd, String fileName, File destination) throws MalformedURLException, IOException {
            if (ftpServer != null && fileName != null && destination != null) {
                StringBuffer sb = new StringBuffer("ftp://");
                if (user != null && pwd != null) { //need authentication?
                    sb.append(user);
                    sb.append(':');
                    sb.append(pwd);
                    sb.append('@');
                }//else: anonymous access
                sb.append(ftpServer);
                sb.append('/');
                sb.append(fileName);
                sb.append(";type=i"); //a=ASCII mode, i=image (binary) mode, d= file directory listing
                BufferedInputStream bis = null;
                BufferedOutputStream bos = null;
                try {
                    URL url = new URL(sb.toString());
                    URLConnection urlc = url.openConnection();
                    bis = new BufferedInputStream(urlc.getInputStream());
                    bos = new BufferedOutputStream(new FileOutputStream(destination.getName()));
                    int i;
                    while ((i = bis.read()) != -1) { //read next byte until end of stream
                        bos.write(i);
                    }//next byte
                } finally {
                    if (bis != null) try { bis.close(); } catch (IOException ioe) { /* ignore*/ }
                    if (bos != null) try { bos.close(); } catch (IOException ioe) { /* ignore*/ }
            }//else: input unavailable
        }//download()If you don't want to strore the data into a file, use ByteArrayOutputStream instead of a FileOutputStream.

  • How to download file using ftp in bash script

    Hi! I'm runnig a bash script in solaris i want within the script to dowload file using ftp
    How can i do it?
    Tanks a lot

    hello,evgchech
    please try this way:
    1. In the bash script, try following command:
    ftp -n < ftpcmdfile2 in the ftpcmdfile (which is a file),coding the interactive commands of FTP such as:
    user anonymous  [email protected]
              cd /var/sun/download
              bi
              mget *.*
              bye
         try it and good luck!
    Wang Yu
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

Maybe you are looking for

  • Searching Multiple Articles at Once

    The Platinum Edition of the 7th Edition of Perry's Handbook of Chemical Engineering came on a CD with an Adobe edition with a special  Adobe add-on that allowed searching of multiple articles at once.  This edition of the famous print book played the

  • EP or XI?

    Hi Portal gurus- I am working as technical consultant and would like to learn Enterprise Portal (Developer)..I would like to know abt the future of Portals..how is the demand for portal consultants and how are the projects coming up in portals??? I d

  • Validation for Business place and section for With holding tax

    Dear friends I defined validation for MIRO with respect to Business place and Section code to make mandatory, it is working fine. But in case of F-47 / F-48 and FB60 I defined validation but not working. Please help me in this regard Thanks in advanc

  • Error when trying to view historical versioning

    when I try to see the history of versioning a file versioned by svn this error occurs, and I can not see the history version of sql dev: 2.1 org.tigris.subversion.svnclientadapter.SVNClientException: org.tigris.subversion.javahl.ClientException: svn:

  • Is Photoshop CC able to work with Bridge CS6 or other CS6 applications ?

    Is Photoshop CC or any other CC application able to work with CS6 applications such as Bridge CS6?