Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How Group 10 sets of records per group of Internal Table in ABAP.

Good Afternoon All,
I have one internal table which have 400 records ,i need to group these records in set of 10 records .
for example:
ID value
2 100
1 95
3 90
4 85
6 80
7 75
8 70
10 65
9 60
----------------------------------
Total : 720---------------------------------------1st group
-------------------------------
11 59
13 58
12 55
14 54
15 52
18 51
16 50
17 49
19 40
20 39
-------------------------------
Total : 507 -----------------------2nd Group
------------------------------
..........
..........
........

please help me ....how i get this in abap.

Thanks

Answer Posted / prakash

CLEAR:lv_lines,lv_n,lv_mod,lwa_final,lv_p,lv_ch,lv_a,lv_b..

SORT lit_final BY vtweg vkorg vkbur pltyp matnr.

DESCRIBE TABLE lit_final LINES lv_lines.


lv_p = lv_lines / 10.

lv_ch = lv_p.

SPLIT lv_ch AT '.' INTO lv_a lv_b.

IF lv_b NE '00'.
lv_n = lv_a + 1.
ELSE.
lv_n = lv_a.
ENDIF.


lv_mod = lv_lines MOD 10.

lit_finaltp[] = lit_final[].


DO lv_n TIMES.

lit_final[] = lit_finaltp[].

REFRESH : lit_finalt[],lit_finaltp[].
CLEAR : lwa_finaltt.

LOOP AT lit_final INTO lwa_final.

IF sy-tabix LE 10.
APPEND lwa_final TO lit_finalt.
MOVE-CORRESPONDING lwa_final TO lwa_finaltt.
CLEAR lwa_final.
ELSE.
APPEND lwa_final TO lit_finaltp.
CLEAR lwa_final.

ENDIF.

ENDLOOP.

lit_final[] = lit_finalt[].

ENDDO.

You have to do the sum in a variable and print the sum

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is table buffer?

992


How to upload data using catt ? : abap hr

1115


what is abstract classes

1321


What are the disadvantages of abap query tool?

1243


What are pool tables?

1074


What are the events driven batch jobs?

1046


What is the use of lock objects?

1048


What are the two statements which are required in an abap program to output an icon using a write statement?

1276


Explain the Types of Select statements?

1070


Can we include customizing include or an append structure with pooled or cluster tables?

1162


Does the external program run in the same sap luw as the caller, or in a separate one?

1110


How do you read files from the presentation server ? : abap bdc

1071


What is asynchronous update?

1021


What are the dynapro keywords?

1122


What is new enhancement framework?

1324