Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Code for Count value....Bit urgent.

Former Member
0 Likes
306

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 (Shipment’s 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......

1 REPLY 1
Read only

Former Member
0 Likes
284

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.