Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

no of rows for a particular field in internal table

$
0
0

Hello Friends

 

i want to find out the no of rows( NO OF BILLS ) for a particular field in an internal table , could any one pls let me know ,

 

pls see the screen shot and also my code

 

Thanks

Vijaya

 

1.jpg

 

TYPES : BEGIN OF ty_str,

         remit TYPE char11,

         sno(2) TYPE n,

         ddo TYPE char50,

         voucher_no(4) TYPE n,

         voucher_date TYPE d,

         amount TYPE wrbtr,

         END OF ty_str.

 

DATA : it TYPE TABLE OF ty_str,

        wa TYPE ty_str.

 

 

CLEAR wa.

wa-remit = '8782-103-03'.

wa-sno = '01'.

wa-ddo = 'xyz'.

wa-voucher_no = '0001'.

wa-voucher_date = '30062014'.

wa-amount = '379557'.

APPEND wa TO it.

 

 

CLEAR wa.

wa-remit = '8782-103-03'.

wa-sno = '02'.

wa-ddo = 'bbb'.

wa-voucher_no = '0002'.

wa-voucher_date = '30062014'.

wa-amount = '8209'.

APPEND wa TO it.

 

 

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '01'.

wa-ddo = 'abc'.

wa-voucher_no = '0001'.

wa-voucher_date = '12062014'.

wa-amount = '198315'.

APPEND wa TO it.

 

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '02'.

wa-ddo = 'bbc'.

wa-voucher_no = '0001'.

wa-voucher_date = '12062014'.

wa-amount = '105922'.

APPEND wa TO it.

 

 

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '03'.

wa-ddo = 'kkk'.

wa-voucher_no = '0007'.

wa-voucher_date = '12062014'.

wa-amount = '2042278'.

APPEND wa TO it.

 

 

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '04'.

wa-ddo = 'lll'.

wa-voucher_no = '0008'.

wa-voucher_date = '12062014'.

wa-amount = '418735'.

APPEND wa TO it.

 

 

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '05'.

wa-ddo = 'kkk'.

wa-voucher_no = '0012'.

wa-voucher_date = '12062014'.

wa-amount = '1020066'.

APPEND wa TO it.

 

 

 

SORT it BY remit DESCENDING.

 

LOOP AT it INTO wa.

 

   AT NEW remit.

     WRITE : / wa-remit.

   ENDAT.

 

 

   WRITE : / wa-sno, wa-ddo, wa-voucher_no, wa-voucher_date, wa-amount.

 

   AT END OF remit.

     SUM.

     WRITE : /65  'Total', wa-amount.

   ENDAT.

 

 

 

ENDLOOP.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



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