How to count records in a File

Hi All,
         When I get a file in XI, I need to count the number of records that file has. Also each record has an amount field, I need to add all the amount fields in the all the records present. How do I go about doing it.
Regards,
XIer

Context will be the scope at which the operation (sum/count) will be performed.
suppose you have the following structure.
<source>
<record>
   <amount>20</amount>
   <amount>30</amount>
</record>
<record>
<record>
   <amount>10</amount>
   <amount>10</amount>
</record>
<source>
if you do the mapping the following way,
<record> --> count --> totalrecord
<amount> --> sum --> totalAmount
if the context of <record> is at same level - then you will get the total as 1. If you set the context at <source> then you will get the total as 2.
similarly for <amount>, the values will be 50 (2030) or 70 (20301010), if you set the context at record and source level.
To set the context, right click the <record> or <amount> node in the editor and goto the context menu.
Thanks

Similar Messages

  • How to append records in a file, through file adapter.

    Hi All,
    How to append records in a file, through file adapter.
    I have to read data from database and need to append all records in a file.
    Thanks in Advance.

    Hi,
    I think you have a while loop to hit the DB in your Process (As you said you have to fetch data from DB 10 times if 1000 rec are there)
    First sopy your DB O/P to one var
    and from second time append to previous data.(Otherwise you can directly use append from starting instead of copy and append)
    When loop completes you can transform to File adapter Var.
    Otherwise you can configure yourFileadapter such that it will aapend current records to previous records.
    You can use 'Append= true' in your file adapter wsdl.
    It will append previous records to current records in the same file.
    Regards
    PavanKumar.M

  • How do I record a sound file and send it as an attachment using my 4s?

    How do I record a sound file and send it as an attachment using my 4s?

    Hi,
    The following is the program[Click Here| http://saptechnical .com/Tips/ABAP/email/EmailProgram.txt] which will send any format file. Actual Creator of the program is Amit Bisht.
    Thanks & Regards,
    Rock.

  • How to count records from 2 tables and show in RDLC Report

    hi all,
    its being a one day searching for the solution but No Luck.
     I have two SQL tables tblstudetail and tblfeereceiptdetail.
    i just want to count records from both tables and show in RDLC report.
    I tried SQl Query Like This:
    select a.session, a.course,
    Count(CASE a.ADstatus WHEN 'OK' THEN 1 ELSE 0 END ) AS Admission,
    Count(CASE s .I_receiptstatus WHEN 'OK' THEN 1 ELSE 0 END) AS Feeprint
    from
    tblstudetail a
    FULL join
    tblfeereceiptdetail s on s.studentID = a.studentID
    where a.session = '2015' AND s.Fsession = '2015' AND a.adcat = 'Regular'
    GROUP BY a.session,a.course
    ORDER by a.course
    The result Show the Same Value in Both columns
    Session    Course      Admission       FeeDetail
    2015          B.A. I               275              275
    2015          B.A. II              307             307
    2015         B.A. III             255            255
    2015          B.Sc. I             110             110
    2015           B.Sc. II           105            105
    2015          B.Sc. III            64               64
    Actully I want to Count How many ADMISSION have been Taken(FROM tblstudetail) and How many FEE RECEIPT have been Print (From tblfeereceiptdetail).
    please guide me for this as soon as possible.
    thanks in advance...

    I am counting 'OK' in both the table columns I.e 'ADstatus' in tblstudetail and 'feereceiptstatus' in tblfeereceiptdetail
    please suggest me

  • How to count records in a page which are in detail section

    Hi
    Is there a option to count records in detail section and so that based on that can apply a formula.

    Hi
    can i place the below two formulas in section experpt ?
    my report is like
    gh#1 
    details-----which contains transactions related to above group for a country
    group footer#1contains line '--
    if for india there are 3 records in the same page there can be 2 or 3 records in detail section. like that a page can contain more than one country. if number of records are more and coming in next page then the whole section should be moved to new page.
    that is my req. can u suggest accordingly.....
    i want to count the number of records in detais which will vary also how can i put formula when they are going to next page?

  • How to show records from xml file

    HI All
    I have created one region its actually search region
    which having 5 items and result table region
    I want to search records based on that 5 items and want to show output in table
    I have table name as hr_api_transactions which contains lot of columns
    and that table also contain one column
    name as TRANSACTION_DOCUMENT of type CLOB()
    that columns xml files for each record
    I want to extract data from that xml file and want to display.

    I have created one region on seeded page
    in that region I have created one table for output
    that region is search region
    which having 5 items of textfield and 2 items of type submit button
    GO and Clear
    I want to search based on that 5 items
    I want to display records in table that I have created on that region
    I have one seeded table
    that contain one column
    that column contain xml file for each individual records
    that xaml file contains values what I want to display
    MY problems are
    how can I extract data from xml file?
    how can I show all values for each records on that table?
    how can I search based on that 5 items?
    now I am able to find out single value from that XML file
    by using SQL command
    select xmltype(transaction_document).extract('//IrcPostingContentsVlEORow/CreationDate/text()').getStringVal() CreationDate
    from hr_api_transactions
    where transaction_ref_table = 'PER_ALL_VACANCIES'
    and transaction_ref_id = 4693;how can I extract more than one records from that XML file

  • How can I record an audio file directly from a digital recording device directly to the iMac?

    How can I record audio directly to my iMac from a digital recoding device?

    What digital recording device?

  • How to count Number of Input files onTarget Location?

    Hi Experts,
    I want to identify number of Input files available in Directory of Target system. Input file format is Input*.txt
    Once if I have this Count then based on that I can apply further logic in SAP R/3 coding.
    Please suggest me for the same.
    Regards,

    >
    Jagesh Lakdawala wrote:
    > My requirement is to read the Input Text file available on a given Location.Filename format is Input*.txt because Number of Input file is not fixed. All the Input file data needs to be available at the same time in R/3 coding (Internal table). i.e in a single XML message payload.
    > My question is in this BPM how do i know the LOOP Counter?? because LOOP should run depending on the Number of Input files available with the format Input*.txt.
    >
    > Please suggest.
    >
    > Regards,
    > Jagesh
    so say at one instance there are 7 files and XI picks them up, your BPM collects it and when you send it to R3 you need to know how many files have been processed?
    Well if this is the case, modify your BPM to accommodate collect pattern based on time. So fix a time period basically a time out say an hour. So the BPM will run for an hour after it receives the first file in and if within an hour say 7 files have come in, once the time out kicks in the BPM will exit. In you mapping of N:1 inside the bpm you can write a UDF which will count the occurrance of the root node of the source (a mandatory node of the source) and populate it to any field in the target tht you want to use.
    Is this what you are looking for?

  • Counting records in UTL file

    DECLARE
       fileID UTL_FILE.FILE_TYPE;
    FILE_DIR_OUT           CONSTANT          VARCHAR2(100) := 'MyDir';
    BEGIN
       fileID := UTL_FILE.FOPEN (FILE_DIR_OUT, 'DFD.dat', 'W');
    UTL_FILE.PUT_LINE (fileID,'voucherno'|| invoiceno );
       FOR crec IN (select   voucherNO,invoice
                 from VOUCHER_TABLE
                 where  voucherNO like '00000127%')
       LOOP
          UTL_FILE.PUT_LINE (fileID,crec.voucherNO || '|' ||crec.invoice );
       END LOOP;
       UTL_FILE.FCLOSE (fileID);
    END;I want the record count to be displayed at the bottom..
    How can i achieve it?
    S

    Maybe
    DECLARE
      fileID       UTL_FILE.FILE_TYPE;
      FILE_DIR_OUT CONSTANT VARCHAR2(100) := 'MyDir';
      line_count   pls_integer := 0;
    BEGIN
      fileID := UTL_FILE.FOPEN (FILE_DIR_OUT, 'DFD.dat', 'W');
      UTL_FILE.PUT_LINE (fileID,'voucherno' || 'invoiceno' );
      FOR crec IN (select voucherNO,invoice
                     from VOUCHER_TABLE
                    where voucherNO like '00000127%'
      LOOP
        UTL_FILE.PUT_LINE (fileID,crec.voucherNO || '|' || crec.invoice );
        line_count := line_count + 1;
      END LOOP;
      UTL_FILE.FCLOSE (fileID);
      UTL_FILE.PUT_LINE (fileID,to_char(line_count) || ' rows retrieved' );
    END;Regards
    Etbin

  • Counting records in text file using utl_file

    Hi
    i have an input file as below
    0010 asp
    0020 fdp
    0030 hfg
    0030 hfg
    0040 fdh
    0050 dfh
    0010 sjh
    0020 hjd
    0030 feh
    0030 jhj
    0030 seb
    0040 jnj
    0050 njj
    each group starts with 0010 & ends with 0050.
    I have to count the no. of 0030 records in each group.
    Here my output should be
    1~2
    2~3
    mean in the 1st group the number of records starting with 0030 is 2 & that in 2nd group is 3
    Please give a solution to count them..
    [Updated on: Thu, 10 January 2008 12:07]

    Hi,
    Below example using External Table Feature.
    create a directory on the server where your database is installed and copy your data file(text file) in that directory. In the below example Oracle directory name is "text_file" and the physical directory on the server is "D:\TEXT_FILE\". The file name of data file is "data.txt".
    create directory text_file as 'D:\TEXT_FILE\';
    DROP TABLE load_a;
    CREATE TABLE load_a
    (a1 varchar2(200))
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY text_file
    ACCESS PARAMETERS
    (FIELDS TERMINATED BY ','
    LOCATION ('data.txt')
    select * from load_a;
    now you can use
    select id||'~'||ctr from
    (select substr(a1, 3, 1) id, count(*) ctr from load_a group by substr(a1, 3, 1));
    Sachin Chauhan
    http://sach1607.blogspot.com

  • How to count records in table and send email only if count 0

    I thought this would be fairly simple, but apparently not.  I'm trying to count the number of records I have in my staging table, and send an email if count > 0  . . . .  and . . . . I want to put the count in the body of the email. 
    I'm running into a problem with the concatenation part of it.
    SET NOCOUNT ON
    SELECT * FROM [dbo].[Staging]
    SELECT @@rowcount as Row_Count
    SET NOCOUNT OFF
    IF @@rowcount > 0
    BEGIN
    exec msdb.dbo.sp_send_dbmail @profile_name = 'MailTest',
    @recipients = '[email protected]',
    @subject = 'Successfully Loaded Production',
    @body = 'Successfully Loaded Production ' + @@rowcount + ' records loaded',
    @body_format = 'text'
    END
    The problem comes from the '+' character not being recognized.  Maybe it's out of scope, not sure.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Try this
    SET NOCOUNT ON
    IF EXISTS (SELECT TOP 1 1 FROM [dbo].[Staging])
    BEGIN
    exec msdb.dbo.sp_send_dbmail @profile_name = 'MailTest',
    @recipients = '[email protected]',
    @subject = 'Successfully Loaded Production',
    @body = 'Successfully Loaded Production ' + @@rowcount + ' records loaded',
    @body_format = 'text'
    END
    Thanks
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • How to copy records from 2 file (one file depending from other file)

    In fact I have 2 files orders (1 heading, 1 detail):
    - COM_COMMANDES = heading,
    - COM_COMMANDES_LIGNES = D2TAIL,
    COM_COMMANDES_LIGNES depends on COM_COMMANDES.
    When I make an INSERT INTO in COM_COMMANDES, it makes me creation well.
    On the other hand, when I make an INSERT INTO in COM_COMMANDES_LIGNES, it creates me a recording BUT not with the identifying good (that created in COM_COMMANDES).
    Result: I have well the order copied but without the lines.
    Thank you to help me because I do not manage to regulate this problem.

    Hi,
    I have developed a example form and tested, and its works as your requirement.
    i have created a table with three three fields and the same data as u mentioned in post.
    I the button just paste the code and hope it will work.
    declare
         cursor c_test is select name,city,group_no from TEST_EXAMPLE;
    begin
         go_block('XXNEXTBLK');
    for C_test_rec in C_test
    loop
         :XXNEXTBLK.NAME := C_test_rec.name;
         :XXNEXTBLK.CITY := C_test_rec.city;
         :XXNEXTBLK.GROUP_NO :=C_test_rec.group_no;
         next_Record;
    end loop;
    FIRST_RECORD;
    --go_block('LC_REQ_BLK');
    Exception
         when too_many_rows then
         null;
         when others then
         null;
    end ;
    declare
    cursor c_test1 is select name,city,group_no from TEST_EXAMPLE;     
    begin
         go_block('XXNEXTBLK');
    if :XXNEXTBLK.GROUP_NO =1 then
         last_record;
         create_record;
              for C_test1_rec in C_test1
    loop
         :XXNEXTBLK.NAME := C_test1_rec.name;
         :XXNEXTBLK.CITY := C_test1_rec.city;
         :XXNEXTBLK.GROUP_NO :=C_test1_rec.group_no+1;
         next_Record;
    end loop;
    FIRST_RECORD;
    end if;
    end;
    Check it, if any issue just send a mail to [email protected], ill forward the fmd to you.
    Thanks & Regards
    Srikkanth.M

  • How to count the  number of files read through  sender file adapter

    Hi  ,
    I have a scenario where I am reading  files from a third party system and trying to send those files to R/3 system .The frequency is 1 file per day .But there can be situation where  the source system can put  2 to 3 files in source folder and so XI sender adapter will pick up all the 3 files at time . And I want to send only 1 file at a time to r/3 .
    Do you know any way to handle this requirement ?
    Thanks ,
    Suvarna

    Hi,
    Like Bhavesh pointed out, you could EOIO as the Quality of Servie in the sender file adapter.
    But I guess this would solve your issue only to a certain extent.
    Marking this QOS in the sender file adapter would only mean sequential processing of the files. That is, the second file will be sent only when the first file is successfully received by the end system.
    It would not ensure that the files are sent only after 15 mins of the first file is sent.
    If the 15 mins time period is important, then this needs to be achieved using a BPM which ensures that the messages are sent to the target only every 15 mins.
    In case, the frequency of the incoming files is not known (in which case, the having a BPM would be a bad idea) you could use a ztable, which stores the filename and time the file was sent to the R/3.
    You could query this table each time, before sending the file data to the R/3
    Regards,
    Smitha.
    Message was edited by:
            Smitha Rao

  • [Win VC++ 6.0 ]How to get the number of files count in a folder using VC++ 6.0?

    Hi all,
    Can any one tell how to get the number of files(.EPS) count inside a folder when the folder path is specified in VC++ 6.0?
    Thanks in Advance.
    Regards
    myriaz

    I'm a little confused by the question, but it sounds like you're asking how to count the number of files with a particular extension in a given directory? That's not really an AI SDK question, but it's a fairly easy one to find if you google it. If you're trying to use Illustrator to do it, AI doesn't have a general purpose file API. It has a few functions to do some things that Illustrator needs, but I don't think enumerating directories is one of them.

  • How count number of item records in a File: Idoc to File scenario

    Hi All,
    I am configuring an IDOC to File scenario.
    Once all the IDOC data is dumped on a File, I need to calculate the number of Item records in this file and write this number at the end of the trailer record in the file.
    Is theer a way to calculate the item data records(or say number of lines in the file) in the message mapping area. Or any other simple way to do it.
    Appreciate your help on same.
    Thanks
    Shirin

    hi,
    Use the count function for ITEM node the assign this count value to the receiver field , keep the ITEM context to header!
    Thanks,
    Vijaya.

Maybe you are looking for

  • Compressor 2 what works for me

    I've had my nightmares with compressor 2 and FCP5 on my Quad G5 and finally found a combo that works . I use compressor only to compress the audio to AC3 format. Using it to compress video results in failure with a Quicktime error of zero. So, I expo

  • How to create a Share with selective access to subfolder?

    Hi All! Just purchased PX12-400r and now "trying" to setup shares. What I want to accomplish is to have a Share accessible to one departmant (Finance). Inside that Share, I want to create sub-folders that is only accessble to specific employee and th

  • Problems with Grub, Dualbooting, and a software raid

    Been searching through google and any forums i could find regarding a possible fix and can not find anything that works. I have 2 Hard drives, First one is windows, second one is Archlinux.  They are setup through a software raid and i can not get gr

  • Changed data rows backup

    I want to take backup of only changed rows in a table.The table do not have timestamp column.How can I do it in 8i DB.The tables are not partitioned and not triggered due to perfoamnce slow down. Please help Prashant

  • IPhone makes charging noise and signal when charging but percentage won't increase

    I have been having difficulties with my iPhone 4 lately.  When I plug it in (both to the AC adapter in an outlet or my iMac), it makes the charging noise and gives the charging signal on the battery in the top right corner of my screen.  However, the