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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / manoranjan
use control break statements.
AT END OF ID = 10
SUM .
ENDAT.
LIKE THIS U CAN GROUP ALL RECORDS.
Is This Answer Correct ? | 0 Yes | 0 No |
what is OSS?please answer if anybody knows
How to combine multiple order in one Delivery ( Step by Step)?
Pls tell me, we r using at line-selection,at user-command and at pf-status for generating the secondary list in report then what we will use in ALV for generating alv list. pls tell me what r the important thing to read in alv for interview purpose.
what is check table..what is domain?
I have a table with 400 recs. among some are duplicate records. how can I remove the duplicate records from the table. pls help me out.
What is the collect statement? How is it different from append?
What are authorization objects and what statement is used to perform an authorization check in an abap program?
What are internal tables? How to use a specific number occurs statement?
what is code review, when u can do?
How can the standard tables of sap be modified?
Explain the uses of the simple maintenance interface? : sap abap hr
What do you do when the system crashes in the middle of a BDC batch session?