on 08-06-2009 8:54 AM
hi sapscript masters,
i have a problem with the clearing of the VAT.
i have four line items with the value of 10000,10000,10000,10000 and the vat of the 4line items is 5600.
so am getting the correct vat where am happy with but the problem is using the transaction me22n i create the line items and and i get the VAT correctly but ...
once i see the vat and the total , i just go back and want to c again but now the VAT is increasing the double the vat .For ex the vat is 5600, so when i come next time it becomes 11200. its because the vat is not cleared when i come next time.
so i declared it globally and am clearing like this:
data: ka_kawrt like komvd-kawrt.
clear ka_kawrt. " clearing the vat amount.
clear output_table.
but when i debug and see my clear statement is not triggering as result i get double the amount of the vat.
so where can clear so that it can clear the old vat.
i try to stop and c where it gets stoped but it stops only at my subroutine and no where else to CLEAR the VAT.
please let me know if you have any idea as to where to CLEAR.
Thanks,
pasala.
answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
first check the variable name for VAT which you are printing in FORM, then find the variable in Print program. Now, before calculating the value just CLEAR the variable..
Hope it helps!!
Rgds,
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhasker,
you can clear the vat before calculating it,i.e just clear it in the top before calculation part.
so each time it first clears and then calculate the vat according to your condition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi suresh,
if that is the case i will only get one line item vat which is : 1400. because it clears the other vats before it looks into other line item.
i want the vat to as it is and calculate it according to the line items. in my case i would get 5600
when clear in subroutine it clears and what i left is the last value.
i want it to clear globally... please tell me how clear globally.
Hi Basker,
if you are calculating the vat each time from outside perform then try something like this,
select ebeln ebelp from ekpo into CORRESPONDING FIELDS OF TABLE t_ebeln
where ebeln = v_ebeln
and loekz NE 'L'.
READ TABLE t_ebeln INDEX 1.
if v_ebelp = t_ebeln-ebelp.
clear vat----------------------------->first time you clear vat then start caluculating vat
endif.
from next time onwards it won't clear vat,but for next PO it starts from first.
pass your line items in v_ebelp.
but t_ebeln-ebelp always contains the first line item no i.e 10.
hi suresh,
thanks for the reply,
i have already the vat and this how i have coded it.
if sy-subrc = 0.
lv_kawrt = lv_fwste. "VAT amount
ka_kawrt = ka_kawrt + lv_fwste.
MOVE: 'KOMVD-KAWRT' TO output_table-name.
WRITE lv_kawrt TO output_table-value(21).
WRITE ka_kawrt TO output_table-value(21).
APPEND output_table.
so each time i have a line item it takes the vat and addes so by the end of the line items i get the value such as :5600.
but when i go back and come in again i have now the double the amount.
can you please help so that i can clear.
hi bhasker,
try something like this,
if sy-subrc = 0.
cnt = cnt + 1.----------------------------->have a variable called cnt.
if cnt = 1.
clear : lv_fwste------------------------->when back just check in debugging whether cnt starts from first or it keep on adds.
endif.
lv_kawrt = lv_fwste. "VAT amount
ka_kawrt = ka_kawrt + lv_fwste.
MOVE: 'KOMVD-KAWRT' TO output_table-name.
* WRITE lv_kawrt TO output_table-value(21).
WRITE ka_kawrt TO output_table-value(21).
APPEND output_table.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.