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: 

Routine Value

Former Member
0 Kudos

Hello friends,

I created a routine , i'm getting a problem of overlapping routine value for 2 conditions .

read table xkomv with key stunr = '103'.

IF SY-SUBRC EQ 0.

v_qty = xkomv-kawrt / 10.

if factor ne 0 .

conv_fac = ( xkomv-kbetr * factor ) / 10000000.

  • conv_fac = ( xkomv-kwert * 10000000 ) / factor .

endif.

endif.

read table xkomv with key kschl = 'ZR01'.

IF SY-SUBRC EQ 0.

  • xkomv-kbetr = ( conv_fac / v_qty ) * 100.

xkomv-kbetr = conv_fac.

  • xkomv-kpein = v_qty / 100 .

  • xkomv-kwert = conv_fac .

endif.

xkwert = ( conv_fac * v_qty ) / 100 .

clear conv_fac.

modify xkomv.

read table xkomv with key stunr = '105'.

if sy-subrc eq 0.

v_qty = xkomv-kawrt / 10.

if factor ne 0.

conv_fac = ( xkomv-kbetr * factor ) / 10000000.

endif.

endif.

read table xkomv with key kschl = 'ZR02'.

IF SY-SUBRC EQ 0.

xkomv-kbetr = conv_fac.

endif.

xkwert = ( conv_fac * v_qty ) / 100 .

This is the code where my value is overlapping here ..

please help me out for this.

Thanks& Regards

Lavanya

3 REPLIES 3

Former Member
0 Kudos

Yes, The Code is similar to both STUNR and KSCHL.

Exactly What help do u want ??

0 Kudos

Hi ,

C let me explain u clearly .I'm picking some value where STUNR is 103 and i'm calculating some value n i'm putting that value where KSCHL is ZR01 ok . n next where stunr is 105 ...calculating something and putting that where kschl is ZR02.ok .now that final value is overlapping here ..

Former Member
0 Kudos

I think u shud write them in 2 routines.

i.e different routines for 103 and 105.

awrd points if useful

Bhupal