Deleting Space - Internal Table

Hi All,
I wish to know how to delete the leading / trailing spaces in <b>Internal Table's</b> field & bolding the field name in Report Output.
Ex: In report output - when i output BSID-WRBTR via an Internal table how to delete the blank spaces.
I appreciate ur time.
Regards
Tina

hi Tina,
   Use <b>Condense</b> Statement
i.e,
<b>The CONDENSE statement deletes redundant spaces from a string:</b>
CONDENSE <c> [NO-GAPS].
This statement removes any leading blanks in the field <c> and replaces other sequences of blanks by exactly one blank. The result is a left-justified sequence of words, each separated by one blank. If the addition NO-GAPS is specified, all blanks are removed.
DATA: STRING(25) VALUE ' one two three four',
LEN TYPE I.
LEN = STRLEN( STRING ).
WRITE: STRING, '!'.
WRITE: / 'Length: ', LEN.
CONDENSE STRING.
LEN = STRLEN( STRING ).
WRITE: STRING, '!'.
WRITE: / 'Length: ', LEN.
CONDENSE STRING NO-GAPS.
LEN = STRLEN( STRING ).
WRITE: STRING, '!'.
WRITE: / 'Length: ', LEN.
Output:
one two three four !
Length:           25
one two three four !
Length:           18
onetwothreefour !
Length:           15
Note that the total length of the field STRING remains unchanged, but that the deleted blanks appear again on the right.
Regards,
Santosh

Similar Messages

  • Delete and internal table with not eqaul to fields

    Hi I have an internal table I want delete few records with fields not equal to the variable v_lifnr, v_name1 and v_city,
    structure of internal table has fields LIFNR, NAME1, CITY, TEXT1 and TEXT2.
    I dont want to go by deletin in loop.

    Hi ,
    i want to delete a internal table record based on the values which are NOT in the ranges ..
    I am facing a syntax error with not operation in some system s
    code looks like below !
    i am not facing this problem when there in  no not in ranges.
    Thanks .
    RANGES: RA_FFIDS FOR /VIRSA/ZFFUSERS-ZVIRFFID.
    data : BEGIN OF IZVIRFFTRANSLOG OCCURS 0.
            INCLUDE STRUCTURE /VIRSA/ZFFTNSLOG.
    DATA:   DESC LIKE RS38M-REPTI,
          END OF IZVIRFFTRANSLOG.
    data : IT_ZFlight_T LIKE IZVIRFFTRANSLOG OCCURS 0 WITH HEADER LINE.
    IF NOT IT_ZFlight_T_TCODE[] IS INITIAL.
        DELETE IT_ZFlight_T_TCODE WHERE ZVIRFFID NOT IN RA_FFIDS.
       DELETE IT_ZFlight_T WHERE ZVIRFFID NOT IN RA_FFIDS.
    ENDIF.

  • Delete from internal table

    Hi,
    I want to delete from internal table some regords.
    I write code:
    delete  isrot where bldat < '01.09.2005'.
    it doesn't work, what is wrong?
    regards,
    Joanna

    hi,
    you write the statement like....
    <b>delete FROM isrot where bldat < '01.09.2005'.</b>
    now it will work...
    To select the lines that you want to delete using a condition, use the following:
    <b>DELETE FROM <target> WHERE <cond> .</b>
    All of the lines in the database table that satisfy the conditions in the WHERE clause are deleted. The FROM expression must occur between the keyword and the database table.
    You should take particular care when programming the WHERE clause to ensure that you do not delete the wrong lines. For example, if you specify an empty internal table in a dynamic WHERE clause, all of the lines in the table are deleted.
    If at least one line is deleted, the system sets SY-SUBRC to 0, otherwise to 4. SY-DBCNT contains the number of lines deleted.
    follow this link for more information on internal table operation.
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3aef358411d1829f0000e829fbfe/content.htm
    regards,
    Ashok Reddy
    Message was edited by:
            Ashok Reddy

  • Deleting from Internal Table (dynamic)

    Hi,
    I have an Internal table, which will contain daily movements for plants per material.
    The internal table will contain 4 plants per material, with more than 1 material.
    Now, i have four columns. If all of those columns for that material and for all plants for that material equal zero, i want to delete the specific record.
    For example
    Material     Plant      Daily 1  Daily 2  Daily 3  Daily 4
    102            1           0          0           0          0
    102            2           0          0           0          0
    102            3           0          0           0          0
    102            4           0          0           0          0
    So, these 4 records should be deleted. However, say on of the daily columns will equal 1, then keep the 4 records (they are linked by material and plant.)
    How do I do this?
    Points will be rewarded and all help will be greatly appreciated.
    Thanks,
    John

    Check this.
    DATA: BEGIN OF itab OCCURS 0,
            matnr LIKE marc-matnr,
            werks LIKE marc-werks,
            daily1 TYPE i,
            daily2 TYPE i,
            daily3 TYPE i,
            daily4 TYPE i.
    DATA: END OF itab.
    DATA: itab_per_matnr LIKE itab OCCURS 0 WITH HEADER LINE,
          wa_itab        LIKE itab.
    itab_per_matnr[] = itab[].
    LOOP AT itab INTO wa_itab.
    *-- check if there is at least one non-zero record for this material
      LOOP AT itab_per_matnr WHERE matnr = wa_itab-matnr
                               AND ( daily1 > 0 OR
                                     daily2 > 0 OR
                                     daily3 > 0 OR
                                     daily4 > 0 ).
        EXIT
      ENDLOOP.
      IF sy-subrc <> 0.
        DELETE itab WHERE matnr = wa_itab-matnr.
      ENDIF.
    ENDLOOP.

  • Deleting from Internal table.....

    Hi All,
    I have two internal tables with same structure like: IT_REC_LIST and IT_REC_LIST_DEL.
    I have 10 records in this internal table: IT_REC_LIST and same 5 records in this internal table: IT_REC_LIST_DEL. I don’t have any key fields.
    So I want to delete those 5 records from IT_REC_LIST. Could you please let me know hw to write the code, when I write like below its going for dump.
    DELETE IT_REC_LIST [] FROM IT_REC_LIST_DEL [].
    Akhitha.

    Hello,
    You can do like :
    loop at IT_REC_LIST .
    read table IT_REC_LIST_del with key field1 = IT_REC_LIST-field1.
    if sy-subrc eq 0.
    delete IT_REC_LIST.
    endif.
    endloop.
    <REMOVED BY MODERATOR>
    Vasanth
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 5:28 PM

  • Deletion from internal table

    Hi,
      My requirement is that I have to delete the duplicate values before doing any manupilation of data.. so for this I have written the code...
    *Deleting all the duplicate entries comparing group code, GL *& GL Suffix
      IT_INPUT_TEMP[] = IT_INPUT[].
      SORT IT_INPUT_TEMP BY GRCODE GL GLSUF.
      DELETE ADJACENT DUPLICATES
             FROM IT_INPUT_TEMP COMPARING GRCODE GL GLSUF.
    Now with the remaining values in the internal table I have to check the 3rd field i.e. GLSUF & if it = '00000' (5 zeros)... i have to delete those entries...
    For this I have written...
    Deleting enteries where the GL Suffix is zero.
      IF IT_INPUT_TEMP-GLSUF = 00000.              
        DELETE IT_INPUT_TEMP.                      
      ENDIF.                                                                               
    It gives me a dump saying "Invalid_Table_Index"...
    Prior to this I have also checked up by using Index function.
    Deleting enteries where the GL Suffix is zero.
      IF IT_INPUT_TEMP-GLSUF = 00000.              
        DELETE IT_INPUT_TEMP index l_tabix.                      
      ENDIF.
    Can anyone tell me where I am wrong??..
    Thank You & Regards,
    -S.

    Hi S,
    Your code extract
    * Deleting enteries where the GL Suffix is zero.
    IF IT_INPUT_TEMP-GLSUF = 00000.
      DELETE IT_INPUT_TEMP.
    ENDIF.
    Either this should be in a loop(which is unnecessary if all you are trying to achieve is deleting records), or you can try the option with 'WHERE' clause as mentioned in the above post.
    DELETE FROM IT_INPUT_TEMP WHERE GLSUF = '00000'.
    Regards,
    Srinivas

  • Deleting from Internal Tables

    Hi SDN Friends... Today I bring an easy question. But I still reward as always.
    Supose I have two internal tables of same type. Only one field.
    They re filled like the example below.
    Itab1
    01
    02
    03
    04
    05
    06
    Itab2
    02
    04
    06
    08
    10
    I want to remain only with the register that are containned in both table.
    FinalItab
    02
    04
    06
    What is the best way to do this in case of performance?
    Message was edited by:
            Jose Oliveira

    Let me join this funny
    Copy all above and these to conpare performance also!
    REPORT ZTEST.
    *[ DECLARE ]*******************
    DATA: begin of tab01 occurs 0,
            value type I,
          end of tab01.
    DATA: begin of tab02 occurs 0,
            value type I,
          end of tab02.
    *[ PREPARE ]*******************
    tab01-value = '1'.
    append tab01.
    tab01-value = '2'.
    append tab01.
    tab01-value = '3'.
    append tab01.
    tab01-value = '4'.
    append tab01.
    tab01-value = '5'.
    append tab01.
    tab01-value = '6'.
    append tab01.
    tab02-value = '2'.
    append tab02.
    tab02-value = '4'.
    append tab02.
    tab02-value = '6'.
    append tab02.
    *[ BEFORE ]*********************
    Write 'TAB01'.
    Loop at tab01.
      write / tab01-value.
    endloop.
    Write / 'TAB02'.
    Loop at tab02.
      write / tab02-value.
    endloop.
    *[ PROCESS ]********************
    data: min like tab02-value,
          max like tab02-value.
    sort: tab01, tab02.
    loop at tab02.
      max = tab02-value.
      DELETE tab01 where value > min and value < max.
      min = tab02-value.
    endloop.
    *[ AFTER ]**********************
    Write /'** AFTER DELETE **'.
    Write 'TAB01'.
    Loop at tab01.
      write / tab01-value.
    endloop.
    Write / 'TAB02'.
    Loop at tab02.
      write / tab02-value.
    endloop.

  • Memory released after delete in internal tables ?

    hi friends,
    i have one quick question about internal tables and memory consumption.
    if i have an internal table of say 100 entries and that does occupy memory for 100 entries. now if i delete 20 lines of this table...is the memory occupied by those 20 also released/freed or will the table size be 100 also and just the 20 deleted lines empty ?

    Hi!
    If you defined you table with the OCCURS 100 statement, then it will allocate always at least 100 records.
    The other tables will occupy only the memory size of their actual record length * record number bytes (plus some header information).
    Use REFRESH / FREE statement to delete the contents of unneccessary internal tables.
    Regards
    Tamá

  • Help on Delete Internal table records

    Hi,
    I have a internal table with some records in it.
    I need to delete the contents of this based on the condition as below.
    if product_search-Resp_product_company is not initial.
    SORT i_equi BY zzrefeng.
    DELETE i_equi WHERE zzrefeng <> product_search-Resp_product_company.
    endif.
    when i execute this all the records are getting deleted irrespective of the condition mentioned.
    Can anyone help me on this.
    Regards,
    Ram

    Hi,
    Need to delete the records if <b>ZZREFENG</b> does not have the value of <b>product_search-Resp_product_company</b> .
    Here I have product_search-Resp_product_company value as FI14. And also the internal table contains some records with ZZREFENG = FI14.
    I need to delete the internal table records if ZZREFENG <> FI14. But when i execute the statement it is deletng all the records even ZZREFENG = FI14 records also.
    Regards,
    Ram

  • To get recent timestamp records from internal table

    hi all,
      i have one requirment
      i'm storing error messages in one table  while creating a sales order basing on timestamp
      which is of this format yyyy-mm-dd hh:mm:ss (random Number) 
      if i want to see the error messages left i'm getting all the error messages displayed
      for example i have created a sales order
    i got 10 errors displayed
    i have rectified 5 errors ... if i again display error messages the 10 errors + the 5 errors is getting displayed
    i want to display the 5 error messages only not the previous messages from internal table
    basing on timestamp current one has to displayed remaining has to deleted from internal table.

    I thought we used Sales Order Incompletion process for this....  but, if you're recreating the errors list every time you save with a create or change transaction then, at save, delete all rows in your error table for this document.   Then get your errors and update your db table from your current errors table.   From this viewpoint, the timestamp is not relevant.

  • How to delete space in an internal table

    Hi All,
    In internal table I want to compress the leading space
    After searching I found Condense and SHIFT LEFT DELETE leading space commands work it is written...
    but when I write code A single space is appreaing in between the two fields...can any body help me where I am going wrong??
    Ex:
    data: begin of itab occurs 1 ,
    PSAtext TYPE CHAR15,
    psa type btrtl,
    end of itab.
    now o/p BEFORE CHANGE IS :
    SBI-CT    |1023
    After condense is SBI-CT |1023
    bETWEEN SBI-CT AND | there is a additional space. How can we avoid that?
    Sas
    Edited by: saslove sap on Sep 29, 2010 7:43 AM

    Well this is what I am going to solve this
    data:begin of STRING OCCURS 1 ,
    S1 TYPE STRING,
    END OF STRING.
    loop at itab.
    concatenate itab-f1 itab-f2 into string-s1 seperated by '|'.
    append string.
    end of itab.
    then I can transfer this string to Application server.
    Thanks for all the contributions.
    Regards
    sas

  • Deleting blank spaces in internal table

    Hi Gurus,
    I want to delete the empty spaces of a particular field in internal table.I used condense and shift statements but didnt work because the work area value is already condensed.I am not sure why the internal table field is having so much of empty spaces to its left.It's a character field with length 60.
    Please suggest.

    Hi,
    This is the rellevant code   
    LOOP AT IT_HIER INTO WFL_HIER.
            WFL_FINAL-NODEID = WFL_HIER-NID.
            WFL_FINAL-IOBJNM = WFL_HIER-IOBJ.
            WFL_FINAL-NODENAME = WFL_HIER-NNAME.
            WFL_FINAL-PID = WFL_HIER-PID.
            condense wfl_hier-desc.
            WFL_FINAL-DESCRIPTION = WFL_HIER-DESC.
            SHIFT WFL_FINAL-DESCRIPTION LEFT DELETING LEADING SPACE.
            APPEND WFL_FINAL TO E_T_DATA.
            CLEAR WFL_FINAL.
            CLEAR: WFL_HIER,OUT.
          ENDLOOP.
    The problem is not with the work area.
    Say if I have a value apple in the work area wa, (wa - 'apple').
    It doesnt have any leading sapces to the left.
    But when I am appending it to the internal table it gets posted at the last say like this (it -  '                                       apple'.
    It occupies the last five characters.
    Not sure how to resolve this.

  • Delete spaces in internal table

    Hi this question is to improve my performance...
    what is the performance oriented way of delete entires in internal table where any of the field is empty.
    1   2   3   4    5   6   7
    A  B   C  D    E   F  G   "<< ok
    A  B   C        E   F  G   "<< delete
    A  B   C        E       G   "<< delete
    or
    loop at itab.
    if itab-f1 eq space or itab-f2 eq space.....
    delete itab.
    endif.
    endloop.   " how to eliminate this loop...?

    Try this way
    delete itab where f1 eq space
                          or f2 eq space
                          or f7 eq space.

  • Memory space issue in internal table

    Hi ,
    My report is dumping because there is no memory space availabe for extending the memory of an internal table, after it gets filled with about 2500000 lakh records.
    the dump analysis is as follows :-
    Error analysis
    The internal table (with the internal identifier "IT_317") could not be
    enlarged any further. To enable error handling, the internal table had
    to be deleted before this error log was formatted. Consequently, if you
    navigate back from this error log to the ABAP Debugger, the table will
    be displayed there with 0 lines.
    When the program was terminated, the internal table concerned returned
    the following information:
    Line width: 1700
    Number of lines: 106904
    Allocated lines: 106904
    New no. of requested lines: 8 (in 1 blocks)
    How to correct the error
    The amount of storage space (in bytes) filled at termination time was:
    Roll area...................... 7272944
    Extended memory (EM)........... 603339264
    Assigned memory (HEAP)......... 396390176
    Short area..................... " "
    Paging area.................... 40960
    Maximum address space.......... 529887568
    You may able to find an interim solution to the problem
    in the SAP note system. If you have access to the note system yourself,
    use the following search criteria:
    Please suggest what can be done.
    Regards,
    Vikas Arya

    Hi,
    This solution might not sound good. But give a thought.
    While appending data u may take more than one internal table.
    Append first 10lakh records to 1st table, Second 10 lakhs to second table etc.
    But from where are u getting the source data? It should be present in some internal table correct?
    Probably u can use dynamic internal tables concept.
    Also check ur code carefully. After the place of appending if u are not going to use any internal tables then use FREE itab
    statement to free the memory allocated.
    Also reduce the global declarations as much as possible
    Thanks,
    Vinod.

  • Lack of storage space while extending an internal table

    Hi,
    While executing a select statement my program is giving dump.
    <b>ShrtText    </b>                                                                               
    No storage space available for extending an internal table.                                   
    <b>What happened? </b>                                                                               
    You attempted to extend an internal table, but the required space was                         
        not available.   
    <b>Error analysis</b>                                                                               
    The internal table "IT_49" could not be enlarged further. To allow                            
        error handling, the table had to be deleted before this log was                               
        created. So, if you branch to the ABAP debugger from the display                              
        of this log, the table will there be displayed with 0 rows.                                                                               
    At the moment of the termination, the following data was                                      
        determined for the respective internal table:                                                 
        Storage location: "Session memory"                                                            
        Row width: 7936                                                                               
    Number of rows: 1594                                                                               
    Allocated rows: 1594                                                                               
    Newly requested rows: 2 (in 1 blocks)                                                                               
    Please let me know how to solve this problem.
    Thanks in advance
    Suresh

    Hi Suresh ,
      The problem is with the statement where you select the data from the table
    SELECT QID "Queue identification (unique key)
    TRANS "Transaction counter: Batch input, statistics
    BLOCK "Message counter: Batch input, statistics
    SEGMT "Queue data segmentation number
    MSGCOUNT "Queue data block number
    VARLEN "Queue data length of user data
    VARDATA
    "Long String Used to Store BDC Objects in the Database
    FROM APQD
    INTO TABLE IT_APQD
    FOR <b>ALL ENTRIES IN I_APQD</b>
    WHERE QID = I_APQD-QID
    AND TRANS = I_APQD-TRANS.
    Please refer the how the FOR ALL ENTRIES CONCEPT works.
    if still the problem exists then try using the addition PACKAGE SIZE in your select statement , what this does is insted of write all the selected data at once into the internal table it will append in packets of size specified by you.
    <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb39eb358411d1829f0000e829fbfe/frameset.htm">Click here for Help on using Package Size in select statement</a>
    Thanks
    Arun

Maybe you are looking for

  • Problem with InDesign Server CS5

    Hi all, when i run from prompt (of Windows Server 2008) the command "InDesign Server.com -port 18383" the system respond "Adobe InDesign Server is not properly licensed and will now quit", until some days ago the InDesign Server work perfecly. What i

  • H how to find  if the psa table is included in psa deletion process chain

    Hi all can anybody tell me . I have a psa table it's technical name is /BIC/B* h how to find  the  above psa table is included in psa deletion process chain or not please help me

  • Server does not recognize email address

    I have both an iphone and an ipad until today I was able to send emails from both units using my household internet connection, today when I try to send an email from my ipad I get a pop-up stating server does not recognize the email address, but I c

  • ORA-00119,ORA-00132 during duplicate target database for standby in 11gR2

    I am running duplicate target database for standby from active database command from RMAN. I went thru step-by-step on how to create a standby database from the textbook i got from my Oracle Univ. 11g Data Guard course. I set up all the listener.ora

  • Idocs multiple message types

    Hi all, I created one custom idoc type with six segments. I heard that one idoc type can have any number of message types if it is so pls tell me how to assign these two message types for my idoc . i want to create multiple message types because i wa