How to customize the File Adapter to put the header line in a variable?

I have a file in which the first line contains the number of records contained by the file itself.
Like this:
4
record1
record2
record3
record4
where each record is a delimited list of values
I need to validate that the records are actually 4.
in the documentation of the File Adapter I see that you can declare the first line as "header", but I have the impression that in this case it would be simply ignored, and not stored in a variable for later use......
Is this correct?
Any trick or workaround?
thank you soooo much!

it worked like a charm,
here is the XSD I have used:
http://www.javamonamour.org/2010/12/soa-sutie-file-adapter-parsing-complex.html
( I don't seem to be able to display correctly XML in this post :o( )

Similar Messages

  • The file adapter takes also the mark of the beginning of the file as a char

    Hi guys,
    I need to use the file adapter for sending data into XI.
    My first column of the CSV file contain ID of the objects of length 8 chars. But when the adapter takes also the beginning of the file, the length starts to be 9 chars.
    How is it possible to disallow to take this mark?
    I didn't find any parameter in the file adapter settings, which could solve this problem.
    Thanx for answer! (Points guaranteed )
    Peter

    Hi Peter,
             While configuring sender file adapter, you can do the following.
           1. While defining Parameters for Recordset Structures , you can make use of the recordsetstrucure.beginSeparator function which will take the first string in the file as a begin seperator.
      i guess this would help you.
    regards,
    Aravindh.

  • File Adapter Not picking the files

    Hi All,
    We have a process wherein the file adapter picks up the file from a particular location and it processed thereafter. We get the files once every month. We noticed that if the files that are being dazzled are of the same, i.e if the same nomenclature is there for the file that was dazzled the previous month, the adapter does not pick up the file. Only after renaming the file, it picks the file and processed them.
    Any idea why the files that are dazzled with the same name are not being picked up.
    Thanks in Advance...!!

    Hi,
    While configuring file adapter to pick up the files cross verify with file name putting in the directory location against the
    "Includes files with name pattern" "Excludes file with name pattern" file name..
    let say if u kept .*txt if picks the files txt with any name and one more think once after picking up the file from particular location are u enabling (delete file once read) option in configuration(It all depends on ur req)..
    cross check the schema element of the file pattern.

  • How to know when File Adapter is complete when debatching?

    I have a BPEL process that reads in a file and debatches it into records of 1 and inserts them into a table.
    How do I know when the entire process is complete and all records in the file have been handled?

    Thats the problem with the file adapter. If you use it in debatch mode, you cannot really control the different BPEL processes that get spawned off one file.
    The other approach for scenarios where the file is huge, could be to use the adapter in notification mode. So the file adapter will notify the BPEL process, that the file is available, and then BPEL process can read the file using xpath functions or java code etc.
    Hope this helps.
    -@

  • Scheduling the file adapter

    Hi,
    i know that file adapter can't be schedualed, however my customer want to send me a message that a file has arrived and only then to wake XI to proccess it.
    I don't want to use BPM.
    Any thought of a workaround?

    Hi,
    I guess I have been seeing many requirements for 'scheduling XI messages' especially 'adapter-level scheduling'.
    'Adapter-level scheduling' ability is not currently available in SAP NW XI.
    What you can do is, make use of the 'Event-driven message processing' feature of SAP NW XI. What it means is, the adapter would pick up the message and it will be held in the XI pipeline for 'delayed message processing'. Then from the central scheduler you can send a trigger to XI to process the message.
    Here is a recorded Presentation on this topic:
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/fd89cdb5-0b01-0010-6289-ac0ad1ccc5c0
    Here is a recorded Demo on how this can be configured using 'SAP Central Job Scheduling by Redwood' (any other central scheduler that is certified for BC-XBP can also be used):
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c0cfd2b5-0b01-0010-a8bd-c140d07d310c
    The recordings are available in the following Job Scheduling page (SDN -> SAP NetWeaver -> Plantform & Operations -> Administration -> SAP NW Central Job Scheduling by Redwood)
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/abb91c2a-0b01-0010-6ca6-9f0f62268454#idawk5oe [original link is broken]
    In the future you can expect something along the lines of 'a maintenance window at the Adapter/Channel level'. If and when this is made available, it may be possible to activate/deactivate the file adapter (i.e., the communication channel) from the central scheduler.
    Hope it is helpful.
    Thanks,
    Venky Varadadesigan
    Product Manager
    SAP NetWeaver
    M +1/832-287-2135
    mailto:[email protected]
    http://www.sap.com

  • Restricting the File adapter to pick up only a part of the payload

    Hi ,
    I have a csv file like below,
    $H$,Header1, xyz, xyz
    $H$,Header2, xyz, xyz
    $H$,Header3, xyz, xyz
    $D$,Detail1,xyz,xyz
    $D$,Detail2,xyz,xyz
    $D$,Detail3,xyz,xyz
    Header and Details links have no link to each other!!! I just wanted to check if at all it is possible for the file adapter to skip the header llines and take only the detail lines.
    Does this require any tweaking in the nxsd that is generated??
    Any light on this would help... :)

    Hi Anuradha,
      Could you please kindly provide answers to the queries below so that forum members can have a clear picture of your requirement
    1. What is the operating system of your PI server?
    2. What is the version of PI you are working on?
    3. What exactly do you mean by statement " I want the adapter to pick only one file at a time rather than picking all the available files in the system."  since adapter will actually pick up files one by one only in each polling interval. This goes in PI pipeline
    one after another in quick succession.
    4. Do you mean that you want to insert delays between successive file pick up then Baskar has already answered your question.
    5. Do you want the channel to pick up only one file in a day out of all possible file?
    6. Could you please kindly provide any sample file name you are receiving in PI ?
    regards
    Anupam

  • Security issues when using the file adapter

    I want to use the file adapter, and in the documentation it states that you can use "directories" and "ftp".
    I want to transfer a file secure and both of these options are not really secure.
    Directory reading is not really secure when you read files from a windows share (SMB protocol).
    Is it possible to make a share more secure in a windows environment?
    In an ftp session everybody can steal the password. Is there a possibility to use "sftp"? Or will this be available?

    Currently we dont have, but we will have it soon.

  • How to start a BPEL Process using the File Adapter

    Hi
    I would like to automatically start a BPEL Process when I store a file in a specific directory. Can this be done using the File Adapter?.
    Regards,
    Néstor Boscán

    Yes, there are samples of how to do this in the BPEL samples directory.

  • How can i pass the name of the file polled by the file adapter to next step

    Hi XI guru's ,
    How can i pass the name of the file polled by the file adapter to next step in a BPM..?
    regards,

    Use Adapter-Specific Message Attributes and map that value in udf to the BPM message.
    Also see this
    /people/michal.krawczyk2/blog/2005/06/11/xi-how-to-retrieve-messageid-from-a-bpm
    Regards,
    Prateek

  • How to sent importet RAW files into the cloud? The files was importet from Canon EOS via camera adapter to the iPad. The Files was stored in the folder importet. But the files does not sync with photostream.

    How to sent importet RAW files into the cloud? The files was importet from Canon EOS via camera adapter to the iPad. The Files was stored in the folder importet. But the files does not sync with photostream.

    Welcome to the Apple community.
    Only photos taken on the iOS device and after photo stream was enabled will be added to photo stream.

  • How can i stop the Action Wizard from putting the original file into the Source folder with my changed documents?

    How can i stop the Action Wizard from putting the original file into the Source folder with my changed documents?

    [discussion moved to Creating, Editing & Exporting PDFs forum]

  • How can I read different files in the file adapter

    Hi,
    I have a scenario like file(content conversion and FTP) to Proxy and need to read 2 files which have different structures.
    The file structures is as follows.
    FileA.txt
    EMPID, Designtion,code,DOB,dept,deptID and 13 fields etc..
    FileB.txt
    officercode, dept,workspecs,FLAGarm,FLAGfoot and 27 fields etc.
    Both files needs to be read by the file adapter at same time and should send to the proxy to feed in ECC.
    Please help me in designing the above scenario with or without BPM.
    Thanks
    Manmadha

    Hello,
    Since u want to combine the two files from sender , you need to use BPM for it.
    First of all create Mapping. In your mapping program go to messages tab and add the two source messages types and in the target add the target message type. Come to your design tab and design the mappings.
    BPM:
    -- Insert Fork with two branches necessary condition. In first branch insert Receive step and check start process checkbox.
    --In second branch insert Receive step and check start process checkbox.
    -- Insert Transformation step after Fork branch step.
    -- Insert Send step [the outcome of transformation step needs to be send]
    Design the above structure, if you have any doubts, dp reply back.
    Best regards,
    raj.

  • How to activate the File Adapter

    Hi All,
       There is a strange problem that i am faceing now.
    I am using a file adapter to push and pull the file. The problem is just before two days the file adapter was working fine but as the location for the file pushing(file location) was not correct , so it went in the HOLD status. I just cancle the queue to make it clear and then re processed the file .
    The starange thing is that it is now not picking of the file , when checked the adapter monitoring, i found that the file adapter is in grey status saying "inactive Led : Component status is not defined "
      So also i dont found any item (communication channel) for file adapter.
    Any idea from your side will be a great help for me.
    Thanks in advance.
    JAY.

    Hi,
    When you activate or deactivate the adapter, then its corresponding services in the J2EE engine become active and inactive.
    If possible try to manually activate it. Or try to do some changes in your channel and activate it.
    If still this problem persist, do full adapter cache refresh.
    And finally restart J2EE engine if possible.
    Thanks
    Farooq
    Edited by: Farooq Farooqui on Aug 25, 2008 4:01 PM

  • Can I use a schema with no targetnamespace with the file adapter?

    I am loading a file using a file adapter configured to use an xsd from a third party, the third party controls the xsd and incoming xml and does not have a targetnamespace defined in the xsd or xml.
    When I define a file adapter for it the wizard indicates that I need to fix the xsd by adding a namespace. I dont have control over the xsd or xml as they are an external party.
    I think I can hand edit the wsdl and change the import statement that requires a namespace to an include statement with no namespace.
    Have you run into this before? Will that work?
    Thanks,
    John

    Hi John,
    Did we get any solution for this ?
    Even in our case, the third party controls the xsd & incoming xml message. Both does not have a targetnamespace defined. The file adapter wizard indicates that we need to fix the xsd by adding a namespace. As a workaround, we manually added the target namespace to xsd and created file adapater. Now the question is how do we automatically add the name space in xml message as well, so that it can be parsed by BPEL process
    thanks
    Yj

  • Using sender file adapter to read the most current file

    Hi,
    in my sender file adapter , i have to read the latest file- all files in  the source directory are named as <filename><timestamp>.txt . I need to read the file with the latest timestamp (i.e. the most current file )
    How do i configure this using file adapter.
    thanks

    Hi Sreeram,
    thanks for the answer- but i found that the option can only be used with NFS transport protocol. what if i am using FTP ?
    alos, by date option means- files are processed according to their time stamp in the file system, starting with the oldest file.
    However in my case i only want to read the latest file and ignore the older files.
    Thanks

Maybe you are looking for

  • Why can't you create image hyperlinks in Yahoo mail??!!

    ''locking - duplicate - https://support.mozilla.com/en-US/questions/806494'' The whole feature that allows images to be entered inline with text is messed up when using Firefox. And you can't make any image a hyperlink! This is a really useful featur

  • F8BS- Business Area: Offsetting Posting is empty

    Dear Expert, When i execute F8BS- Display Payment Request. Field Business Area: Offsetting Posting is empty. Could you tell me where i can put the offsetting business area ? Thanks and Regards, YL

  • What format are the .tmp files created by hp scanner deskjet f2400?

    What format are the .tmp files created by hp scanner deskjet f2400?  I had a customer get the dreaded "out of space" error after scanning over a hundred pages that she was going to have all in one multipage pdf.  So all that work was gone (each page

  • JMS C API library for AIX

    Does anyone knows where I can locate the library for AIX without having to install Websphere or MQ?

  • My six year old K9A2 Platinum Mobo (Is it failing?)

    Hey All, I'm a long time MSI customer. I've owned at least three MSI mobo's. On my day-to-day rig, I've maintained a K9A2 Platinum. Which, is rather old (6 years). I've attempted to keep it in good working order, but over the past year. I have been e