Skip to Content
0
Former Member
Aug 03, 2006 at 06:19 PM

smartforms--code

28 Views

Hi,

I want to get Summation IVA Retenido(konv-kbetr) from Document Condition (VBAK-KNUMV) and line item (VBAP-POSNR), where Condition type KONV-KSCHL = ‘ZIVA’.

I wrote the code like this.i have no experince in coding

DATA: GT_konv type konv occurs 0 with header line.

SELECT * FROM KONV into TABLE GT_KONV

for all entries in it_vbdpa

WHERE KNUMV = IS_VBDKA-KNUMV

AND KPOSN =

It_vbdpa-POSNR.

sort gt_konv by kposn kschl.

clear g_konv.

IF SY-SUBRC = 0.

read table gT_konv INTO G_KONV with key kposn = gs_vbdpa-posnr

kschl = 'ZIVA'

binary search.

G_KBETR = G_KONV-KBETR + GS_KBETR .

ENDIF.

please check and give me some suggestion.

Thanks

Rahul