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

Internal Table.

Former Member
0 Likes
391

Hi,

I have written a program for tax break up by using EKKO,EKPO,KONP,KONV AND SOME J* TABLES,

BY SPECIFYING DIFFERENT CONDITIONS.

AT LAST I GOT THE DATA IN AN INTERNAL TABLE IT_FINAL.

THE STRUCTURE IS OF IT_FINAL IS.

DATA: BEGIN OF IT_FINAL OCCURS 0,

EBELN LIKE EKKO-EBELN,

EBELP LIKE EKPO-EBELP,

KNUMV LIKE EKKO-KNUMV,

KAWRT LIKE KONV-KAWRT,

MWSK1 LIKE KONV-MWSK1,

KSCHL LIKE KONV-KSCHL,

KBETR LIKE KONP-KBETR,

BASEVAL1 LIKE KONV-KAWRT,

END OF IT_FINAL.

Now, I have to display the data . But the problem is there is some final calculation in the internal table.

like

if the tax code contains 'JMO1' Condition type then we have to handle it entire differently.

and if the tax code contains 'JMO1' AND 'JIP1 or JIP2' And we have to handle it differently.

ex:

Taxcode cnd.type.

89. JMO1,

JEC1,

JA1S,

JIP1.

KBETR contains the Percentage .

KAWRT contains the Basevalue.

if it contains like the above..

FOR JM01 We calculate as normal like tax = ( KAWRT * KBETR ) / 100.

FOR JA1S,JEC1 We should take the Basevalue TAX. And calculate tax . TAX1 = ( TAX * KBETR ) / 100.

BUT FOR JIP1 BASE VALUE IS TAX + TAX1 AND PERCENTAGE IS KBETR .

IF We put a LOOP ON Internal table the HOW Can we Identify for the Taxcode 'JMO1' EXISTS AND JIP1 EXITS AND WE MAY GET THE FIRST RECORD AS JIP1.

HOW CAN WE SOLVE THIS PROBLEM ?

please help me.

It's urgent.

Bye,

satya.

3 REPLIES 3
Read only

Former Member
0 Likes
361

You can use this condition in loop:

LOOP AT IT_FINAL.

If tax_code cs 'JMO1'.

tax = ( IT_FINAL-KAWRT * IT_FINAL-KBETR ) / 100.

write tax.

endif.

if tax_code cs 'JEC1' or tax_code cs 'JEC1'.

tax = ( IT_FINAL-KAWRT * IT_FINAL-KBETR ) / 100.

tax1 = ( TAX * IT_FINAL-KBETR ) / 100.

write tax1.

endif.

if tax_code cs '

tax = ( IT_FINAL-KAWRT * IT_FINAL-KBETR ) / 100.

tax1 = ( TAX * IT_FINAL-KBETR ) / 100.

tax2 = ( (TAX + TAX1) * IT_FINAL-KBETR ) / 100.

write tax2.

endif.

ENDLOOP.

Hope I understood the problem right..

Read only

0 Likes
361

Hi,

But in the loop if the first record is JIP1 Then after that record is 'JMO1'

What about it ?

Bye,

satya.

Read only

0 Likes
361

Even then it will work.

Are you calculating cumulative tax?? do you need to calculate total tax for all the records?