Application Development 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: 

How to compare the values

Former Member
0 Kudos

Hi friends,

I have a small issue in my program. Actually i selected a condition records in my internal table. Its contain knumv, kschl, kbetr. My problem is, I need to add KBETR value according to the condition type ZSPR + ZMIT. But this internal table contains ZWDC or ZWD0 (Condition types) i no need to calcualte anything just i need to put zero value for that.

So for that if i use Read statmenet how it will work? bze first i need to consider zspr value after i need consider zmit value. finally i need consider two more condition type ( ZWDC and ZWDO), can any how help this simple logic?

Mohana..

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Do Like this

You can loop at the internal table where condition type = ZSPR or condition type = ZMIT .

inside loop.

Use if condition

if wa-kschl = ZSPR or wa_kschl = ZMIT.

take variable where u wnt to store

total = wa-kbetr + total.

endif.

endloop.

Best regards,

raj S

3 REPLIES 3

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can loop at the internal table where condition type = ZSPR or condition type = ZMIT etc..

inside loop.

use case for condition type .

... do processing here ..

endcase.

endloop.

Former Member
0 Kudos

Do Like this

You can loop at the internal table where condition type = ZSPR or condition type = ZMIT .

inside loop.

Use if condition

if wa-kschl = ZSPR or wa_kschl = ZMIT.

take variable where u wnt to store

total = wa-kbetr + total.

endif.

endloop.

Best regards,

raj S

Former Member
0 Kudos

Hi,

Loop Internal table itab which Its contain knumv, kschl, kbetr.

Then Using If ENDif and Case Stmt u can add the value.

Loop at itab into wa_itab.

if wa_itab-kschl EQ 'ZSPR'

addition Logic

elseif wa_itab-kschl EQ 'ZMIT'

addition Logic

elseif wa_itab-kschl EQ 'ZWDC '

addition Logic

elseif wa_itab-kschl EQ 'ZWDO'

addition Logic

endif.

Endloop.

Same with Case Stmt

Thanks & Regards,

SShreeMohan