Skip to Content
0
Former Member
Jul 19, 2007 at 11:58 AM

Which is more efficient???

17 Views

Hi ,

Which is more efficient??

1)

 TYPES: BEGIN OF l_ty_custab1,
         bukrs TYPE bukrs,       "Compnay code
         hkont TYPE hkont,       "General Ledger Account
         END OF l_ty_custab1.

  DATA: l_ih_custab1 TYPE HASHED TABLE OF l_ty_custab1
        WITH UNIQUE KEY bukrs hkont.

  FIELD-SYMBOLS: <l_wa_custab1> TYPE ty_custab1.
  " WA for master customer int table
  DATA: l_wa_custab1 TYPE l_ty_custab1.
  " WA for local int table to be used in "for all entries"

    LOOP AT fp_i_custab1 ASSIGNING <l_wa_custab1>.
      l_wa_custab1-bukrs = <l_wa_custab1>-bukrs.
      l_wa_custab1-hkont = <l_wa_custab1>-hkont.
      COLLECT l_wa_custab1 INTO l_ih_custab1.
    ENDLOOP.

or



  DATA: fp_i_custab1  TYPE STANDARD TABLE OF ty_custab1.
  SORT fp_i_custab1 by  bukrs hkont.
  DELETE ADJACENT DUPLICATE ENTRIES FROM fp_i_custab1 COMPARING
                                                              bukrs hkont.