11 Replies Latest reply: Sep 26, 2006 11:42 AM by Guest RSS

append corresponding fields of table

k c
Currently Being Moderated

hi all,

 

good day,

 

can any one tell me,

what append corresponding fields of table does?

 

thanks,

kcc

  • Re: append corresponding fields of table
    Currently Being Moderated

    if the fields are same then it will append those fields only

     

    append corresponding fields of itab1 to itab2.

     

    suppose say itab1 has matnr and maktx fields and

                itab1 has matnr and vbeln.

     

    the above append statement will append only matnr field as the fielnames are same in both tables

    • Re: append corresponding fields of table
      kishan negi
      Currently Being Moderated

      Append line to Table .

      1st search the corresponding field in table and than append  this  field  of table  with ur  internal table same field value.

      performance  wise  it  is  not advisable becoz it 1st search for same field in table..

      advisable  it  use into table only for this just arrenge fields in interal table  in same manner  as u declare it in table.

       

       

       

      • Re: append corresponding fields of table
        k c
        Currently Being Moderated

        hi kishan,

         

        thanks for your response,

         

        SELECT   budat hkont belnr shkzg wrbtr FROM bsis

                  INTO CORRESPONDING FIELDS OF TABLE it_temp

                  WHERE hkont = w_glacct  "wa_cb-gl_account

                  AND bukrs IN (so_bukrs-low)

                  AND budat <  so_date-low.

         

                  SELECT budat hkont belnr shkzg wrbtr FROM bsas

                  APPENDING CORRESPONDING FIELDS OF TABLE it_temp

                  WHERE hkont = w_glacct  "wa_cb-gl_account

                  AND bukrs IN (so_bukrs-low)

                  AND   budat <  so_date-low.

         

        please,check it out,

        regards,

        kcc

        • Re: append corresponding fields of table
          Currently Being Moderated

          change the one in bold

           

          SELECT budat hkont belnr shkzg wrbtr FROM bsis
          INTO CORRESPONDING FIELDS OF TABLE it_temp
          WHERE hkont = w_glacct "wa_cb-gl_account
          <b>AND bukrs IN so_bukrs</b>
          AND budat < so_date-low.
          
          SELECT budat hkont belnr shkzg wrbtr FROM bsas
          APPENDING CORRESPONDING FIELDS OF TABLE it_temp
          WHERE hkont = w_glacct "wa_cb-gl_account
          <b>AND bukrs IN so_bukrs</b>
          AND budat < so_date-low.

           

    • Re: append corresponding fields of table
      k c
      Currently Being Moderated

      hi chandra,

       

      as you told,

      there are no two itabs,itab1,itab2,

      there is only itab1,

       

      now,what will it do?

       

      regards,

      kcc

  • Re: append corresponding fields of table
    Anversha s
    Currently Being Moderated

    hi,

     

    firstly a basic knowledge.

     

    never use CORRESPONDING .

     

    it will result in low performance.

     

    fetch only the records u want from from data base.

     

    create the internal table in the same order.

     

    then use <b>INTO TABLE</b>

     

     

    <b>INTO CORRSEPONING</b> will serch for the field names in the internal table, and will insert.

     

    so evn if the internal structure is in differnt order,it will work. but it will rslt in low performace.

     

    rgds

    anver

     

    if hlped mark points

  • Re: append corresponding fields of table
    Currently Being Moderated

    can you show ur complete code or part of the code where append statement is used

    • Re: append corresponding fields of table
      k c
      Currently Being Moderated

      hi chandra,

       

      SELECT   budat hkont belnr shkzg wrbtr FROM bsas

                   APPENDING CORRESPONDING FIELDS OF TABLE it_temp WHERE hkont = w_glacct  "wa_cb-gl_account

                   AND bukrs IN (so_bukrs-low)

                   AND   budat <  so_date-low.

      thanks,

      kcc

      • Re: append corresponding fields of table
        kishan negi
        Currently Being Moderated
        SELECT budat hkont belnr shkzg wrbtr FROM bsas
        into CORRESPONDING FIELDS OF TABLE it_temp WHERE hkont = w_glacct "wa_cb-gl_account
        AND bukrs IN (so_bukrs-low)
        AND budat < so_date-low.

         

        <b>when u use into table  there is  no need  for  use  append statement.</b>

         

         

         

      • Re: append corresponding fields of table
        Currently Being Moderated

        Hi,

         

        your it_temp may contain additional fields other than that u had mentioned in select(i.e  budat hkont belnr shkzg wrbtr)

         

        so if we use corresponding , the internal table will be populated only with the fields whose names are same as mentioned in select

         

        say ur it_temp has only budat hkont belnr , so only these 3 fields will be appended to it_temp

  • Re: append corresponding fields of table
    Venkatalaxmi Vadlamani
    Currently Being Moderated

    hi,

     

    APPENDING CORRESPONDING FIELDS OF TABLE itab

     

     

     

    Effect

    Works like ... INTO CORRESPONDING FIELDS OF TABLE itab, except that the read lines are appended to the old contents of the internal table itab.

     

     

    Effect

    Works as with ... INTO TABLE itab.

     

     

    If cursor processing is introduced with OPEN CURSOR , the sequence of FETCH statements may contain different INTO clauses - within a strict context. The following rules apply:

     

    Variants 1, 4 and 6 can be combined with each other if the types of the target areas wa or the line types of the internal tables itab are identical.

     

    Variants 2, 5 and 7 can be combined with each other if the types of the target areas wa or the line types of the internal tables itab are identical.

     

    Variant 3 cannot be combined with any other variant.

     

     

     

    Whether it is better to read data into an internal table or into a work area, depends on the type of further processing: if the data is needed only once in a program, you should read it line by line into a work area using a SELECT-ENDSELECT loop. Reading the data into an internal table requires more storage and the processing speed is not increased considerably. If the data is needed more than once in a program, however, you should read it into an internal table. The disadvantage of the increased storage requirements is made up for by the advantage of a single selection.

     

     

     

    If the data is to be read into an internal table it is more cost-effective to read it in one single operation than to read it line by line into a work area and then appending it to the internal table using APPEND.

     

     

     

    The variants ... INTO CORRESPONDING FIELDS OF wa, ... INTO CORRESPONDING FIELDS OF TABLE itab, and ... APPENDING CORRESPONDING FIELDS OF TABLE itab require a slightly increased runtime - which is, however, independent of the size of the solution set - as compared with the corresponding variants without CORRESPONDING FIELDS

     

    Regards,

    Laxmi.

Actions