2007 Jan 17 10:37 AM
Hi
i have to use command : AT END OF DATE MATDEPTH
ENDAT
DATE IS OF DATA TYPE : DATS
MATDEPTH IS OF TYPE : CHAR
all data is collected in internal table.
at the moment i am just using AT END OF MATDEPTH.
can i use both date and matdepth to display the requirment.???
able to display data for a date and matdepth using AT end of command..
pls give sample code
Thxs,
Vind
2007 Jan 17 10:43 AM
1.No need to use both the fields in AT END
2.place the first 2 fields as MATDEPTH and DATE .
3.SORT ITAD BY MATDEPTH DATE .
4. then use AT END OF DATE.
5. Now it will work according to ur rewuirement
Hi,
You can use Both fields, but these fields should be sorted before using in the AT END OF.
Regards
Sudheer
2007 Jan 17 10:43 AM
1.No need to use both the fields in AT END
2.place the first 2 fields as MATDEPTH and DATE .
3.SORT ITAD BY MATDEPTH DATE .
4. then use AT END OF DATE.
5. Now it will work according to ur rewuirement
2007 Jan 17 10:46 AM
control breaks with two fields is not possible .
like AT END OF F1 F2.
You can treat the same independently like AT END OF F1. and AT END OF F2 in the same loop .
Alternate to this is <i>On change of F1 or F2.</i> " you can try this.
Demo code will be ..
data : begin of itab occurs 0,
f1(4) type c,
f2(4) type c,
end of itab.
data : begin of Jtab occurs 0,
f1(4) type c,
f2(4) type c,
f3(4) type c,
end of Jtab.
DATA : CNT TYPE I.
DATA: GV_FLAG TYPE C.
itab-f1 = 'A'.
itab-f2 = '10'.
APPEND ITAB.
itab-f1 = 'A'.
itab-f2 = '10'.
APPEND ITAB.
itab-f1 = 'A'.
itab-f2 = '10'.
APPEND ITAB.
itab-f1 = 'B'.
itab-f2 = '8'.
APPEND ITAB.
itab-f1 = 'B'.
itab-f2 = '8'.
APPEND ITAB.
itab-f1 = 'B'.
itab-f2 = '8'.
APPEND ITAB.
SORT ITAB BY F1 F2. "use this
LOOP AT ITAB.
CNT = CNT + 1.
AT END OF F1. "apply here
GV_FLAG = 'X'.
ENDAT.
IF GV_FLAG = 'X'.
JTAB-F1 = ITAB-F1.
JTAB-F2 = ITAB-F2.
JTAB-F3 = CNT.
APPEND JTAB.
CLEAR JTAB.
CLEAR: CNT , GV_FLAG.
ENDIF.
ENDLOOP.
LOOP AT JTAB.
WRITE:/ JTAB-F1 , JTAB-F2, JTAB-F3.
ENDLOOP.regards,
vijay
2007 Jan 17 10:47 AM
Hi,
You can use Both fields, but these fields should be sorted before using in the AT END OF.
Regards
Sudheer
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |