Counter column in the Receiver file

Hi All,
My requirement -->
Souce is IDOC and target is a file.
In the Receiver file there is one column counter which will indicate the counter for each line...
So the Receiver file should be like this
FHEAD,0001
THEAD,00002,00001,20081103
TDETL,0003,0001,A,777,23456789
TDETL,0004,0002,M,881,45333333
TTAIL,0005
THEAD,0006,00002,20081103
TDETL,0007,0001,A,777,23456789
TDETL,0008,0002,M,881,45333333
TDETL,0009,0003,M,381,4533677
TTAIL,0010
FTAIL,0011
The problem is when i map with the source and use counter for the second column, i am getting the counters different, this is due to the condition on the node level, because if 10 idocs come the file may need only 5 based on condition. but since source occurence is 10 the counter cannot give correct values in the file as required,
Please suggest the best way to handle this..
Regards,
Sridhar Reddy

Hi,
>>this is due to the condition on the node level, because if 10 idocs come the file may need only 5 based on condition. but since source occurence is 10 the counter cannot give correct values in the file as required,
As far as i understand the question, you need the 5 Idocs based on condition and then you want to give the counter 1 to 5. Right ?
If this is the case just use one more additional parameter for counting the occurence when some Idoc come just increment it.
Like if you are using X variable for counting Idocs earlier n i think you are using that variable only for assigning count for filtered Idocs. or may be you are checking some condition and thats why that output for count is coming wrong. Use another variable and then increment that variable and assign that variable value to desired place.
Regards
Aashish Sinha

Similar Messages

  • Repeating structure through the receiver file adapter

    I wanted to ask wheter it is possible to create repeating structure through the SAP xi receiver file adapter. What I'm trying to accomplish is this:
    Item1
    Item2
    Item1
    Item2
    (variable number of times).
    I can accomplish the following:
    Item1
    Item1
    Item2
    Item2
    What I could do is have the Item1 and Item2 fields in the same segment in the design time, but this would mean the file adapter would write all the items on a single line instead of two.
    There is no way to define line breaks between the the receiver file adapter field parameters ?
    There is no way to support nested structures in the recordset definition ie. Item1.Item2 ?

    Henri,
    What Vishal means is following:
    Add sequences of the tag <recordset> between pairs of item1, item2:
    <documentName>
       <<b>recordset</b>>
         <item1>
           <field-item1>column-value</field-item1>
           <field-item1>column-value</field-item1>
           <field-item1>column-value</field-item1>
         </item1>
         <item2>
           <field-item2>column-value</field-item2>
           <field-item2>column-value</field-item2>
           <field-item2>column-value</field-item2>
         </item2>
       </<b>recordset</b>>
       <<b>recordset</b>>
         <item1>
           <field-item1>column-value</field-item1>
           <field-item1>column-value</field-item1>
           <field-item1>column-value</field-item1>
         </item1>
         <item2>
           <field-item2>column-value</field-item2>
           <field-item2>column-value</field-item2>
           <field-item2>column-value</field-item2>
         </item2>
       </<b>recordset</b>>
    </documentName>
    A similar problem with header and items is in this thread:
    Repeating structure through the receiver file adapter
    Hope that helps,
    Stefan

  • How to create an Excel file from XML in the Receiver File Adapter Comm Ch

    How do I create an Excel file from XML in the Receiver File Adapter Communication Channel? I have my mapping done and I am outputting the file as a comma delimited csv file. However, the target can only process an Excel file (.xls). How can I generate an Excel in XI?
    I saw this blog, but I don't know how to create a XSLT transformation.
    /people/michal.krawczyk2/blog/2005/12/10/xi-generating-excel-files-without-the-java-nor-the-conversion-agent-not-possible
    Any help would be appreciated. Thanks.

    Here are the steps I took to create an XSLT transformation in XI 3.0:
    1. I created my source and target XSDs using XMLSpy.
    2. I created the XSLT mapping from source to target in XMLSpy (referencing the souce XSD schema).
    3. I created another XSLT mapping to format the target into Excel XML.
    4. Import the source and target XSDs in the IR's External Definitions
    5. Zip each XSLT mapping (.xls) and import it into the IR's Imported Archives
    6. Reference the XSL mappings in the Interface Mapping

  • Need to get the Mail attachment name as it is to the receiver file adapter

    I am doing a Mail to File scenario. I need to get the attachment from the mail and store it on the file server. I am using the PayloadSwap bean in the sender mail adapter. My requirement is to carry forward the attachement name as it is to the receiver file adapter side and store the file with the same name.
    Did any one try doing this? I was looking at developing an adapter module but got struck as I could not find whether the attachement name is stored in the XI payload after it has got swapped using the swap bean.
    Any help would be appreciated.
    VJ

    Oops pressed the send key. Take two.
    This is becoming a damn nightmare. When I run the adapter I am getting ModuleExceptions. Can you pass your eyes over these Java config settings to see what I am doing wrong. Using NWDS CE 7.1 with PI 7.1 both at SP07. All the imports were taken from PI 7.1 after SP07 was applied. The build id of NWDS is
    SAP NetWeaver Developer Studio
    SAP NetWeaver 7.1 Composition Environment SP07 PAT0001
    Build id: 200901152336
    APPLICATION.XML
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
    "http://java.sun.com/dtd/application_1_3.dtd">
    <application>
    <display-name>MailPOP_EAR</display-name>
    <description>EAR description</description>
    <module>
    <ejb>MailPOP_EJB.jar</ejb>
    </module>
    </application>
    APPLICATION-J2EE-ENGINE.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
    <application-j2ee-engine>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="service">engine.security.facade</reference-target>
    </reference>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="library">engine.j2ee14.facade</reference-target>
    </reference>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="service">com.sap.aii.af.svc.facade</reference-target>
    </reference>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="interface">com.sap.aii.af.ifc.facade</reference-target>
    </reference>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="library">com.sap.aii.af.lib.facade</reference-target>
    </reference>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="library">com.sap.base.technology.facade</reference-target>
    </reference>
    <fail-over-enable mode="disable" />
    </application-j2ee-engine>
    EJB-J2EE-ENGINE.XML
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">
    <ejb-j2ee-engine>
    <enterprise-beans>
    <enterprise-bean>
    <ejb-name>GetMailAttachment</ejb-name>
    <jndi-name>GetMailAttachment</jndi-name>
    <session-props/>
    </enterprise-bean>
    </enterprise-beans>
    </ejb-j2ee-engine>
    EJB-JAR.XML
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    2.0//EN"
    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <description>EJB JAR description</description>
    <display-name>EJB JAR</display-name>
    <enterprise-beans>
    <session>
    <ejb-name>GetMailAttachment</ejb-name>
    <home>com.sap.aii.af.lib.mp.module.ModuleHome</home>
    <remote>com.sap.aii.af.lib.mp.module.ModuleRemote</remote>
    <local-home>com.sap.aii.af.lib.mp.module.ModuleLocalHome</local-home>
    <local>com.sap.aii.af.lib.mp.module.ModuleLocal</local>
    <ejb-class>sample.GetMailAttachment</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    SENDER MAIL ADAPTER modules
    1 AF_Modules/PayloadSwapBean Local EB 1
    2 GetMailAttachment Local EB 2
    3 sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local EB 3
    1     swap.keyName          payload-name
    1     swap.keyValue          MailAttachment-1
    RECEIVER FILE MODULES
    1     localejbs/AF_Modules/DynamicConfigurationBean     Local Enterprise Bean     1
    2     localejbs/CallSapAdapter                    Local Enterprise Bean     2
    1     key.0          write http://sap.com/xi/XI/System/File FileName
    1     value.0          message.interface
    VARIABLE FILENAME SUBST WITH ASMA TURNED ON
    fName     message:interface_name
    JAVA SOURCE
    package sample;
    import javax.ejb.CreateException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import com.sap.aii.af.lib.mp.module.Module;
    import com.sap.aii.af.lib.mp.module.ModuleContext;
    import com.sap.aii.af.lib.mp.module.ModuleData;
    import com.sap.aii.af.lib.mp.module.ModuleException;
    import com.sap.engine.interfaces.messaging.api.Message;
    import com.sap.engine.interfaces.messaging.api.MessagePropertyKey;
    import com.sap.engine.interfaces.messaging.api.TextPayload;
    import com.sap.engine.interfaces.messaging.api.XMLPayload;
    import com.sap.aii.af.service.cpa.Channel;
    @ejbHome <{com.sap.aii.af.lib.mp.module.ModuleHome}>
    @ejbLocal <{com.sap.aii.af.lib.mp.module.ModuleLocal}>
    @ejbLocalHome <{com.sap.aii.af.lib.mp.module.ModuleLocalHome}>
    @ejbRemote <{com.sap.aii.af.lib.mp.module.ModuleRemote}>
    @stateless
    <code>GetMailAttachment</code>
    @SuppressWarnings("unused")
    public class GetMailAttachment implements SessionBean, Module {
         private static final long serialVersionUID = 7612238514043673502L;
         private SessionContext myContext;
         private MessagePropertyKey myFileName;
         public void ejbRemove() {
         public void ejbActivate() {
         public void ejbPassivate() {
         public void setSessionContext(SessionContext context) {
              myContext = context;
    @throws CreateException
         public void ejbCreate() throws CreateException {
         public void getMessageProperty(MessagePropertyKey FileName) {
              myFileName = FileName;
    @param moduleContext
               Contains data of the module processor that might be important
               for the module implementation such as current channel ID
    @param inputModuleData
               Contains the input XI message as principal data plus eventual
               set supplemental data
    @return ModuleData Contains the (changed) output XI message. Might be the
            response message if the module is the last in the chain.
    @exception ModuleException
                   Describes the cause of the exception and indicates whether
                   an retry is sensible or not.
         @SuppressWarnings("deprecation")
         public ModuleData process(ModuleContext moduleContext,
                   ModuleData inputModuleData) throws ModuleException {
              try {
                   Message msg = (Message) inputModuleData.getPrincipalData();
                   TextPayload payload = msg.getDocument();
                   String contentType = payload.getContentType();
                   // Content Type could be something like
                   // text/plain;charset="UTF-8";name="file.txt"
                   contentType = contentType.replaceAll("\"", "");
                   int i = contentType.lastIndexOf("=") + 1;
                   String fileName = contentType.substring(i);
                   msg.setMessageProperty(myFileName, fileName);
                   inputModuleData.setPrincipalData(msg);
              } catch (Exception e) {
              return inputModuleData;
    JAVA ERRORS
    2009-02-04 11:41:14     Information     Mail: calling the module processor for channel LMK_Common_Mail_Sender
    2009-02-04 11:41:14     Information     Swap: swapping by payload-name ? MailAttachment-1
    2009-02-04 11:41:14     Information     Swap: successfully swapped
    2009-02-04 11:41:14     Information     Mail: message leaving the adapter (call)
    2009-02-04 11:41:14     Information     The application tries to send an XI message asynchronously using connection AFW.
    2009-02-04 11:41:14     Information     Backward validation is enabled
    2009-02-04 11:41:14     Error     Unable to validate the message with message ID 8702df71-f254-11dd-9b9b-001a64a73518
    2009-02-04 11:41:14     Error     Returning to application. Exception: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Content is not allowed in prolog.
    2009-02-04 11:41:14     Error     Mail: error occured: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Content is not allowed in prolog.
    2009-02-04 11:41:14     Error     Mail: error occured: com.sap.aii.af.lib.mp.module.ModuleException

  • How to populate the fieldnames in the receiver file

    HI All,
    i got one requirement ie how to populate the fieldnames in the receiver file.
    please give the fast response.
    This is very urgent.
    thanks and regards
    sai

    Hi,
    Refer the below help link
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    If you want to poulate the fieldnames same as of u r XML strucutue in the receiver file give like
    Record.addHeaderLine --- 1
    If you want to populate Header FieldNames as you own, give like
    Record.addHeaderLine --- 3 and add one more parameter
    Record.headerLine -- give the field names how you want to populate by using the  , 'comma' separator.
    Cheers
    Veera

  • FCC Parameters are required in the Receiver  File Adapter

    Hi ,
       Sorry for posting this  question again.. my  Structure is
    MT_CADVICE_STRING
    .     .  Batach -
    1:Unbounded (Node)
    .     .      .Header_String -
    1:1       
    .     .      .Line_Item       -
    1:Unbounded  (Node)
    .     .      .      .LineItem_String -
    1:1 
    for this structure  I'm geting data in the XML format.. .. my scenario is simple File to File scenario.. now i want to convert this XML to  a normal Text file  by using FCC in the Receiver file adapter..
    and in the Receiver side   i want the file in the bellow  format:  (each field i want to get in the separate line  but at presnt I'm getting the continution of all lines I'm not getting the data in a separate lines..)
    Header_string  
    LineItem_String
    LineItem_String
    Header_String
    LineItem_String
    so, any abody  can help on this...
    And in the Receiver Communication channel i keep the FCC parameters like  as bellow :
    RecordsetStructure : Batch,LineItem
    Batch.fieldSeparator:  'nl'
    LineItem.fieldSeparator: 'nl'
    Batch.endSeparator:  'nl'
    LineItem.endSeparator: 'nl'
    For more information.. My source file is like bellow
      <?xml version="1.0" encoding="utf-8" ?>
    - <nr1:MT_CADVICE_STRING xmlns:nr1="urn:Test.com:SD:CAdvice">
    - <Batch>
      <Header_String>1 B 1110300014200804108218 36892.80 03 10.000 10.000 0.00 0.00 008000021720080410558000.00 91958.40 649958.40 0.00 649958.40 2678.40 1000003461100000346110000034611000003461123456 18 18 0.00 $</Header_String>
    - <LineItem>
      <LineItem_String>2 B 1110300014 1 000000000001234567000000000001 5.000 0.00 45000.00 10800.00.00 16.00 279000.00 0.00 rcl/ML0080200804100000000357 200804100.00 01 02 000000002.00 860.13321.00 $</LineItem_String>
      </LineItem>
    - <LineItem>
      <LineItem_String>2 B 1110300014 2 000000000001234567000000000001 5.000 0.00 45000.00 10800.00.00 16.00 279000.00 0.00 rcl/ML0080200804100000000357 200804100.00 01 02 000000002.00 860.13321.00 $</LineItem_String>
      </LineItem>
      </Batch>
      </nr1:MT_CADVICE_STRING >
    Regards
    Jain

    Hi jain
    Provide as below definitely it will work,
    RecordSet Structure :  batch,Line_Item,LineItem_String
    batch.fieldSeparator        ---      'nl'
    Line_Item.fieldSeparator  -
         'nl'
    LineItem_String.fieldSeparator  ---   'nl'
    All your fields will come in a separate line.
    Regards,
    Sasi
    Edited by: sasitharan on Jul 28, 2008 11:36 AM

  • How to SQL*loader to skip some columns from the source file?

    I am using oracle9i sqlldr to load some .csv files into db.
    If I want to skip the first two columns in the source file, can I do that?
    If yes, how should I specify it in the ctl file?
    Thanks
    Wendy

    Hello Dave,
    Here is a sample of what you'll need to have in your control fileLOAD DATA
    APPEND
    INTO TABLE <target_table>
    FIELDS TERMINATED BY ','
    ( column_1  FILLER
    , column_2
    , column_3
    , column_4  FILLER
    )Hope this helps,
    Luke

  • Archiving files in the Receiver File Adapter

    Hi All,
    I am trying to archive the file created in the Receiver File adapter. Reading from the link below,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    I gave the command cp %F <target dir> in the Command Line of "Run Operating System Command After Message Processing". As well as I tried cmd.exe copy %f <target file>
    But it does not work. Can anyone please help me out?
    Thanks
    Shivanjali

    Hi Aamir,
    For my case its not feasible to make a bat file...
    I want to write a direct OS command in adapter only.
    Do you know what is the basic difference for running OS command before processing and after processing.
    In my opinion if i use a OS command after file processing then it ll take a file name with timestamp so there may be a problem...
    thanks
    Shivanjali

  • To set a dropdown list for one column in the excel file before downloading

    Hi all,
    I am downloading an excel file which has the format of an internal table with a number of fields. I want to set a dropdown list for one column in the excel file. How can i do this?
    Thanks

    HI ,
    U can use function module " QINT_GET_EXCEL_DATA " ....
    and modify the excel sheet based on ur requirement ......
    Try this ...
    Hope it works
    Thanks
    Shambhu

  • Configuring the Receiver File/FTP Adapter !!

    Hi
    I am trying to configure the Receiver file adapter using the J2SE adapter engine(Please note , NOT the J2EE adapter engine).I see a prerequisite for configuring as below
    "The address (HTTP port and URL) where the adapter can be contacted from the Integration Engine".
    What values are to be specified and how can they be validated ?
    I could see an example given in the Docs saying below,
    If i specify , say for example,
    "XI.httpPort=1234 and
    XI.httpService=/file/Receiver, the end point address of the file/FTP adapter in the Integration Engine must be specified as follows:
    http://<fileadapterhost>:1234/file/Receiver"
    Can anyone explain what exactly is this endpoint address and where should it be specified/referred to ?
    Thanks
    Saravana

    Hi,
    "http://<fileadapterhost>:1234/file/Receiver"
    this adress refers to an end point with the end point type "xi-connectivity" in the integration directory (ID)which refers to the settings in the file adapter (httpPort=1234 and XI.httpService=/file/Receiver)
    1. you specify these adress in the file adapter (outbound)
    2. you refer to these adress in the ID (Receiver System End points)
    every file adapter should have an own port, because you can not specify two identical ports in two fileadapters.
    hope I could help you,
    michele
    Message was edited by: Michele Mangieri
    Message was edited by: Michele Mangieri

  • Is it possible to get a count of all the class files in a Flash Builder project?

    Is it possible to get a count of all the class files in a Flash Builder project?
    Thanks!

    Resultsets are one per connection unless you have copied them. Do you have lots of connections are you properly reusing them or at least closing and discarding all references?
    See tutorial and Javadoc of API too

  • Email attachment name in sender mail adapter to the receiver file adapter

    HI ,
    Ths is regarding email to file scenario. I am trying to create file (in rceiver file adapter) with the same name as the email attachment that i read from mail sender adapter. I want ro use adapter module for this. I could find from blogs that there is module - GetAttachmentName - available that i can use for this in sender mail adapter.
    Can you please let me know what whetehr i neeed to mention any module key and parameters for this.
    I assume , i need to do following steps :Please confirm.
    1. i can use this module - after payload swap module and before standard mail adapter module in sender mail adapter
    2. select ASMA option in advanced tab in sender mail adapter
    3. In receiver file adapter select ASMA option in advanced tab in sender mail adapter
    4. Also select file name option in ASMA in sender mail adapter
    Thanks,
    Vamsi

    Hi Vamsi,
    your scenario is also described here: Re: sender mail adapter - attachment name
    If you use the Module getAttachmentName, which is described here,
    http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0GetAttachmentName
    your scenario should work as you described it.
    You just need to make sure that the Attachment Name that you read in the first place, is mapped to the Filename Attribute of the
    Fileadapter (http://sap.com/xi/XI/System/File/FileName).
    regards,
    Daniel

  • Module config : XML2PLAIN in the receiver file adapter :

    Hi All,
    I am facing a problem in using the Module XML2PLAIN in the receiver comm channel configuration.
    I am using the same parameters in the another receiver and is working fine,but when I use it another on eit is not working.(and is working fine if I download XML directly).But in the normal format file is getting downloaded with nothing in it .
    I could see some special characters(2 = no of fields) in notepad ,which converts to space in wordpad
    The parameters which I am using is .
    The module I am using is  XML2PLAIN
    Par name                     par value
    Tran.class                       com.sap.aii.messaging.adapter.Conversion
    Trav.con type                      text/plain;charset=utf-8
    Xml.addheaderline                     0
    Xml.conversiontype                   SIMPLEXML2PLAIN
    XML.FIELDFIXEDLENGTHS          25,6
    XML.FIXEDLENGTHTOOSHORTHANDLING  CUT
    Cam some one please help me out from this ..what am I missing in this ?
    Thanks.

    Hi Raju,
    Guess this can help u
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
    **Reward points if helpfull**

  • Can we archive files using the receiver file channel

    Dear all,
    I'm looking for a option, where in I want to archive the files being sent to the target system.
    Do we have that facility in XI Receiver File communication channel.
    Can the same be achieved for JMS Receiver channel.
    Kindly give your comments or responses.
    Regards,
    Younus

    Hi,
    AFAIK only the sender file adapter has such a functionality.
    A workaround would be to send the file to a second receiver (for example a archive directory on your PI server).
    Regards
    Patrick

  • Set columns in the "Open file..." Finder window

    Hi,
    When selecting "Open File..." from the File menu in all my apps, the Finder opens a window with the columns:
    Name - Date Added - Kind - Size
    I just want to change the column Date Added to Date Modified. I have done it for my Finder windows in Finder options, but i does not work in the "Open File..." finder window...  and it's pretty annoying for me!
    Thanks for any help.

    Try going to your Home folder, bring up the Finder's view options, select Date Modified and click on Use As Defaults button.  All of of my Open windows display the Modified Date as the only date.

Maybe you are looking for

  • JRE 1.5 VS. JRE 1.6 - Could not convert socket to TLS

    I have an applet that is trying to send an email through an SMTP server. It works just fine 1.6 but on 1.5 it blows up and I'm kind of at the end of my rope. Any help here would be great. I've had to set up the DummySSLSocketFactory as described in t

  • OnClick problems

    I'm having problems with this simple script that exports layer as images named after the layer name. The problem is the UI; I can't get the buttons to work properly. Either the cancel and ok buttons don't work or they both process the images. All or

  • Loading all classes on classpath

    Hello! I'm trying to create some kind of "Package browser" which I can use for selecting a class that exists on the classpath. I've come up with a solution that reads the classpath property and then looks up the classes by searching each directory an

  • Shrinking a graphic from left to right

    I am trying to transform a photo from 100% to 0% (which I will want it to do slowly to reveal another photo underneath) and only the width and not the height to decrease which I know how to do but instead of both sides of the photo shrinking to the c

  • Pulse ON/OFF - digital outputs

    I have this application where I need to turn ON a digital output for like 50ms or 100ms and turn it OFF. I call it Pulse COntrol Here is an attachment jpg that shows how I am achieving it. Another question if I may regarding loop timing. I have a whi