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

how to solve below problem please help.

laxman_sankhla3
Participant
0 Likes
349

Hi

I want to display service tax for each item

I want to out put like this

Item at 10 service tax (10.20%) 10

Item at 20 service tax (4.08%) 4

Item at 30 service tax (12.24%) 12.50

But I m getting output like this

Item at 10 service tax (10.00%) 10.

Item at 20 service tax (4.08%) 4.

Item at 30 service tax (12.24%) 12.50.

Below is code what I written and also print screen is here please see it and if u fine any problem in code than tell me.

********************************************

*Changed By: B.Gokul Sharmila

*Change Key: BGS221205

********************************************

*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.

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.

break-point.

IF ( t_komv-waers = '%' OR t_komv-kschl = 'JSRE' OR t_komv-kschl = 'JSRF' ).

MOVE t_komv-kwert TO g_kwert.

ADD: g_kwert TO g_tax.

add t_komv-kbetr to l_stax-per.

l_stax-item_no = t_komv-kposn.

l_stax-amt = t_komv-kwert.

l_stax-per = t_komv-kbetr / 10.

IF t_komv-kschl = 'JSRE'.

g_percentage = t_komv-kbetr / 10.

ELSE.

g_percentage1 = t_komv-kbetr / 10.

ENDIF.

if ( g_percentage IS not INITIAL or

g_percentage1 IS INITIAL ).

g_mul = g_percentage * g_percentage1.

g_percentage3 = g_percentage + ( g_mul / 100 ).

l_stax-per = g_percentage3.

append l_stax to it_stax.

ENDIF.

CLEAR g_kwert.

endif.

ENDLOOP.

1 REPLY 1
Read only

Former Member
0 Likes
301

<b>if ( g_percentage IS not INITIAL or

g_percentage1 IS INITIAL ).</b>g_mul = g_percentage * g_percentage1.

g_percentage3 = g_percentage + ( g_mul / 100 ).

l_stax-per = g_percentage3.

append l_stax to it_stax.

ENDIF.

just check this if condition

-


if ( g_percentage IS not INITIAL or

g_percentage1 IS <b>NOT</b> INITIAL ). " is this the one missing..

-


2.

<b>Item at 10 service tax (10.20%) 10</b> " u want this to appear in ur logic

Item at 20 service tax (4.08%) 4

Item at 30 service tax (12.24%) 12.50

But I m getting output like this

Item at 10 service tax (10.00%) 10.

Item at 20 service tax (4.08%) 4.

Item at 30 service tax (12.24%) 12.50.

im not able to make out what exactly is the query can u be bit more specific.

regards,

vijay

Message was edited by:

vijay k