Internal table logic issue

Hi All,
I have one logical issue related to internal table manipulation.
I have one internal table :
I_DAT - This is related to Loading/Unloading of Goods.
for example with 3 fields
VSTEL, KUNNA, KMMANG.
Now suppose my data looks like this after sorting:
VSTEL   KUNNA    KMMANG
100       -        -
200       -        -
300       -        -
400       -        -
-         500      X
-         600      X
-         700      X
-         800      X
Here 100,200,300,400 are Loading points.
ANd 500,600,700,800 are unloading points.
Now what i want is For loading & Unloading points i need to pick up Address and print one after other.
But how they need to print is:
FOR INITIAL LOADING OF
ADDRESS- For 100
FIRST STOP: FOR LOADING OF
ADDRESS- For 200
SECOND STOP: FOR LOADING OF
ADDRESS- For 300
Etc .....
Then
FOR UNLOADING OF:
ADDRESS- For 400
FIRST STOP: FOR UNLOADING OF
etc.
FINAL STOP: FOR FINAL UNLOADING OF
We might get as many records :
Can any body give me the logic:
Printing Address is not a problem:
But Above every address we need to print FIRST STOP, SECOND etc like that.
For this i need logic.
Can anybody give the solution!
Thanks in advance.
Thanks & Regards,
Prasad.

Try this.I think you want output like this......
DATA: BEGIN OF LINE,
        CARRID   TYPE SBOOK-CARRID,
        CONNID   TYPE SBOOK-CONNID,
        FLDATE   TYPE SBOOK-FLDATE,
        CUSTTYPE TYPE SBOOK-CUSTTYPE,
        CLASS    TYPE SBOOK-CLASS,
        BOOKID   TYPE SBOOK-BOOKID,
      END OF LINE.
DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY TABLE LINE.
SELECT CARRID CONNID FLDATE CUSTTYPE CLASS BOOKID
       FROM SBOOK INTO CORRESPONDING FIELDS OF TABLE ITAB.
LOOP AT ITAB INTO LINE.
  AT FIRST.
    WRITE / 'List of Bookings'.
    ULINE.
  ENDAT.
    AT NEW CARRID.
      WRITE: / 'Carrid:', LINE-CARRID.
    ENDAT.
      AT NEW CONNID.
        WRITE: / 'Connid:', LINE-CONNID.
      ENDAT.
        AT NEW FLDATE.
          WRITE: / 'Fldate:', LINE-FLDATE.
        ENDAT.
          AT NEW CUSTTYPE.
            WRITE: / 'Custtype:', LINE-CUSTTYPE.
          ENDAT.
               WRITE: / LINE-BOOKID, LINE-CLASS.
            AT END OF CLASS.
              ULINE.
            ENDAT.
ENDLOOP.
This is also helpful......
LOOP AT <itab>.
  AT FIRST. ... ENDAT.
    AT NEW <f1>. ...... ENDAT.
      AT NEW <f2 >. ...... ENDAT.
          <single line processing>
      AT END OF <f2>. ... ENDAT.
    AT END OF <f1>. ... ENDAT.
  AT LAST. .... ENDAT.
ENDLOOP.
Regards
Abhishek

Similar Messages

  • Regarding Internal table logic

    Hi,
    I have my internal table as follows:
    DATA: BEGIN OF I_DATA OCCURS 0,
            prgname TYPE SYST-REPID,
            matnr   TYPE mara-matnr,
            berid   TYPE mdma-berid,
          END OF I_DATA.
    Data that fills into can be as follows:
    Ex:
    PROGRAM1,1000,MRP1
    PROGRAM1,1000,MRP1
    PROGRAM1,2000,MRP1
    PROGRAM2,1000,MRP1
    PROGRAM2,1000,MRP1
    PROGRAM2,2000,MRP1
    PROGRAM3,1000,MRP1
    PROGRAM3,1000,MRP1
    PROGRAM3,2000,MRP1
    It can any order in above way.
    Then i will sort the above data as follows:
    SORT I_DATA BY prgname matnr berid.
    Now here my issue is:
    DATA: t_objtxt     LIKE solisti1   OCCURS 0  WITH HEADER LINE.
    I need to push the above internal table data into T_OBJTXT internal table as follows:
    It should first Display program Name as Program Name: Program3, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.
    When 2nd program comes again i have to write Program Name: Program2, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.
    When 3nd program comes again i have to write Program Name: Program3, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.
    Etc. Same process we need to follow.
    The final out put should be as below:
    PROGRAM NAME : PROGRAM1
    MATNR, BERID
    1000,MRP!
    1000,MRP1
    2000,MRP1
    PROGRAM NAME : PROGRAM2
    MATNR, BERID
    1000,MRP!
    1000,MRP1
    2000,MRP1
    PROGRAM NAME : PROGRAM3
    MATNR, BERID
    1000,MRP!
    1000,MRP1
    2000,MRP1
    Like wise o/p need to be send to I_OBJTXT and to email.
    <b>The logic i have written is as follows:</b>
      LOOP AT I__DATA.
        AT NEW PRGNAME.
          MOVE '*****************************************' TO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          CONCATENATE t_objtxt-line 'PROGRAM NAME : '
                      I_DATA-PRGNAME
                      INTO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          MOVE '*****************************************' TO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          CONCATENATE TEXT-024 " Material
                      TEXT-025              " MRP
                      INTO t_objtxt-line
                      SEPARATED BY C_COMMA.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          MOVE '-----------------------------------------' TO t_objtxt-line.
          CONCATENATE t_objtxt-line '------------------' INTO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
        ENDAT.
    *    MOVE '' TO t_objtxt-line.
    *    APPEND t_objtxt.
    *    CLEAR t_objtxt.
        CONCATENATE I_DATA-MATNR
                    I_DATA-BERID
                    INTO t_objtxt-line
                    SEPARATED BY C_COMMA.
        APPEND t_objtxt.
        CLEAR t_objtxt.
        AT END OF MATNR.
          MOVE '' TO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          MOVE '*****************************************' TO t_objtxt-line.
          CONCATENATE t_objtxt-line '******************' INTO t_objtxt-line.
          CONCATENATE t_objtxt-line '******************' INTO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
        ENDAT.
      ENDLOOP.
    The above logic is not working correctly.
    Can anybody give me correct logic for the same.
    Thanks in advance.
    Thanks,
    Deep.

    Can you paste the total code.
    santhosh

  • Short dump-internal table size issue

    Hi,
    I get the following message in the short dump analysis for a report.
    No storage space available for extending table "IT_920".
    You attempted to extend an internal table, but the required space was not available.
    Error Analysis:
    The internal table "IT_920" could not be enlarged further.             
    To extend the internal table, 9696 bytes of storage space was          
    needed, but none was available. At this point, the table "IT_920" has  
    1008240 entries.
    Its an old report and I saw the internal table declaration using the "OCCURS" clause in the internal table declaration.
    begin of itab occurs 100.
    end of itab.
    I tried the option of changing to "OCCURS 0", still issue persists.
    Any help would be highly appretiated
    CM

    Hello CMV,
    This is basic problem with SAP internal tables. For every internal table memory is alocated ( Max..256K)...once you cross the memory size/limit of the internal table it resuls in short dump.
    Only way to overcome this problem is handle limited number of records at a time.. 
    Please refer following sample code which will help you to avoid short dump while processing large number of records....
      SORT TAB_RESULT.
      DESCRIBE TABLE TAB_RESULT LINES W_RECORDS.
      W_LOW      = 1.
      W_UP       = 1000.
    *Spliting the records from tab_result1 by pakage of 1000 at a time
    *to avoid short dump in case of more records
      WHILE W_LOW <= W_RECORDS.
        R_PKUNWE-SIGN = 'I'.
        R_PKUNWE-OPTION = 'EQ'.
        R_WERKS-SIGN = 'I'.
        R_WERKS-OPTION = 'EQ'.
        LOOP AT TAB_RESULT FROM W_LOW TO W_UP.
          MOVE TAB_RESULT-PKUNWE TO R_PKUNWE-LOW.
          MOVE TAB_RESULT-WERKS  TO  R_WERKS-LOW.
          APPEND R_PKUNWE.
          APPEND R_WERKS.
        ENDLOOP.
    *fetch sold to party
         SELECT KUNNR NAME1
           FROM KNA1
           APPENDING CORRESPONDING FIELDS OF TABLE TAB_KNA1
           WHERE KUNNR IN R_PKUNWE.
    *fetch plant
      SELECT WERKS NAME1
             FROM T001W
             APPENDING CORRESPONDING FIELDS OF TABLE TAB_T001W
             WHERE WERKS IN R_WERKS.
       REFRESH: R_PKUNWE,
                R_WERKS.
        W_LOW = W_LOW + 1000.
        W_UP  = W_UP  + 1000.
      ENDWHILE.
    Hope this will help you to solve problem.
    Cheers,
    Nilesh

  • Internal table Memory Issue Exception TSV_TNEW_PAGE_ALLOC_FAILED

    Hi experts,
    I am working on a conversiojn programme. This programme is dealing with 4 input files.
    Each of these files is having more than 50,000 records. I am reading the corresponding application server files to fill
    the internal tables related to these files.
    The files are being read properly and internal tables are being filled.
    However when i try to assign any of these 4 internal tables to other temproray internal tables in programme(requirement)
    i get a dump  TSV_TNEW_PAGE_ALLOC_FAILED.
    The dump is related to memory issue.
    I think The memory available in the programme at this point is not sufficient for table assignment.
    Please suggest any alternatives where i can save any memory .
    Changig of basis setting is not an option.
    Regards,
    Abhishek Kokate

    Hi Kiran,
    I am not agree with you , I am agree with Hermann.
    While writting file you restrict the record max 5,000 to 10,000 records and process don't store the mutch data into internal table.
    After every used refresh the internal table, Declare table where necessary.
    But you can try to avoid the copy cost.
    Rgds
    Ravi Lanjewar

  • Reg. internal table logic

    Hi,
    I have an internal table with 5 fields (Vbeln, A, B, C, D ) and records like this:
    Record1:
    Field vbeln (value is  6000000001), Field A (value is 2006), Field B (value is 1130), Field C (value is initial), Field D (value is initial)
    Record1:
    Field vbeln (value is  6000000001), Field A (value is initial), Field B (value is initial), Field C (value is 2005), Field D (value is 1134)
    Now whenever, Field A and Field B has values, field C and field D are initial and vice versa.
    I Want to get all of the field values in just one record like below when the key vbeln is same.:
    Field vbeln (value is  6000000001), Field A (value is 2006), Field B (value is 1130), Field C (value is 2005), Field D (value is 1134)
    I know I can create another internal table, copy the contents, use the looping logic and achieve the same but wondering if there is any better way of doing the same?
    Appreciate your input.
    Thanks!

    Hi,
    You need another internal tables. Please try this.
    SORT ITAB1.
    ITAB2[] = ITAB1[].
    LOOP AT ITAB1.
      LOOP AT ITAB2 WHERE ITAB2-VBELN EQ ITAB1-VBELN
                      AND ITAB2-DATE1 NE ITAB1-DATE1
                      AND ITAB2-TIME1 NE ITAB1-TIME1.
        ITAB3-VBELN = ITAB1-VBELN.
        ITAB3-DATE1 = ITAB1-DATE1.
        ITAB3-TIME1 = ITAB1-TIME1.
        ITAB3-DATE2 = ITAB2-DATE2.
        ITAB3-TIME2 = ITAB2-TIME2.
        APPEND ITAB3.
      ENDLOOP.
    ENDLOOP.
    Regards,
    Ferry Lianto

  • Internal table logic required

    Hi ,
    I have two internal tables having with different structures . Finally I need to pass data to final internal table.
    In runtime we have data in only one table.  The final internal table should take either internal1, or internal table 2.
    it_final_data[] = it_first_data[].
    or
    it_final_data[] = it_sec_data[].
    i have to one generic include , it will understands the IT_final_data internal table only.
    please help me.
    regards,
    Ajay

    Hi Ajay,
         Build your final internal table with all the fields from first and second internal table. Use the below logic to move the data to the final internal table depending on the internal table data which you want to display.
    IF not it_first_data[] is initial.
      loop at it_first_data.
        move-corresponding it_frist_data to it_final_data.
        append it_final_data.
    endloop.
    else.
       loop at it_second_data.
        move-corresponding it_second_data to it_final_data.
        append it_final_data.
      endloop.
    endif.
    Hope this works for you.
    Regards,
    Jayaram

  • Internal Table Logic Needed

    Hi all,
    I have a requirement regarding data processing in a internal table,
    internal table consists of filelds Vendor,Material and Scheduling Dates and Total Qty.
    Here i need to fill the field Total Quantity, individual addition of quanties of that material for a particular vendor .
    Let us consider intitially my internal table consists of data like this with these fields.
                      Vendor ,           Material  ,            qty(individual),   Total qty   ,  Schedule dates
                       v1        ,           m1       ,                 10          
                       v1        ,           m1        ,                10
                       v1       ,             m1       ,                  20
                       v1       ,              m2      ,                    5
                       v1       ,             m2        ,                 10
                       v2        ,            m2         ,                20
                      v2        ,             m2        ,                  15
                      v2        ,            m3         ,                  20
                      v2        ,            m3           ,                10
        Initiall the total qty field is empty i need to fill tht field for the last item for a particular material Like M1
      for vendor v1 and total qty of m2 for vendor v1, total qty of m1 for v2, total qty of m2 for v2 and so on.
    Requied output should be like this.
                     Vendor     ,          Material       ,    qty(individual)            Total qty   Schedule dates
                      v1         ,                m1         ,         10           ,               0        
                       v1          ,              m1          ,        10           ,                 0
                       v1         ,                m1         ,         20          ,                40(101020)
                       v1        ,                 m2          ,         5           ,               0
                       v1          ,               m2           ,      10            ,              15(5+10)
                       v2          ,               m2          ,        20            ,             0    
                       v2          ,               m2           ,       15             ,              35(20+15)
                      v2           ,              m3          ,        20              ,             0
                      v2            ,              m3           ,       10              ,           30(20+10)
    Here i made one thing , i calculated the total qty of material for particular vendor.
    Like              
             Vendor                           Material                     Total Qty      
                     v1        ,                        m1            ,             40
                     v1        ,                       m2              ,            15
                     v2         ,                     m2                ,           35
                     v2          ,                    m3                 ,           30
    Finally i need the logic by using Control Events(At New   , At End of )  to adjust that total qty of a material for a particular vendor by Modifying the internal table.
    i hope my problem is clear , pls let me know if any clarifications needed. and
    code for the same .
    Thannks in advance,
    Niranjan.

    Hi,
    Solution is here.
    sort itab by vendor material.
    field-symbols: <itab> like line of itab.
    loop at itab assigning <itab>.
    on change of vendor.
    clear flag.
    endon.
    add <itab>-quanity to lw_quantiy.
    *--here pdate internal table end of each similar kind of record
    at end of.
    flag = 'x'.
    <itab>-totalqty =  lw_quantiy.
    clear  lw_quantiy
    endat.
    *--rest of record update zero by checking flag
    if flag is initial.
    <itab>-totalqty = 0.
    endif.
    endloop.
    close this thread if you got solution.
    Regards,
    Peranandam

  • Internal table data issue

    i have a internal table i_final in program 1 and this internal table data need to be input of other program, so how i need to pass the i_final data to other program.

    this is the code in program 1:
      ENDIF.
    **appending work area to internal table.
        APPEND wa_final TO i_final.
      ENDLOOP.
      EXPORT i_final to memory id 'zfinal'.
    this is the code in program 2:
    TYPES: BEGIN OF t_final,
          bukrs TYPE bkpf-bukrs,
          belnr TYPE bkpf-belnr,
          blart TYPE bkpf-blart,
          xblnr TYPE bkpf-xblnr,
          ebeln TYPE ekbe-ebeln,
          ebelp TYPE ekbe-ebelp,
          belnr1 TYPE ekbe-belnr,
          xblnr1 TYPE ekbe-xblnr,
          ebeln1 TYPE ekko-ebeln,
          exnum TYPE ekko-exnum,
          lands TYPE ekko-lands,
          stceg_l TYPE ekko-stceg_l,
          END OF t_final.
    DATA: i_final TYPE STANDARD TABLE OF t_final WITH HEADER LINE.
    DATA: wa_final TYPE t_final.
    IMPORT i_final from memory ID 'zfinal'.
    write: i_final.
    its giving Dump.

  • Dynamic internal table column issue

    Hi
    i have ALV report with dynamic internal table.after i build the internal table and fieldcatalog i have problem  i.e. when grid is displayed then one of the column value is coming in the next column.i populated col_pos in field catalog also and in the debug mode data is populated correctly for respective columns in fieldcatalog and dynamic internal table. But when it is displayed i have this problem.
    any inputs on this?

    Hi Moorthy,
    Did you perform an ALV consistency check?
           Check the below given links as well.
    The Consistency Check - ALV Grid Control (BC-SRV-ALV) - SAP Library
    SAP ALV Consistency Check
    Regards,
    Philip.

  • Doubts in internal table logic

    Hi All,
    I have two internal table, according to the posnr value i need to add the kbetr value from the 2nd internal table and update the value in the 1st line internal table. below the example of my internal table. Here for the line item 0010 i need to calculate 10.0030.1011.00 and i need to add the value inthe 1st internal table kbeter_value. can anyone help this?
    POSNR        MATNR kbetr_value
    0010             abc
    0020             xyz
    0030             123
    POSNR     KBETR
    0010       10.00
    0010        30.10
    0010       11.00
    0010       60.30
    0020       12.64
    0020       11.32
    0030       79.46
    0030       00.00
    0030       45.3     
    by
    Mohana

    Hi Mohana,
    Its very simple ..you can do it in many ways....
    first one is in the second internal table use collect ....
    for example : 1st internal table is itab and the second is jtab .
    1. In jtab u use collect stmt to calculate the posnr values .
    loop at jtab.
      collect jtab .           " by using this u will have  0010    111.40 in jtab
    endloop.
    structure of jtab will be :
    0010    111.40
    0020    .........
    0030    ..........
    2. afterwards while printing you can use read to get those :
    loop at itab.
    read table jtab with key posnr = itab-posnr.
    if sy-subrc = 0.
    itab-ksbtr-value = itab-value .
    modify itab .
    endif.
    endloop.
    Hope you got it by now...if you any problem do reply back ....
    cheers,
    Vishnu .

  • Question on internal table logic..

    Gurus,
    I have a internal table as follows:
    it_tab:
    ID---ACTION---CHANGE
    A1-----X--
    B2----
    U
    C1-----X--
    U
    C2-----X--
    Without looping at the table, how can I find get the result that the internal table has 3 ids with ACTION ='X'
    and 1 ID with ACTION  = X and Change = U.
    Regards,
    Rajesh.

    I agree with Rob, why not loop?
    First thing without loop that comes to mind is
    Using the Read statement 4 times with index 1,2,3 & 4.
    Regards,
    DNP

  • Process Internal table -Logic

    Hi,
    My internal table has following data
    A      10     30
    A      20     50
    A      00     100
    B      20     40
    B      10     90
    I need output as
        (Lowest)   (Highest)
    A   10               100
    B   10               90
    How do we do?
    rgds
    Praveen

    Namesh,
    Program does'nt work for  3  or more records. any ideas?
    <
    report x.
    DATA: BEGIN OF ITAB OCCURS 0,
          FLD1  TYPE CHAR20,
          NUM1  TYPE I,
          NUM2  TYPE I,
          END   OF ITAB.
    *A 10 30
    *A 20 50
    *A 00 100
    *B 20 40
    *B 10 90
    *C 0  40
    *C 10 120
    ITAB-FLD1 = 'A'.
    ITAB-NUM1 = '10'.
    ITAB-NUM2 = '30'.
    APPEND ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-NUM1 = '20'.
    ITAB-NUM2 = '50'.
    APPEND ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-NUM1 = '00'.
    ITAB-NUM2 = '100'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-NUM1 = '20'.
    ITAB-NUM2 = '40'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-NUM1 = '10'.
    ITAB-NUM2 = '90'.
    APPEND ITAB.
    itab-fld1 = 'C'.
    itab-num1 = '0'.
    itab-num2 = '40'.
    append itab.
    itab-fld1 = 'C'.
    itab-num1 = '10'.
    itab-num2 = '120'.
    append itab.
    DATA: ITAB2    LIKE ITAB OCCURS 0 WITH HEADER LINE,
          ITAB_TMP LIKE ITAB OCCURS 0 WITH HEADER LINE.
    DATA: NEW_FLD TYPE C.
    LOOP AT ITAB.
      AT NEW FLD1.
        NEW_FLD = 'X'.
      ENDAT.
      IF NEW_FLD = 'X'.
        ITAB_TMP[] = ITAB[].
        DELETE ITAB_TMP WHERE FLD1 = ITAB-FLD1.
        CLEAR NEW_FLD.
        SORT ITAB_TMP BY FLD1 ASCENDING
                         NUM1 ASCENDING.
        READ TABLE ITAB_TMP INDEX 1.
        ITAB2-FLD1 = ITAB_TMP-FLD1.
        ITAB2-NUM1 = ITAB_TMP-NUM1.
        SORT ITAB_TMP BY FLD1 ASCENDING
                         NUM2 DESCENDING.
        READ TABLE ITAB_TMP INDEX 1.
        ITAB2-NUM2 = ITAB_TMP-NUM2.
        APPEND ITAB2.
      ENDIF.
    ENDLOOP.
    LOOP AT ITAB2.
      WRITE: / ITAB2-FLD1,
               ITAB2-NUM1,
               ITAB2-NUM2.
    ENDLOOP. >

  • Internal table logic

    Hi,
    I have a scenario that I am trying to work on:
    I have three internal tables itab1 itab2 and itab3, all three internal tables have same fields in them but might be different values:
    All the internal tables have three rows of data and in each row there are five fields VAL1 VAL2 VAL3 VAL4 VAL5.The requirement is I need to compare all these three tables as below:
    Compare all the fields of itab1 with itab2, if they are same then skip and if not then compare each field of itab1 to itab3, if they are same then skip and if not replace the value of itab1 field (which is different with the one on itab3)with the itab3 field value.
    can you please help me with this?
    Moderator message : Requirements dumping not allowed, show the work you have already done.  Thread locked.
    Edited by: Vinod Kumar on Mar 9, 2012 7:37 PM

    Hi Vijay,
    I started writing the code as below:
    loop at itab1 into wa_itab1.
      READ TABLE itab2 INDEX sy-index into waA_itab2.
      READ TABLE itab3 INDEX sy-index into wa_itab3.
    if wa_itab1-val1 = wa_itab2-val1.
    skip.
    else.
    if_wa_tab1-val1 = wa_itab3-val1.
    skip.
    else.
    wa_tab1-val1 = wa_itab3-val1.
    endif.
    endif.
    if wa_itab2-val1 = wa_itab2-val2.
    skip.
    else.
    if_wa_tab2-val1 = wa_itab3-val2.
    skip.
    else.
    wa_tab1-val2 = wa_itab3-val2.
    endif.
    endif.
    if wa_itab1-val3 = wa_itab2-val3.
    skip.
    else.
    if_wa_tab1-val3 = wa_itab3-val3.
    skip.
    else.
    wa_tab1-val3 = wa_itab3-val3.
    endif.
    endif.
    if wa_itab1-val4 = wa_itab2-val4.
    skip.
    else.
    if_wa_tab1-va4l = wa_itab3-val4.
    skip.
    else.
    wa_tab1-val4 = wa_itab3-val4.
    endif.
    endif.
    ENDLOOP.
    but I am not sure if whatever I have written is correct.

  • Internal table -Logic-Data manipulation

    Hi,
    I have following requirement.
    Input Internal table
    *A T1   1   3
    *A T2   4   5
    *A T3   1   2
    *B T4   1   2
    *B T5   3   6
    *B T6   1   7
    Output
    *A T1   1     3
    *A T2   4     5
    *B T6   1     7
    basically i should delete overlapping records 
    eg: since A t3 1 2 is overlapping record it should be deleted.
    report x.
    DATA: BEGIN OF ITAB OCCURS 0,
          FLD1  TYPE CHAR20,
          FLD2  type char20,
          NUM1  TYPE I,
          NUM2  TYPE I,
          END   OF ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-FLD2 = 'T1'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '3'.
    APPEND ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-FLD2 = 'T2'.
    ITAB-NUM1 = '4'.
    ITAB-NUM2 = '5'.
    APPEND ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-FLD2 = 'T3'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '2'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-FLD2 = 'T4'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '2'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-FLD2 = 'T5'.
    ITAB-NUM1 = '3'.
    ITAB-NUM2 = '6'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-FLD2 = 'T6'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '7'.
    APPEND ITAB.
    LOOP At ITAB.
    ENDLOOP.

    Hi Praveen,
    You have to SORT the internal table ITAB by a field of your requirement. Then DELETE adjacent entries in the internal table by comparing the field of interest.
    SORT ITAB BY NUM1 NUM2.
    DELETE ADJACENT DUPLICATES FROM ITAB COMPARING NUM1 NUM2.
    After doing this you can perform the required actions on ITAB.
    Hope this has cleared your doubt.
    Thanks & Regards,
    Ramya Shree.M.R

  • Internal table Logic need

    Hi ,
    I have one Internal table it_marc contains the MATNR
    and one more final internal table it_final. I want to read the all MATNR from IT_FINAL by using IT_MARC which contains the same MATNR. I mean all the MATNRs even dupliacates also.
    regards,
    Ajay

    Hi,
    Use For all entries.
    Select matnr from it_marc
                        into corresponding fields of  table it_final
                        for all entries in it_marc[]
                        where matnr = it_marc[]-matnr.
    Please give me ur need exactly, so that we can better understand ur que.
    Reward if Helpful.
    Jagadish.

Maybe you are looking for

  • Need help with new Time Capsule/Airport express setup!

    I just hooked up a 500g time capsule to replace an airport extreme, and now my airport utility on my MacbookPro Retina no longer recognizes the airport expresses I had on my network for airplay purposes.  Can anyone help with this issue?

  • Transfer Requirement not getting created

    Hi All, My query as below; Production order is created using KANBAN (Control Cycle/Supply Area is defined) using classic KANBAN. WM is in place and all the setting related to TR/TO creation for WM movement type 103 is in place. When i am trying to re

  • How well does website filter work in parental controls?

    Hello there, I'm curious to know how well the adult filter works ok the ios7 built in parental controls. I noticed they have a websites option now to filter different levels of the internet. Does this also work across the entire device in 3 party in

  • TS1363 My Itunes wont complete the udate, how do i fix???

    My itunes  doesn't complete the update.  So i am unable to connect my new ipods to my account Dont know what to do???

  • Can't active IOS 6.0 3GS

    I have jarlbroken and restorted many times but it stuck on no SIMCARD support. Any solution? thanks