we want to add similar taxes and taxes amount also
eg: item at 10 service tax(10.20%) = 10
item at 20 service tax(4.20%) = 4.8
item at 30 service tax(10.20%) = 10
here we want item 10 and item 30 amount to be added and that should be display in only one line like below
ieg:service tax(10.20%) = 20
service tax(4.20%) = 4.8.
for the below code we are getting output like this
eg:item at 10 service tax(10.20%) = 10
item at 20 service tax(4.20%) = 4.8
item at 30 service tax( 10.20%) = 10
but we want like this
eg:service tax(10.20%) = 20
service tax(4.20%) = 4.8.
*break-point
Determine Excise Duty
CLEAR: g_vtext,g_kwert,l_kwert.
data: l_vat type ty_tax occurs 0 with header line.
data: l_stax type ty_tax occurs 0 with header line.
data: l_saltax type ty_tax occurs 0 with header line.
data: s_tax1 type ty_tax occurs 0 with header line.
data: s_tax type ty_tax occurs 0 with header line.
data : TAXCOM like TAXCOM.
data: begin of t_komv occurs 0.
include structure komv.
data: end of t_komv.
move-corresponding <fs> to TAXCOM.
taxcom-BUDAT = zxekko-BEDAT.
taxcom-BlDAT = zxekko-BEDAT.
taxcom-kposn = <fs>-EBELP.
taxcom-WAERS = taxcom-HWAER = zxekko-WAERS.
taxcom-XMWST = 'X'.
taxcom-WRBTR = <fs>-netwr.
taxcom-mglme = <fs>-menge.
taxcom-SHKZG = 'H'.
taxcom-lifnr = zxekko-lifnr.
taxcom-ekorg = zxekko-ekorg.
taxcom-land1 = zxekko-lands.
*break-point.
CALL FUNCTION 'CALCULATE_TAX_ITEM'
EXPORTING
ANZAHLUNG = ' '
DIALOG = ' '
DISPLAY_ONLY = ' '
INKLUSIVE = ' '
I_ANWTYP = ' '
I_DMBTR = '0'
I_MWSTS = '0'
I_TAXCOM = taxcom
PRUEFEN = ' '
RESET = ' '
IMPORTING
E_NAVFW =
E_TAXCOM =
E_XSTVR =
NAV_ANTEIL =
TABLES
T_XKOMV = t_komv
EXCEPTIONS
MWSKZ_NOT_DEFINED = 1
MWSKZ_NOT_FOUND = 2
MWSKZ_NOT_VALID = 3
STEUERBETRAG_FALSCH = 4
COUNTRY_NOT_FOUND = 5
OTHERS = 6
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*******BGS221205
DOCTYPE = ZXEKKO-BSART.
*******BGS221205
loop at t_komv where kposn = <fs>-ebelp.
SELECT SINGLE vtext INTO g_vtext FROM t685t
WHERE spras = sy-langu
AND kschl = t_komv-kschl.
IF g_vtext CS '%'.
MOVE t_komv-kwert TO g_kwert.
ADD: g_kwert TO g_excise.
CLEAR g_kwert.
ENDIF.
*********BGS211205
IF ( T_KOMV-KSCHL = 'JSRE' OR T_KOMV-KSCHL = 'JSRF' ).
MOVE T_KOMV-KWERT TO G_KWERT.
ADD: G_KWERT TO G_TAX.
CLEAR G_KWERT.
ENDIF.
*********BGS211205
Determin tax for Non Service PO
if ( t_komv-kschl = 'JIPL' ).
ADD: t_komv-kwert TO G_SLTAX.
l_saltax-item_no = t_komv-kposn.
l_saltax-amt = t_komv-kwert.
l_saltax-per = t_komv-kbetr / 10.
append l_saltax to it_saltax.
endif.
*laxman
*if ( t_komv-kschl = 'JIPC' or t_komv-kschl = 'JVRD' ).
ADD: g_vat to g_kwert.
*endif.
if ( t_komv-kschl = 'JIPC' or t_komv-kschl = 'JVRD' ).
vat tax
if ( t_komv-MWSK1 = 'C4' OR t_komv-MWSK1 = 'C3' OR t_komv-MWSK1 = 'C6' OR
t_komv-MWSK1 = 'B4' OR t_komv-MWSK1 = 'B5' ). "OR t_komv-MWSK1 = 'AT'
ADD: t_komv-kwert TO G_VAT.
l_vat-item_no = t_komv-kposn.
l_vat-amt = t_komv-kwert.
l_vat-per = t_komv-kbetr / 10.
append l_vat to it_vat.
ELSE.
ADD: t_komv-kwert TO G_SLTAX.
l_saltax-item_no = t_komv-kposn.
l_saltax-amt = t_komv-kwert.
l_saltax-per = t_komv-kbetr / 10.
append l_saltax to it_saltax.
endif.
endif.
calculation for non creditable service tax (GSPC)
IF ( t_komv-kschl = 'JSRE' OR t_komv-kschl = 'JSRF' OR
t_komv-kschl = 'JSER' OR t_komv-kschl = 'JSVD' OR
t_komv-kschl = 'JSRC' OR t_komv-kschl = 'JSRD' ).
MOVE t_komv-kwert TO g_kwert.
ADD: g_kwert TO g_tax.
CLEAR g_kwert.
endif.
calculation for creditable service tax (GSPL)
IF ( t_komv-kschl = 'JSRE' OR t_komv-kschl = 'JSRF' ).
MOVE t_komv-kwert TO g_kwert.
ADD: g_kwert TO g_tax.
CLEAR g_kwert.
endif.
Excise calculation for GSPL
IF ( t_komv-kschl = 'JMX1' or t_komv-kschl = 'JEX1' ).
MOVE t_komv-kwert TO g_kwert.
ADD g_kwert TO g_excise1.
CLEAR g_kwert.
ENDIF.
*IF ( t_komv-kschl = 'JIPC' ).
MOVE t_komv-kwert TO g_kwert.
ADD g_kwert TO g_excise1.
CLEAR g_kwert.
*ENDIF.
*service tax calculation loop
break-point.
IF ( t_komv-waers = '%' OR t_komv-kschl = 'JSRE' OR
t_komv-kschl = 'JSRF' ).
IF t_komv-kschl = 'JSRE' .
g_percentage = t_komv-kbetr / 10.
move g_percentage to l_stax-per.
add: l_stax-per to s_tax.
ELSE.
g_percentage1 = t_komv-kbetr / 10.
ENDIF.
add t_komv-kwert to l_stax-amt.
add l_stax-amt to g_percentage1.
ENDIF.
*
IF ( t_komv-waers = '%' OR t_komv-kschl = 'JSER' OR
t_komv-kschl = 'JSVD' ).
IF t_komv-kschl = 'JSER' .
g_percentage = t_komv-kbetr / 10.
ELSE.
g_percentage1 = t_komv-kbetr / 10.
ENDIF.
add t_komv-kwert to l_stax-amt.
*
*
ENDIF.
*break-point.
IF ( t_komv-waers = '%' OR t_komv-kschl = 'JSRC' OR
t_komv-kschl = 'JSRD' ).
IF t_komv-kschl = 'JSRC' .
g_percentage = t_komv-kbetr / 10.
ELSE.
g_percentage1 = t_komv-kbetr / 10.
ENDIF.
add t_komv-kwert to l_stax-amt.
ENDIF.
*
IF ( ( g_percentage IS NOT INITIAL AND
g_percentage1 IS NOT INITIAL ) AND
( t_komv-kschl = 'JSRE' OR t_komv-kschl = 'JSRF' OR
t_komv-kschl = 'JSER' OR t_komv-kschl = 'JSVD' OR
t_komv-kschl = 'JSRC' OR t_komv-kschl = 'JSRD') ).
g_mul = g_percentage * g_percentage1.
g_percentage3 = g_percentage + ( g_mul / 100 ).
l_stax-per = g_percentage3.
if l_stax-per eq l_stax.
add g_percentage to g_percentage1.
if g_percentage1 = l_stax.
g_percentage5 = l_stax-amt.
move l_stax-amt to l_stax.
append l_stax to it_stax.
endif.
clear : g_percentage, g_percentage1.
ENDIF.
ENDLOOP.