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

Similar Messages

  • Rfc to ftp scenario

    Hello,
    I have a problem here. I am trying to get a simple communicationszenario of xi working. So I chose rfc to file. Furthermore I tried the configuration's wizard. He says at the last step that my receiver communication-channel is not configured properly, although I made all the required Inputs. I am using a working ftp server. Do you know where usual mistakes can be made with a ftp server. As you know I am kinda n00b.
    I don't know how to configure that the channel is to write he file in the root of the ftp server, cause I can't leave that field empty. Maybe the reason is that I selected the folder to create wrong. There I said just temp_test\ and did that check on create folder. Could that be the problem (just an idea)?

    Hi,
    I tried it using another ftp server, I have full privileges on it. But the problem isn't solved. The wizard still says configuration channel isn't properly configured.
    Here I try to give you any andjustment I made to the ftp channel:
    Service: the Business System the product is on I was configuriing in design.
    Adaptertyp: File Basis 7.0
    Transport Protokoll: ftp
    MessageProtokoll: File
    Adapter Engine: Integration Server
    Zielverzeichnis: /Test/
    create Folder: checked
    Filenameschema: nothing changed here
    server: servername I have access to
    Port 21
    Dataconnection: passiv
    Connectionsecurity: none
    username and pw
    Connectionmode: permanent
    Transfermode: Binary
    These are all the adjustments I made. I don't see any mistake. As I said above rwb says there are no errors but the wizard says something else.
    thank you.

  • 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

  • RFC to HTTP Scenario, Dynamic URL .... Limitation with 200 Character...

    Hi Experts,
    I am doing an RFC to HTTP Scenario. In which the Target URL is Dynamic and i am passing some values from the input payload.
    The Problem is the Target URL length is around "487" character and the Dynamic configuration property allow to pass an maximum if 200 character to "Target URL".
    How to solve this ...Any way to achive this...
    Regards,
    Jude

    Hello,
    The Problem is the Target URL length is around "487" character and the Dynamic configuration property allow to pass an maximum if 200 character to "Target URL".
    You can check Michal's reply in this thread, http://forums.sdn.sap.com/thread.jspa?messageID=7767169#7767169. There is no official statement from SAP that they will change it.
    What you can do is to use a third-party tool to shorten the URL e.g bit.ly I am unsure though of licensing reasons. Or an alternative is to place the parameters in the HTTP Body, in that way, you can place as much parameters as you like.
    Hope this helps,
    Mark

  • Error in RFC to FTP asynchronous scenario

    Hi Experts,
    I have created RFC to File(FTP) scenario in SAP PI 7.31 AEX(java only) server.
    When I execute RFC in sender SAP server, it gives run-time error(dump) as "call to messaging system failed".
    But it successfully creates text file in target FTP server.
    In message monitoring I found 2 messages for this.
    First has status 'Canceled' with below message log,
    Second message has status as 'Log Version' with no message log and with below message details.
    Please suggest/guide me how to rectify this run-time error.
    Thanks,
    Amit Patil

    Hi Jens,
    I tried your suggestion, but couldn't work.
    But I found 1 doubtful thing which is Quality of Service. It is found as
    Quality of Service
    BE
    in message details of 1st message.
    Also in message content of 1st message it is as
    9/18/2014 1:36:51.053 PM
    Information
    File adapter receiver: processing started; QoS required: BestEffort
    I don't know from where is getting set as 'BE'. It should be 'EO' since my scenario is asysnchronous.
    Please suggest.
    Thanks,
    Amit Patil

  • ABAP mapping split messages and dynamic filename

    Hello,
    i have set up a IDOC to file scenario where the IDOC is split into several files, which works fine. In addition to this it is required to set a dynamic filename out of the ABAP mapping for each file. If only one file is created this works already as well but how do you set the dynamic configuration when the messages are split?
    Regards,
    Andreas
    Edited by: Andreas on Feb 26, 2009 9:09 AM

    you cannot do dynamic configuration for message splits. The below is from SAP help.
    Adapter-Specific Attributes and Multi-Mappings
    In multi-mappings, there are multiple message headers with adapter-specific attributes. The mapping API can only access one message header. This has the following consequences depending on whether there are multiple source or target messages:
    u25CF     1:n Transformation
    If there are multiple target messages, the header for the adapter-specific attributes is copied for each message. This means that you can only create one header for all adapter-specific attributes, and not individual headers.
    u25CF     n:1 Transformation
    This variant is only possible for multi-mappings in integration processes. If there is more than one source message, read-access to the adapter-specific attributes of the various message headers is not possible at runtime.
    u25CF     m:n Transformation
    All afore-mentioned restrictions apply here. Developers can at most write the same adapter-specific attributes for all target messages to the header, without read-access to the attributes of the source messages. m:n transformations are only supported within integration processes.
    What i will suggest is to use BPM to have the message split i.e 1:N mapping and then after that have another mapping 1-1 to have the dynamic configuration

  • 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){

  • Dynamic FileName based on environment

    Hi expert,
    I have a proxy to file scenario in which I create dynamic FileName using an UDF. I'm using UDF because filename must contains date with a particular date format (yyDHHmm).
    My need is to generate file name prefix based on environment, for example:
    In DEV environment FileName must start with T
    In QTY FileName must start with Q
    In Prod FileName must start with G.
    Is possible to catch the environment name in UDF (I think from DynamicConfiguration)?
    Which values I have to test in the IF statement?
    thanks,
    Fabio

    Hi Fabio,
    Is possible using:
    String EnvironmentName = (String) System.getProperty("SAPSYSTEMNAME");
    Then, you can use the IF statement and a Concatenate statement:
    String output = null;
    if (EnvironmentName == 'DEV') {
    output = "D" + Filename;
    } else if (EnvironmentName == 'QAS') {
    output = "Q" + Filename;
    } else if (EnvironmentName == 'PRD') {
    output = "P" + Filename;

  • NO DATAS IN OUTPUT FILE FOR RFC TO FILE SCENARIO

    In RFC to File scenario, I am executing the ABAP program in ECC and generates a empty file in PI server.
    I am getting the error message in SM58 of ECC:
    u2018Bean Z_HR_OUTBOUND_DATA2 not found on host SDNPI1,u2019
    'call FM Z_HR_OUTBOUND_DATA2 to ProgId ECCTOPI_OUTBOUND on host SDNPI1 wit'
    RFc Source code:
    FUNCTION Z_HR_OUTBOUND_DATA2.
    ""Local Interface:
    *"  EXPORTING
    *"     VALUE(FILENAME) TYPE  BBP_ACC_DESCRIPTION-ACC_OBJ_NAME
    *"     VALUE(RETURN) LIKE  BAPIRETURN STRUCTURE  BAPIRETURN
    *"  TABLES
    *"      ITAB10 STRUCTURE  YSTRING1 OPTIONAL
    *"      P_STATUS STRUCTURE  ZHRT0031 OPTIONAL
      DATA : wa_status TYPE zhrt0031,
             wa_itab10 LIKE ITAB10.
    break-point.
      LOOP AT p_status INTO wa_status.
        CONCATENATE wa_status-pernr
                    wa_status-ename
                    wa_status-orgeh
                    wa_status-plans
                    wa_status-persg
                    wa_status-rank
                    wa_status-***
                    wa_status-icnum
                    wa_status-usrid
                    wa_status-dept
                    INTO wa_itab10-str1.
        APPEND wa_itab10 TO itab10.
      ENDLOOP.
    wa_itab10-str1 = 'test'.
    append wa_itab10 to itab10.
    append wa_itab10 to itab10.
        CONCATENATE sy-datum
                    'PYO_EMPDAT.TXT'
                      INTO
                      filename.
    ENDFUNCTION.
    And in the ABAP program the RFC is called like:
    CALL FUNCTION 'Z_HR_OUTBOUND_DATA2'
    in background task destination 'ECCTOPI'
    EXPORTING
      INTERFACE       =
    IMPORTING
       FILENAME        = filename
       return = return
    TABLES
       ITAB10          = itab10
       P_STATUS        = p_status
    When i am testing the standard program STFC_CONNECTION in ECC with the same RFc destination it works fine and creates a o/p file with the datas in it, but if i m executing the other function module it doesnt contain any data it.
    What could be the error? and how to resolve the errors that i am getting in SM58?
    Thanks

    Bean Z_HR_OUTBOUND_DATA2_1 not found on host SDNP1, ProgId =ECCTOPI_OUTB
    Change the case of your Program ID to lower ecctopi similar was the issue in this thread:
    Bean ZFM_MODULE_OUT not found on host <XI_HOST>
    And may be for the same reason even Michal used lower case program ID in his blog.
    Regards,
    Abhishek.

  • Dynamic Filename in Fileadapter

    Hi all,
    I like to use the new feature (SP15) of the "Adapter Specific Message Properties" but with out success. I have read Michaels Blog "XI: The same filename from a sender to a receiver file adapter - SP14" but it give me not a clue how to use these properties during the normal receiver configuration and also the manual is not very clear about it. I have set a Variable with "FileName    message:FileName" (I have tried also "message:File_Name") Than I have used this filename Variable in the field "Filename Schema" like %FileName%. But I allways got this error: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: Unknown message header category 'FileName' for variable 'FileName'.
    What have I missed out here?
    Thankx
    Manfred Schmidt-Voigt

    Hi Manfred,
    The dynamic filename generation concept is as follows.
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Regards,
    Bhavesh

  • Dynamic filename in XI

    Hi,
    In XI SP12 is possible to use dynamic filename? I need to generate a filename in Adapter using the content of an element in message, how I do it?
    thanks.

    Hi Elton,
    The dynamic filename generation concept is as follows.
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Regards,
    Bhavesh

  • Dynamic filename in receiver AS2 adapter in B2B Add-on

    Hello Experts,
    Can you please let me know how we can put dynamic filename in the receiver AS2 adapter for B2B Addon on SAP 7.4.
    Thanks
    Saurabh

    Hi Ryan / Experts,
    Let me explain you in more detail.
    In the receiver AS2 Communication channel, if I keep the Filename field as blank as shown below, then in the Mendelson inbox folder, a file is generated with the name "ASJAVA_DX5" which is my business component name.
    If I fill the filname field for example with "CONTRL", then in the Mendelson inbox folder, a file is generated with the name "CONTRL".
    This is my requirement because, suppose i trigger this interface "first time", a file with static name (ASJAVA_DX5/CONTRL ) would be generated in the inbox folder. If I trigger this interface "second time", since the file already exists with same name, it is not overwritten and I cannot check the output of 2nd trigger . Contents are not overwritten.
    To solve this problem + as a general requirement, I wish to have this name to be dynamic, atleast with date+timestamp.
    Can you please help.

  • Dynamic Filename in BPM process (SOAP with attachm. and PayloadSwapBean)

    Hello together
    I have the following BPM process:
    1. IDoc=>WebServiceRequest
    2. WebServiceResponse (payload) => IDoc
    3. WebServiceResponse (attachment) => File
    XI receivs an IDoc an map it to an WebService. The Webservice is called by XI and we receive the WebServiceResponse including a PDF attachment.
    The challenge is to store the PDF attachment with a dynamic filename from the payload of WebServiceResponse.
    We use the PayloadSwapBean to change the payload to the PDF attachment. But then we are not able to access the required information on the original WebService-XML-Response via variable substitution.
    Is there a solution in the standard or have we to use a custom adapter module?
    Thx
    manuku

    Hi Jayasimha,
    We can do this by "Adapter Specific Message Properties" of ur comunication channels.
    1.If u want to keep the output filename same as input filename, no need to use the UDF. only the 'adapter specific parameters' in both sender n receiver file adapter will do that.
    In case if u want to get the filename inside our mapping we have to create a user defined function
    which will return the filename and map it to one of our XML tags. 2nd point gives solution 4 that:
    2. If u want to generate an output file taking some input from the payload,then u hav to use the UDF.There u hav to populate the name.
    Pretty much.... if you set an attribute from the sender side, for example, you can use a UDF and access the particular attribute sent and use it in the mapping. In another example, where no attributes are sent from the sender, you can still actually set a particular attribute, say a filename derived from the payload, using a UDF, and enable the receiver attribute to use it. That's where the UDFs come in - either to get or set particular adapter specific message attributes.
    This will be a very helpful blog which solves ur query:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    Vinod.

  • Error"SYSTEM Failure" while testing the RFC in SE37  : RFC to JDBC Scenario

    Hi All,
    I am doing RFC to JDBC scenario. When I am testing the RFC in SE37 using the RFC destination created in SM59, I get an error "SYSTEM FAILURE".
    Please suggest.
    Thanks,
    Shyam
    Edited by: Shyam Sreepada on Dec 18, 2007 5:46 PM

    Hi,
    You must run RFC with RFC destination in background mode, I suggest to read following post in order to understand it better.
    Syntax would be:
    CALL FUNCTION func IN BACKGROUND TASK
                       [DESTINATION <your RFC destination>]
                       parameter list
    http://help.sap.com/saphelp_nw04/helpdata/en/8f/53b67ad30be445b0ccc968d69bc6ff/frameset.htm
    If you read it you will find that you can't test it directly from SE37, for this either you need to create dummy ABAP program or another RFC where you will call this RFC with background syntax.
    Regards,
    Gourav
    Reward points if it helps you
    Edited by: Gourav Khare on Dec 18, 2007 6:07 PM

  • Issue in File to RFC to File Scenario with BPM using Block Step

    Hi Everybody,
                           I am doing File to RFC to File Scenario for multiple records using BPM using Block Step. The File Message is getting posted and after that, the message is getting stuck up in the qRFC Monitor (Inbound Queue).
                        After seeing the message in Inbound Queue, I am trying to execute and release the message. But when i execute the LUW, it says " Function module doesnt exist or EXCEPTION raised" in Inbound queue.
    Could somebody suggest me the outcome of this? What does this mean and how to
    release the stuck up message in Queue.
    Thanks and Regards,
    N.Jayanth Kumar

    Hi Rajesh,
                           After going through the blog, i saw the trace messages. It says      
    " The   exception occurred (program: CL_SWF_XI_INBOUND=============CP, include CL_SWF_XI_INBOUND=============CM00F, line: 19)"
    Regards,
    N.Jayanth Kumar

Maybe you are looking for

  • How to develop a search engine in flash cs3

    Hello Friends, I need a small help in developing Search Engine in flash cs3. I am going to develop a search engine in flash. But i dont have any idea on how to do this... so can anyone pls help me out. Any links/steps/code would be really appreciated

  • Collaborative BPM appraoch evaluation

    I am doing Masters dissertation in Collaborative BPM. My research topic is the evaluation of three approached for collaborating BPM across value chain. Explanation of these approaches: Centralise CBPM:  Ownership of Collaborative System is with one C

  • Podcasts in the song list

    Ipod can distinguish between podcasts and songs but seems to list them together under the 'Songs' menu selection. Is there a way to exclude podcasts from the Songs list without creating playlists?

  • BM 3.9 and iChain

    Hi, Is it possible to use an iChain accelerator with NetIdentity authentication to get non-Novell Client users to automatically log on to the BM web authentication page? Thanks

  • Error in binding

    Hi All, I am using standard SAP email task for triggering emails. Am using Multiline element in Email text body of standard task. Binding is automaticaly generated and has errors- 1) Mandatory import element 'E_CDPOS[]' is not (explicitly) provided 2