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

Re: How to write a most repeating entry in a table?

$
0
0

Hi Ghani,

 

SELECT CITYFROM FROM SPFLI INTO TABLE TAB.

IF SY-SUBRC = 0.

     LOOP AT ITAB INTO WA.

          L_COUNT = L_COUNT + 1.

          AT LAST WA-CITYFROM.

               WA1-CITY      = WA-CITYFROM.

               WA1-COUNT  = L_COUNT.

               APPEND WA1 TO LT_RESULT.

               CLEAR L_COUNT.

          ENDAT.

     ENDLOOP.

ENDIF.

 

SORT LT_RESULT BY COUNT.

READ LT_RESULT INTO WA1 INDEX 1.

WRITE WA1.

 

 

Regards,

Vijay


Viewing all articles
Browse latest Browse all 8581

Trending Articles



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