2007 Oct 12 9:51 AM
Hi all
I have used control breaks with in my internal table
SORT T_QUOT BY ERNAM.
BREAK-POINT.
LOOP AT T_QUOT INTO H_QUOT .
AT NEW ERNAM.
H_DISP-ERNAM = H_QUOT-ERNAM.
CLEAR V_CNT.
ENDAT.
V_CNT = V_CNT + 1.
AT END OF ERNAM.
SUM.
H_DISP-ORDER = H_QUOT-ORDER.
H_DISP-LOST = H_QUOT-LOST.
H_DISP-OPEN = H_QUOT-OPEN.
H_DISP-TOTAL = V_CNT.
APPEND H_DISP TO T_DISP.
ENDAT.
In this even though there is no end of ernam, it enters. I am working on 4.6c version. can any body tell why it would be behaving this way.
regards
AJ
2007 Oct 12 9:56 AM
what is the order of fields in your int table.
make ERNAM the first field
I had to Put ERNAM as the first field in order , in my internal table
cheers
AJ
2007 Oct 12 9:56 AM
what is the order of fields in your int table.
make ERNAM the first field
2007 Oct 12 10:00 AM
Your requirement is not clear could you please elaborate the same.
2007 Oct 12 10:04 AM
Hi ..
If the ERNAM is the First field of ur internal table then it works properly.
So check the declaration of ITAB and Change it accordingly. i.e make the ERNAM as the First field.
Reward if Helpful.
2007 Oct 12 10:06 AM
Your ernam field should be first field of internal table.
Clear ernam before appending. Because I feel you should have to do the total for each ernam.
EX: H_DISP-TOTAL = V_CNT.
Clear: ernam.
APPEND H_DISP TO T_DISP.
2007 Oct 12 10:07 AM
Your ernam field should be first field of internal table.
Clear ernam before appending. Because I feel you should have to do the total for each ernam.
EX: H_DISP-TOTAL = V_CNT.
Clear: v_cnt.
APPEND H_DISP TO T_DISP.
2007 Oct 12 10:22 AM
Hi
see this program you can undestran easily
Using AT FIRST , AT NEW, AT THE END OF , AT LAST.
DATA: BEGIN OF ITAB OCCURS 0,
F1 TYPE I,
F2(6) TYPE C,
F3(10) TYPE N,
F4(16) TYPE P DECIMALS 2,
END OF ITAB.
DATA: SUB_TOT(10) TYPE P DECIMALS 3.
**--1
ITAB-F1 = 1.
ITAB-F2 = 'ONE'.
ITAB-F3 = 10.
ITAB-F4 = '1000.00'.
APPEND ITAB.
CLEAR ITAB.
ITAB-F1 = 1.
ITAB-F2 = 'ONE'.
ITAB-F3 = 20.
ITAB-F4 = '2000.00'.
APPEND ITAB.
CLEAR ITAB.
ITAB-F1 = 1.
ITAB-F2 = 'ONE'.
ITAB-F3 = 30.
ITAB-F4 = '3000.00'.
APPEND ITAB.
CLEAR ITAB.
*--2
ITAB-F1 = 2.
ITAB-F2 = 'TWO'.
ITAB-F3 = 10.
ITAB-F4 = '1000.00'.
APPEND ITAB.
CLEAR ITAB.
ITAB-F1 = 2.
ITAB-F2 = 'TWO'.
ITAB-F3 = 20.
ITAB-F4 = '2000.00'.
APPEND ITAB.
CLEAR ITAB.
*-- 3
ITAB-F1 = 3.
ITAB-F2 = 'THREE'.
ITAB-F3 = 10.
ITAB-F4 = '1000.00'.
APPEND ITAB.
CLEAR ITAB.
ITAB-F1 = 3.
ITAB-F2 = 'THREE'.
ITAB-F3 = 20.
ITAB-F4 = '2000.00'.
APPEND ITAB.
CLEAR ITAB.
SORT ITAB BY F1.
LOOP AT ITAB.
AT FIRST.
WRITE: /35 ' MATERIAL DETAILS:'.
ULINE.
ENDAT.
AT NEW F1.
WRITE: / 'DETAILS OF MATERIAL:' COLOR 7 , ITAB-F1.
ULINE.
ENDAT.
WRITE: / ITAB-F1, ITAB-F2, ITAB-F3, ITAB-F4.
SUB_TOT = SUB_TOT + ITAB-F4.
AT END OF F1.
ULINE.
WRITE: / 'SUB TOTAL :' COLOR 3 INVERSE ON, SUB_TOT COLOR 3 INVERSE ON.
CLEAR SUB_TOT.
ENDAT.
AT LAST.
SUM.
ULINE.
WRITE: 'SUM:', ITAB-F4.
ULINE.
ENDAT.
ENDLOOP.
<b>Reward if useful</b>
2007 Oct 12 10:29 AM
Hi , AJ.
I have met the some problems when using SUM in at end of. But I can't understand your purpose fully.
Could you give me more information?For example , share your code , or tell us the structure of the internal table ERNAM.
SUM only counts the numeric fields, like P, I, F. And the results will in H_QUOT.
I think your code is right,.If you have solved this problem,please reply me.
2007 Oct 12 12:29 PM
I had to Put ERNAM as the first field in order , in my internal table
cheers
AJ
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |