â2007 Dec 18 9:49 AM
Hi all,
My Requirement is like this.
1) with the shipment document number in field VFKP-REBEL (reference object in the shipment cost document header) access to VTTS (Shipments Stages) table with the corresponding VTTS-TKNUM
2)Count the records number corresponding to the same related Shipment Number (TKNUM)
3)Condition base value (KONV-KWART) = counted value - 1.
Can any one please povide me code for this.
Thanks in Advance......
â2007 Dec 19 3:57 PM
select TKNUM
FROM VFKP AS A INNER JOIN VTTS AS B
ON AREBEL = BTKNUM.
INTO IT_VFKP_VTTS
WHERE """IF ANY CONDITIONS ARE THERE..
SORT IT_VFKP_VTTS BY TKNUM.
LOOP AT IT_VFKP_VTTS.
CNT = CNT + 1.
AT END OF TKNUM.
FLAG = 'X'.
ENDAT.
IF FLAG = 'X'.
MOVE IT_VFKP_VTTS-TKNUM TO WA_COUNT-TKNUM.
MOVE CNT TO WA_COUNT-CNT.
APPEND WA_COUNT TO IT_COUNT(WHICH holds data of tknum and its count.)
clear: wa_count, cnt.
ENDIF.
ENDLOOP.
............
......tknum = ....
KONV-KWART) = wa_count-cnt-1.
these for tknum field value wise.