Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8944

Re: If all values in a column of internal table are same ,On which basis the sorting is carried out .?

$
0
0

Hi,

  If in internal table one coulmn value is same for all record, then if you are using sort on internal table there will be no chnage in the sequence , but if you sort on some other column value then system will sort it accordingly.

e,g.

 

    TYPES : BEGIN OF TP_ICODE,
            NAME(5)   TYPE C,
            VALUE      TYPE I,
          END OF TP_ICODE.

  DATA : WA_ICODE  TYPE TP_ICODE,
         IT_ICODE  TYPE STANDARD TABLE OF TP_ICODE.
*
*
     CLEAR : WA_ICODE.

      WA_ICODE-NAME    = 'John'.
      WA_ICODE-VALUE   = '2000'.
      APPEND WA_ICODE TO IT_ICODE.

      WA_ICODE-NAME    = 'John'.
      WA_ICODE-VALUE   = '1020'.
      APPEND WA_ICODE TO IT_ICODE.

      WA_ICODE-NAME    = 'John'.
      WA_ICODE-VALUE   = '1520'.
      APPEND WA_ICODE TO IT_ICODE.

      WA_ICODE-NAME    = 'John'.
      WA_ICODE-VALUE   = '1620'.
      APPEND WA_ICODE TO IT_ICODE.


      SORT IT_ICODE.                  "check sequence after this
      sort it_icode by value.            ""check sequence after this

      BREAK-POINT.

 

Regards,

Zafar


Viewing all articles
Browse latest Browse all 8944

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>