Identifying the maximum length of a record in internal table

Hi,
Im using an internal table for a string for some requirement.
Now, at later point of time i need to use for CHAR variable to copy the data from the above internal table.
I need to identify the max length of the record stored in this internal table so that i can assign that much length to this CHAR variable.
Is there any standard fm or any abap stmts.
Thanks
rohith

You have to Loop the entire Itab to find the Maximum length of the record stored.
Just like this:
data: begin of itab occurs 0,
        v_str1 type string,
      end of itab.
data: v_len type i.
data: v_len1 type i.
itab-v_str1 = 'mahesh sap abap'.
append itab. clear itab.
itab-v_str1 = 'mahesh'.
append itab. clear itab.
itab-v_str1 = 'mahesh sap'.
append itab. clear itab.
loop at itab.
  v_len = strlen( itab-v_str1 ).
  if v_len > v_len1.
    v_len1 = v_len.
  else.
    continue.
  endif.
  clear: v_len.
endloop.
write:/ 'Max Length', v_len1.

Similar Messages

  • How do I identify the maximum length of video in iMovie which can be made into a dvd in iDVD, please?

    How do I identify the maximum length of video in iMovie which can be made into a dvd in iDVD, please?
    I made a sellection of video clips  > pressed on "share" > on iDVD >  after one hour of formating the message was under "project duration"  : "Your project exceeds the maximum content duration. To burn your DVD, change the encoder setting in the Project Info window."
    I have edited out some of the clips and waited anothe hour or so bu the same message appeared !
    I want to know in advance how long can be the video clip sellection for the quality of video chosen ( the best before HD).
    please help if ou can.
    thank you very much indeed.
    Michael
    North London

    It's trying to tell you to change the encoding setting:
    iDVD encoding settings:
    http://docs.info.apple.com/article.html?path=iDVD/7.0/en/11417.html
    Short version:
    Best Performance is for videos of up to 60 minutes
    Best Quality is for videos of up to 120 minutes
    Professional Quality is also for up to 120 minutes but even higher quality (and takes much longer)
    That was for single-layer DVDs. Double these numbers for dual-layer DVDs.
    Professional Quality: The Professional Quality option uses advanced technology to encode your video, resulting in the best quality of video possible on your burned DVD. You can select this option regardless of your project’s duration (up to 2 hours of video for a single-layer disc and 4 hours for a double-layer disc). Because Professional Quality encoding is time-consuming (requiring about twice as much time to encode a project as the High Quality option, for example) choose it only if you are not concerned about the time taken.
    In both cases the maximum length includes titles, transitions and effects etc. Allow about 15 minutes for these.
    You can use the amount of video in your project as a rough determination of which method to choose. If your project has an hour or less of video (for a single-layer disc), choose Best Performance. If it has between 1 and 2 hours of video (for a single-layer disc), choose High Quality. If you want the best possible encoding quality for projects that are up to 2 hours (for a single-layer disc), choose Professional Quality. This option takes about twice as long as the High Quality option, so select it only if time is not an issue for you.
    Use the Capacity meter in the Project Info window (choose Project > Project Info) to determine how many minutes of video your project contains.
    NOTE: With the Best Performance setting, you can turn background encoding off by choosing Advanced > “Encode in Background.” The checkmark is removed to show it’s no longer selected. Turning off background encoding can help performance if your system seems sluggish.
    And whilst checking these settings in iDVD Preferences, make sure that the settings for NTSC/PAL and DV/DV Widescreen are also what you want.
    http://support.apple.com/kb/HT1502?viewlocale=en_US

  • What is the maximum length of LONG data type in Forms 6i?

    What is the maximum length of LONG data type in Forms 6i?

    Do you mean the maximum size of a LONG that Forms 6i can display or the maximum size that can be stored in the database which sits behind your Forms application?
    Regards, APC

  • In my ALV o/p what is the maximum length of column, I can display ( because

    In my ALV o/p what is the maximum length of column, I can display ( because the length of the text some times exceeding 600 chars ) ?
    Thanks in ADVANCE

    I have declared like
    <b>  S_LAYOUT-MAX_LINESIZE = 1000.
      S_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.</b>
    However ALV output not displaying the entire length.
    Call the following function to display output in ALV form
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = 'ZFRSBOI0'
                IS_LAYOUT          = S_LAYOUT
                IT_FIELDCAT        = FIELDCAT
                IT_EVENTS          = P_EVENTS[]
               it_sort            = p_it_sort[]
                I_SAVE             = 'A'
           TABLES
                T_OUTTAB           = PDET_OTAB_ALV1
           EXCEPTIONS
                PROGRAM_ERROR      = 1
                OTHERS             = 2.
    If the function call is not successful, raise error message
    and come out from the program
      IF SY-SUBRC <> 0.
        MESSAGE E000(00) WITH
                          'Unable to display report'(E01).
        EXIT.
      ENDIF.

  • Set the maximum length of textedit element in webdynpro

    Hi All,
      How to set the maximum length of texedit element to a some constant characters.setting col and row property to 10 and 2 didnot set max length to 40.setting width and height also didnt helped to limit the characters user can enter to 20.
    Thanks,
    pkv

    >
    pkv wrote:
    > Hi All,
    >
    >   How to set the maximum length of texedit element to a some constant characters.setting col and row property to 10 and 2 didnot set max length to 40.setting width and height also didnt helped to limit the characters user can enter to 20.
    >
    > Thanks,
    > pkv
    Hi,
    Setting row and height is for layout purposes and not for the limiting of text in a TextEdit UI Element.
    To ensure that the Text Exit has only 40 characters in 04s - you can do as Alka has suggested.
    For doing the same in CE 7.1 - you can use the onChange Action and write code inside that method to limit the number of characters.
    I would suggest that you use IWDMessageManager to show a message in the MessageTray whenever the user goes over the limit of 40 characters - rather than accept the whole text and then show some sort of popup.
    Thanks.
    p256960

  • How to set the maximum length that a user can enter in Msgstyledtextinput

    Hi Everyone,
    I'm currently using EBS 11.5.1 and 10.2g DB
    Is there a way that I can set the maximum length that a user can input?
    I changed the Maximum Length to lower number (from 150 to 100) but I get the following error.
    Developer Mode Exception encountered in item SaveLocation
    Error: The item SaveLocation has a maximum length (100)
             which is not equal to that of the corresponding VO attribute
           , SaveLocation length (150).
    Action: Make sure they are equal in size. There must be other way to set that value
    Thanks,
    Elmer

    You have to set the maximum length of column to 150 to avoid this error.
    You can set the same in Jdev.
    Thanks
    --Anil                                                                                                                                                                                                                                                       

  • Why FormBuilder add one digit in the Maximum Length of number items...????

    Hi,
    Why does Form Builder add one digit to the Maximum Length property of number data base block items...????
    For example , if a db column is of datatype number(2)... then this item is represented by 3 digits- not 2- in the Maximum Length....This is true if the data block is created via the block wizard....
    Would it be any problem... if in the above example , i modified the Maximum Length to 2 ...????
    Have you noticied it...????
    Thanks,
    Simon

    In forms the definition of a number items length is the length of how many characters it holds and not how many digits.
    If you have length 4 and you want to set a value of 22.22 it will not accept, since 22.22 is 5 characters 4 numbers and the decimal point. And just like Paul said, if the number is negative then you need one more character for the " - " minus sign.
    Tony

  • How to get the time length from send record command to record video really?

    I have two buttons. Record/Stop
    I press Record button to record the video and press Stop
    button to stop recording.Now,I spend 1986 ms from press Record
    button to press Stop button.
    But the flv file's length is 1920 or 1910 or 1915 ms.
    So I want to get the time length from send record command to
    record video really.
    Can you give me some suggests.
    Thanks!

    maybe you have lag in publishing.... are you try watch de
    NetStream.liveDelay() method?
    or start counting when NetStream.onStatus has
    "NetStream.Record.Start" and "NetStream.Record.Stop" in information
    objects....

  • Whats the maximum length array and why?

    Whats the maximum length array and why?
    I tryed to search the forum but most people was wondering about the maximun length of a String..

    for(int i =20;i<=32;i++) {
         try {
              int[] p = new int[(int)Math.pow(2,i)];
              pause(2000); // So that gc doesn't clean away the array before
                              // The OS memory manager gets to update.
              System.out.println("Paused! i: " + i);
         } catch(OutOfMemoryError e) {
              System.out.println("Ex!!");
              pause(10000); // Same sa before.
    void pause(int p) {
         try {
              Thread.sleep(p);
         } catch (Exception e) {}
    }I worte this little code to test this.
    It runs to 2^23 for me.
    I am running
    AMD Athlon, 512 DDR, Windows 2000 SP4
    java version "1.5.0-beta2"
    Java was using 42116 Kb RAM and 54632 Kb Swap when its at 2^23

  • Inserting records from internal table to database table

    Hi all,
    i want to insert records from internal table to zDatabase table, can u plz guide me which statement is better in performance to insert the records.
    1) insert one by one record from internal table
    loop at itab.
    insert ztable from wa.
    endloop.
    2) insert total records at a time
    INSERT <dbtabname> CLIENT SPECIFIED FROM TABLE itab.
    or let me know if any other statement is there with high performance.
    i internal table contains nearly 40000 records.
    thanks.

    Hi,
    Insert the entire table at atime rather than a record so as to increase the performance.
    you can use INSERT <dbtabname> CLIENT SPECIFIED FROM TABLE itab.
    or
    MODIFY ZPRODUCT FROM TABLE GI_AFPO.
    Regards,
    Raj.

  • To delete duplicate records from internal table

    hi friends,
    i have to delete records from internal table based on following criterion.
    total fields are 7.
    out of which  if 4 fields are same and 5th field is different,then both records must be deleted.
    in case all five fields are same,the program should do nothing.
    for example.
    if there are 3 records as follows
    a1 b1 c1 d1 e1 f g
    a1 b1 c1 d1 e2 w r
    a1 b1 c1 d1 e1 j l
    then first two records should be deleted as four fields are same but fifth(e) field differs.
    but third record should remain as it is evenif first five fields are same for first and third record.
    values of last two fields need not to be consider for deleting the records.

    LOOP AT ITAB.
      V_FILED5 = ITAB-F5. "to compare later
      V_TABIX = SY-TABIX. "used to delete if condition not matches
      READ TABLE ITAB WITH KEY F1 = ITAB-F1
                               F2 = ITAB-F2
                               F3 = ITAB-F3
                               F4 = ITAB-F4.
      IF SY-SUBRC = 0.
        IF ITAB-F5 <> V_FIELD5.
    *--both the records to be deleted,as Field5 is different.
          DELETE ITAB INDEX SY-TABIX. "deletes that record
          DELETE ITAB INDEX V_TABIX. "deletes the current record
        ENDIF.
      ENDIF.
    ENDLOOP.
    Message was edited by: Srikanth Kidambi
    added comments
    Message was edited by: Srikanth Kidambi

  • To eliminate the duplicate entries while looping into final internal table

    Hi friends,
    IAam facing the follwoing problem.
    Get Shipment for the Delivery number
          SELECT tknum
                 vbeln
                 INTO TABLE lt_vttp
                 FROM vttp
                 FOR ALL ENTRIES IN lt_vbfa
                 WHERE vbeln = lt_vbfa-vbelv.
        IF sy-subrc EQ 0.
          SELECT vbeln kunnr
                 FROM likp
                 INTO TABLE lt_likp
                 FOR ALL ENTRIES IN lt_vttp
                 WHERE vbeln = lt_vttp-vbeln.
      endif.
    now iam my internal table lt_vttp i have following values
       shipment             delivery
          1000                  2000
          1000                 2001
    in my internal table lt_likp i have the follwoing values
          delivery              shipto
           2000                  ABC
           2001                  ABC
    now iam looping those values in a final internal table.
      LOOP AT lt_likp INTO ls_likp.
        CHECK sy-subrc EQ 0.
         READ TABLE lt_vttp INTO ls_vttp WITH KEY vbeln = ls_likp-vbeln BINARY SEARCH.
        CHECK sy-subrc EQ 0.
             SELECT SINGLE * FROM vttk INTO ls_vttk
                    WHERE tknum = ls_vttp-tknum.
                  CHECK sy-subrc EQ 0.
                APPEND ls_vttk TO lt_vttk.
       endloop.
    Now my problem is if the shipment is same and the shipto is same then need to eliminate the duplicate records.
            in internal table iam getting 2records with same shipment and shipto combination.
           but instead if both the shipment and shipto are same then i should elimate the duplicate entries.
    and for the same shipment if i have differnt shipto then i neeed those 2 value.
    can any body tell me how can i get that.
    Regards
    Priyanka.

    Hi Priyanka,
    In your code you are using seelct statement inside the loop which will affect the performance.
    So, declare a another internal table which contains your both shipment and shipto elements with other required fields, say the name is lt_new.
    sort lt_new by shipment shipto.
    delete adjacent duplicates from lt_new comparing shipment shipto.
    "then use for all entries to choose values from VTTK.
    Hope this helps you.
    Regards,
    Manoj Kumar P

  • Which system variable is reset at the exit of a loop of an internal table

    which system variable is reset at the exit of a loop of an internal table
    a)sy-loop b)sy-index c)sy-dbcnt d)sy-tabix

    You might want to revist your threads from Friday, and award points and mark as "Answered" or "Solved".
    Regards,
    Rich Heilman

  • How to update Records from Internal table to u2018Zu2019 table?

    Hi Friends,
    How to update Records from Internal table to u2018Zu2019 table.
    I have records in Internal table , that records want to update on u2018Zmarau2019 Table.
    ( my internal table & u2018 Zu2019 table structures are same.)
    Thanking you.
    Regards,
    Subash

    Hi,
    loop at internal table.
    modify <Z- table > from values < internal table Workarea>.
    if sy-subrc = 0.
      COMMIT work.
    else.
      ROLLBACK waork.
    endif.
    endloop.
    or
    UPDATE <Z- table > from table < internal table Workarea>.
    if sy-subrc = 0.
      COMMIT work.
    else.
      ROLLBACK waork.
    endif.
    Prabhudas

  • Extracting the result of a query into a internal table

    Hi,
    Does anyone knows or have an idea how to extract the result of a query into a internal table, is there a function module or BAPI?
    Thanks in advance,
    CK

    So then normally I would use a statment like:
    IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>BAPI_SALESORDER_GETLIST</b>");
    to call a particluar function, but I tried using
    IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>BAPI_MDDATAPROVIDERBW_GETCATALOGS</b>");
    and it did not seem to work. I also tried -
    IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>MDDataProviderBW.GetCatalogs</b>");
    How do I format the function?
    Thanks
    Paul

Maybe you are looking for

  • Recording sound from DV output

    I just got OnLocation yesterday and my job got moved up to tomorrow so I haven't learned it yet so I want a tape backup. Just testing with my Sony Handycam.  Seems to work OK direct into my laptop (audio and video), but since I want a backup, I want

  • A little trouble with a Zen X

    I recently attempted to put some files on my Nomad Zen Xtra with the most recent PlaysForSure firmware after a format of my PC and a fresh driver install, but when I attempted to do so, the Creative transfer software was not working properly. As a re

  • Click & drag stops and restarts further away

    When I click and drag, either to move a window, a file or to select text, the thing I wanted to drag loses selection and something else along the path of the cursor is selected. So if I try to drag a window it doesn't and drags another window instead

  • Very urgent please help me

    hai all, There will be no. of frames in my program. i am calling a frame in a java program using jsp based on selection. but it is not displaying that frame properly. its displaying in a very short manner. its not displaying any textboxes, buttons et

  • SAP Script - T&C on 2nd and last page based on company code

    Hi Experts, I have got a requirement from client to print the T&C page in PO script as 2nd page if company code is 1000 & it will be the 4th page if company code is 2000 (for rest it will be 2nd only). I am not sure we can put some conditions through