How to count the total lines of the file (including the file header)

Hi all,
I am working with Idoc to file scenario(FCC).
I need to map one of the field with a recound count ie.., count of the total lines of the file (including the file header).
Eg:Record Count-- mapping area:Total number of records in the file including file header     The total line of the file (including the file header).
Can i get a help on this.
Thanks and Regards,
Manoj

Hi !
If there is a tag of your IDOC that occurs the same quantity of times as file lines you have to create in your target file, you could make a Java user defined function in graphical mapping that "caches the entire queue" (use the corresponding option button), that receives as input that field of the IDOC, and returns the "lenght" (.length property value) of that input parameter (it is an array) as output..that should be the file line quantity..you may also add 1 to that count, for the header.
Hope it helps.
Regards,
Matias.

Similar Messages

  • How to count number of lines in a file?

    I am using a BufferedReader to read my file, but I like to know how to count the number of lines in a file is there a way to do that in Buffered Reader or do I have to use FileInputLineStream?

    Well, if you know how to read one line with a Buffered reader, and you know how to keep reading lines until you run out, then all you have to to is initialize a counter to zero before you start reading, add 1 to it each time you read a line, and then examine its value when you're done.
    Try that, and post again if you get stuck.
    Just be careful how you construct your loop. "Off by one" errors are a common way to get bitten. It could happen if you count what you think is the last line, but you've actually already counted all the lines and you end up counting one extra for "there are no more lines".

  • How to count the number of lines dynamically,

    In the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
    after displaying one category contents am displaying a line
    which also counts to a line in the internal table.
    My question is how to count the number of lines(ULINE) displayed dynamically.
    FORM GET_LINES .
      DATA: LV_LINES TYPE I,
            LV_TIMES TYPE I,
            LV_TABIX TYPE SY-TABIX.
      DESCRIBE TABLE IT_REC LINES LV_LINES.
      DO LV_LINES TIMES.
        LV_TIMES = SY-INDEX .
        READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
        IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
          LV_TABIX =  LV_TIMES.
          READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
          IF SY-SUBRC EQ 0.
            APPEND GWA_UPDATE TO GT_UPDATE.
          ENDIF.
        ENDIF.
      ENDDO.
    ENDFORM.                    " GET_LINES

    In the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
    after displaying one category contents am displaying a line
    which also counts to a line in the internal table.
    My question is how to count the number of lines(ULINE) displayed dynamically.
    FORM GET_LINES .
      DATA: LV_LINES TYPE I,
            LV_TIMES TYPE I,
            LV_TABIX TYPE SY-TABIX.
      DESCRIBE TABLE IT_REC LINES LV_LINES.
      DO LV_LINES TIMES.
        LV_TIMES = SY-INDEX .
        READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
        IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
          LV_TABIX =  LV_TIMES.
          READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
          IF SY-SUBRC EQ 0.
            APPEND GWA_UPDATE TO GT_UPDATE.
          ENDIF.
        ENDIF.
      ENDDO.
    ENDFORM.                    " GET_LINES
    The display function is:
    FORM DISPLAY_DATA .
      ULINE.
      WRITE :  /1 SY-VLINE, 'check',
                10 SY-VLINE, 'Plant',
               20 SY-VLINE, 'Material number',
               50 SY-VLINE, 'Follow up material',
               70 SY-VLINE, 'Safety stock',
              100 SY-VLINE, 'Partc'.
      ULINE.
      LOOP AT IT_MARC.
        MOVE: IT_MARC-WERKS TO IT_REC-WERKS,
              IT_MARC-MATNR TO IT_REC-MATNR,
              IT_MARC-NFMAT TO IT_REC-NFMAT,
              IT_MARC-EISBE TO IT_REC-EISBE,
              IT_MARC-PARTC TO IT_REC-PARTC .
        APPEND IT_REC.
        CLEAR IT_MARC.
      ENDLOOP.
      DATA: GV_TABIX TYPE SY-TABIX.
      LOOP AT IT_REC.
        GV_TABIX = SY-TABIX.
        READ TABLE GT_TOTAL WITH KEY WERKS = IT_REC-WERKS
                                     NFMAT = IT_REC-NFMAT.
        IF SY-SUBRC EQ 0.
          IT_REC-PARTC = GT_TOTAL-PARTC.
          MODIFY IT_REC INDEX GV_TABIX TRANSPORTING PARTC.
        ENDIF.
      ENDLOOP.
      LOOP AT IT_REC.
        WRITE : /1 SY-VLINE, IT_REC-CHECK AS CHECKBOX,
                10 SY-VLINE, IT_REC-WERKS,
                20 SY-VLINE, IT_REC-MATNR,
                50 SY-VLINE, IT_REC-NFMAT,
                70 SY-VLINE, IT_REC-EISBE,
               100 SY-VLINE, IT_REC-PARTC.
        AT END OF NFMAT.
          ULINE.
        ENDAT.
      ENDLOOP.
      ULINE.
    ENDFORM.                    " DISPLAY_DATA
    Solved

  • How to count the number or rows in file

    Hi Experts,
    I am file as source and Oracle as target. My file containing the some data which is going to load to the target.
    My requirement is that I want to count the number of rows which my file contains. Please help me how to count the total number of rows in file.
    Thx,
    Sahadeva.

    Hi,
    You won't give a name DEST_USER_NAME:ODI will get these information.
    it is important  Command on source and Command on Source side .
    -Pls write jython code on Command on Source side
    -And Command On Target side Choose technology as Oracle and set logical schema to HR_logical
    Sorry my mistake.İt is related jython syntax.Here is code:
    import java.lang as lang
    import java.sql as sql
    import java.lang.String
    import os
    lang.Class.forName("<%=snpRef.getInfo("DEST_JAVA_DRIVER")%>")
    cons=sql.DriverManager.getConnection("<%=snpRef.getInfo("DEST_JAVA_URL")%>", "<%=snpRef.getInfo("DEST_USER_NAME")%>", "<%=snpRef.getInfo("DEST_PASS")%>")
    dblinks= cons.createStatement()
    file1=open('EMP.txt','r')
    count=0
    line=file1.readline()
    while line !='':
         count+=1
         line=file1.readline()
    file1.close()
    sqlQuery = "insert into HR.ETL_FILE_LOG (FILE_COUNT) values (count)"
    rqQuery= dblinks.execute(sqlDBLink)
    cons.close()
    Regards

  • How to count the no of record in grid.

    Hi Experts,
    I have one database block & this is bolck has contain 4 non database item is there. In database block has contain the id and description is non database block item. While i m querying the data description is shown depends up on ID. It is in grid. How to count the no of record in grid. My code is
    LV_CUR_ITM :=:SYSTEM.CURSOR_RECORD;
    FOR I IN 1.. LV_CUR_ITM LOOP
    LAST_RECORD;
    SELECT NSN_NO INTO :ORD_DIS_NSN_ITEM_DET.NSN_NO
    FROM NSN_MST WHERE NSN_ID= :ORD_DIS_NSN_ITEM_DET.NSN_ID;
    SELECT FOB_PRICE INTO :ORD_DIS_NSN_ITEM_DET.FOB_PRICE
    FROM PRODUCT_SUPPLIER WHERE PRD_ID_NUMBER= :ORD_DIS_NSN_ITEM_DET.PRD_ID_NUMBER
    AND BAS_ORG_ID_NUMBER=:ORD_DIS_NSN_ITEM_DET.ORG_ID_NUMBER;
    SELECT DESCRIPTION INTO :ORD_DIS_NSN_ITEM_DET.PRD_DESC
    FROM PRODUCT WHERE ID_NUMBER= :ORD_DIS_NSN_ITEM_DET.PRD_ID_NUMBER;
    SELECT FULL_NAME INTO :ORD_DIS_NSN_ITEM_DET.SUPP_NAME
    FROM ORGANISATION WHERE ID_NUMBER=:ORD_DIS_NSN_ITEM_DET.ORG_ID_NUMBER;
    NEXT_record;
    END LOOP;
    Thx in advance.

    Hai,
    Add a Non database item to that block, and set the Calculation Mode as Summary, and Summary Function to Count.
    Then u will get the total no of records from this text. ( You can hide this, so that the use won't see it. )
    OR
    go to the Last Record, then
    LV_CUR_ITM :=:SYSTEM.CURSOR_RECORD; This will also work.
    Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • How to count the number of rows in a resultser object?

    hi there
    how to count the number of rows in a resultser object which may contains millions of rows? besides using a while loop? thanks

    You don't, you execute a query whose result is the record count of those records that match the search and then you execute the actual query to create your record set. Typically you do
    select count(id) from YourTable where [filter]
    from the resulting ResultSet do
    int res.getInt(1);
    which gives you the count and then
    select id from YourTable where [filter]
    to produce the actual result set.
    in the second query the id part can be substituted with the actual fields you want.

  • How to count the no of digits entered in the NumericField & print the same

    Hi!
    How to count the no of digits entered in the Numberic Field and print the content of Numberic Field.
    Thanks.

    Hi Venkat,
    To check the number of digits, just convert it to a string and use the length() method. to get the number of characters. However, I am not getting your second point of printing the number?
    Kindly explain in detail.
    Regards,
    Poojith MV

  • How to count the number of wins?

    I have a tic tac toe simulator that simulates a game of tic tac toe (obviously). I press the 'play' button, and 1 random X and O is placed in 9 of the labels. Then the application says if X or O wins, or if the game was a tie/no winner.  So,
    what I want to do is when I click the 'exit' button, I want a message box telling the user how many times X won, O won, and how many ties there were.  I am not too sure how to count the number of wins.
    -Thanks

    Thanks for the reply.  I could be wrong, but I do not think that is exactly what I am looking for.  Here is the code that I have that determines the winner:
    switch (checkWinner())
    case 'T':
    winnerLabel.Text = "It was a tie!";
    break;
    case 'O':
    winnerLabel.Text = "O Wins!";
    break;
    case 'X':
    winnerLabel.Text = "X Wins!";
    break;
    private char checkWinner()
    char WinnerChar = ' ';
    int winning_line = 0;
    if (GameBoardCellChar[0].Equals(GameBoardCellChar[1]) && GameBoardCellChar[0].Equals(GameBoardCellChar[2]))
    WinnerChar = GameBoardCellChar[0];
    winning_line++;
    if (GameBoardCellChar[3].Equals(GameBoardCellChar[4]) && GameBoardCellChar[3].Equals(GameBoardCellChar[5]))
    WinnerChar = GameBoardCellChar[3];
    winning_line++;
    if (GameBoardCellChar[6].Equals(GameBoardCellChar[7]) && GameBoardCellChar[6].Equals(GameBoardCellChar[8]))
    WinnerChar = GameBoardCellChar[6];
    winning_line++;
    if (GameBoardCellChar[0].Equals(GameBoardCellChar[3]) && GameBoardCellChar[0].Equals(GameBoardCellChar[6]))
    WinnerChar = GameBoardCellChar[0];
    winning_line++;
    if (GameBoardCellChar[1].Equals(GameBoardCellChar[4]) && GameBoardCellChar[1].Equals(GameBoardCellChar[7]))
    WinnerChar = GameBoardCellChar[1];
    winning_line++;
    if (GameBoardCellChar[2].Equals(GameBoardCellChar[5]) && GameBoardCellChar[2].Equals(GameBoardCellChar[8]))
    WinnerChar = GameBoardCellChar[2];
    winning_line++;
    if (GameBoardCellChar[0].Equals(GameBoardCellChar[4]) && GameBoardCellChar[0].Equals(GameBoardCellChar[8]))
    WinnerChar = GameBoardCellChar[0];
    winning_line++;
    if (GameBoardCellChar[2].Equals(GameBoardCellChar[4]) && GameBoardCellChar[2].Equals(GameBoardCellChar[6]))
    WinnerChar = GameBoardCellChar[2];
    winning_line++;
    if (winning_line == 0 || winning_line > 1)
    WinnerChar = 'T';
    return WinnerChar;
    Do I have to include something extra in here to get the count or no?
    The code I posted is the coding in my play button.

  • How to count the number of text boxes that are data entered

    How to count the number of text boxes that are data entered in visual basic form.

    Here is an Iterator that expands on my previous response:
    ''' <summary>
    ''' Iterator for form controls
    ''' </summary>
    ''' <param name="onlyControlsOfType">specify type if a certain type of controls needed</param>
    ''' <param name="onlyTopLevel">if true don't search containers within the form</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Iterator Function AllControls(Optional onlyControlsOfType As Type = Nothing, _
    Optional onlyTopLevel As Boolean = False) As IEnumerable(Of Control)
    Dim ctrl As Control = Me.GetNextControl(Me, True)
    Do Until ctrl Is Nothing
    If onlyControlsOfType Is Nothing OrElse ctrl.GetType = onlyControlsOfType Then
    If TypeOf ctrl.Parent Is Form OrElse Not onlyTopLevel Then
    Yield ctrl
    End If
    End If
    ctrl = Me.GetNextControl(ctrl, True)
    Loop
    End Function
    Some sample uses:
    For Each
    For Each c As Control In AllControls()
    Debug.WriteLine(c.Name)
    Next
    List of all controls, including controls in containers i.e. Groupbox
    Dim l As List(Of Control) = AllControls().ToList
    List of all Textbox controls, including Textboxes in containers i.e. Groupbox
    l = AllControls(GetType(TextBox)).ToList
    List of all Textbox controls, don't include Textboxes in containers i.e. Groupbox
    l = AllControls(GetType(TextBox), True).ToList
    'Those who use Application.DoEvents() have no idea what it does and those who know what it does never use it.'  JohnWein
    Multics
    My Serial Port Answer

  • How to count the number of AAA clients

    Hi,
    As we know, ACS5.2 is required with a base license-- supporting 500 network devices.
    Sometimes there are lots of AAA clients or network devices that are authenticating simultanious. So my question is, how to count the network devices allowed to auth on ACS5.2? Does that only include network devices, or including both any network devices or AAA clients?
    Rgds,
    Laowu5017

    Hi,
    ACS 5.x counts the number of AAA clients that are configured on the ACS.
    Please note that AAA clients and networks devices is the same and they comply switches, routers, WLCs, or whatever other device configured under
    Network Resources >
    ... >
    Network Devices and AAA Clients
    AAA Clients are NOT the AAA suplicants.
    The end user clients PCs are the AAA suplicants, and for this there is no limit number.
    HTH,
    Tiago
    If  this helps you and/or answers your question please mark the question as  "answered" and/or rate it, so other users can easily find it.

  • How to determine the contract header's valid period...

    1. How to determine the service contract header's start date, end date, when related muliple items with different start date and end date?
    i.e., what is the different between the header's valid period and item valid period?
    For example:
    Sold to A has 5 items, which has different contract line item start date and end date, e.g.,
    item 2: 2010.9-2011.9
    item 3: 2011.4-2012.4
    As for combined the all item bolonged to sold to A to one contract, so the item should have different contract start date and end date.
    However, how to determine the contract header's start date and end date?
    2. Another question is: When process service contract data migration from legance to CRM, how to design the above scenario logic?
    Thanks in advance,

    Sent again, to wait the answer....

  • How to change the page Header background colour in a Theme

    Hello,
    I want to know how to change the page header background colour. If you are in the Editor I don't find a property where to change it.
    If you are in the Theme Editor in the header bar I want to change stands <b>Theme Editor</b>. This (in my case blue colored bar) I want to change in another color.

    Hello Radhika,
    thanks for your answer. Where do I find the option for the pageheader in System Administration>Portal Display>Theme Editor ->IView Trays exactly?
    The pageheader is a picture, which must be uploaded for the web dynpro. Why should any webdynpro element in the ivew tray. There is no relationship between these two parts.
    I have not found any option to change the web dynpro pageheader. Could there any extra theme editor for webdynpro?
    Thanks.
    Olaf

  • How to change the page header?

    Hi,
    I just installed and started using Plumtree 6.0 a month ago, and we are still in a trial phase for our company's portal.
    I want to change the default page header to replace Plumtree logo to my company's logo. I thought I can change it in the style sheet, but I didn't find where to change in the cssmill folder. I found an artical in edocs.bea.com saying I can modify the header by using ALI Publisher, but I don't know what's the right way to do it and faster.
    Can someone guide me how to change the page header?
    Thank you. (if this is not the correct forum to post the question, please let me know which forum should I go)

    Depends on what you want to do. Personally, I'd do a header portlet and not touch the Plumtree/BEA logos. They're likely to be overwritten when the product receives updates.
    This may seem like a lot of steps, but really - it goes quickly
    ** Think through what you want to display. If all you want to do is replace the image, but you wan to keep the overall layout style then you can create a simple replacement header
    Step 1 - create a header portlet
    =======================
    If you're using Publisher...
    =====
    * Create a new portlet - choose the Header portlet template
    * Upload your image / change the header in the rich text editor
    If you're not using Publisher
    =====
    * Personally, static HTML will do just fine - create a folder and html file called something like "mybanner/mybanner.htm" on your remote portlet server
    * Plop in an image (you'll want to swipe some adaptive tags for community and page name - can always stick those in later)
    * Create a new remote portlet web service that references this HTML page
    * Create a portlet from the web service - make sure the type is "header"
    Step 2 - turn it on
    =======================
    * Create a new experience definition (or modify default - I usually create a new one so you can move it between environments)
    * In the experience definition's "header / footer" settings area, tell the header to load from the new header portlet you created
    * If you created a custom experience definition, modify your experience rules to load this experience defiintion according to whatever parameters you think make sense (just be careful you don't knock out your login page - we usually use security groups to just say "hey - the user is logged in and is, in fact, a member of this portal - that'll still let your login pages load)
    Done
    May seem like a lot of work, but really it's just a series of simple steps. Advantage here is you can vary things as you see fit and also just feel safe that the next time Plumtree/BEA updates those imageserver files you'll be good to go. From there you can get as fancy schmancy as you like using adaptive tags, etc. Heck - make it a .NET app if you want and do some crazy personalization or something. Embed stock tickers, important news alerts, whatever.
    That help at all?
    Thanks,
    Eric

  • How to freeze the report header row in the web template SAP BI 7.0?

    Hello,
    Can somebody tell me how to freeze the report header row in the web template SAP BI 7.0 (key fiigures1, 2,3)?
    key figure1   key figure2    key figure3
    20                    30                   40
    30                    80                   90
    Thanks

    Hi,
    You can refer the following threads...
    Re: Create Scrollable Table Body in WAD - Locking Table Column and Header
    Freeze Data Columns in WAD
    This will help you!
    Rgds,
    Murali

  • How to Disable the Process Header, collapsible Area, and Process Warning Bar from Contacts Form of CRM 2013

    Folks,
    How to Disable the Process Header, collapsible Area, and Process Warning Bar from Contacts Form of CRM 2013
    Thank you.

    Hi,
    You can deactivate the business process itself if you do not want at all. So that the header will not available for the entity.
    Regards,
    Priya

  • How to fix the column header width in BEx or WAD

    hi there!
    how to fix the column header width in BEx or WAD. because, depends on the column data, the column size varies. i want to fix the size so that i can maintain the consistency through out the report.
    thanks!
    Vam.

    Dear Vam,
    you can easily do that with css, search the source code of the executed web template for the td tag which is around your coloumn header, remember the style sheet class name it is ´displayed as class= in the td tag.
    Now you can add this code the beginning of your web template:
    </style>
    This will only work in Web.
    Regards
    Marcus

Maybe you are looking for

  • How can i remove my icloud account from my pc?

    i'm trying to remove my icloud account from my pc because my iphone is on service and they asked me  to do that . Please help.

  • Cannot edit 'print pdf to folder' menu in Lion

    With Lion when printing I am no longer able to edit the drop down PDF menu that resides in the left lower corner of the Print window. This is the menu that contains items such as "Save PDF to Web Receipts Folder". I can go through the process to edit

  • Replying to mail quotes incorrectly?

    When I reply to an email with some kind of file attachment like a vcard only the attachment is quoted. All other text is striped out from the email. If an email is text only it is quoted correctly. I'm not highlighting anything and the responding set

  • Mt Lion 10.8.5: can't connect to file server with legacy AFP - only that fileserver at hand

    Hi! I just discovered the hard way that I no longer can access the NAS on the office, using my iMac that is upgraded to 10.8.5 It seems to be an issue of "legacy AFP" no longer supported in 10.8 I found a KB, but the instructions tells me to connect

  • Moving in and out of Raw Converter

    I am using PSE6 for Windows 64.  Once I move a set of NEF / Raw files out of the Raw Converter into PSE Editor, can I move the file or files back into the Raw Converter from the Editor?  Closing the files and opening them back in the Organizer is my