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

condition value change

Former Member
0 Likes
2,475

Hello Everyone,

I have written the below code :-

FORM FRM_KONDI_WERT_999.

IF XKOMV-KAPPL = 'V' AND XKOMV-KRECH = 'C'.

XKomv-kwert  = XKOMV-KBETR * komp-mgame / 1000 .

XKWERT =  XKOMV-KBETR * komp-mgame / 1000 .

Field-symbols: <rettkomv> type KOMV_INDEX.

constants: c_rettkomv type char20 value '(SAPLV61A)RETTKOMV'.

assign (c_rettkomv) to <rettkomv>.

LOOP AT XKOMV ASSIGNING <RETTKOMV> .

<RETTKOMV> = XKOMV.

ENDLOOP.

ENDIF.

ENDFORM.

The issue was to change the condition value in billing invoice item .

The value was not getting changed because it was getting reset due to xkomv= rettkomv.

Now when i use field symbols my condition type is getting repeated again and again and all other condition types have disappeared ,

Why is is behaving like this . Any help.

Pooja

8 REPLIES 8
Read only

paul_bakker2
Active Contributor
0 Likes
1,577

This loop is your problem:

LOOP AT XKOMV ASSIGNING <RETTKOMV> .

<RETTKOMV> = XKOMV.

ENDLOOP.

It is replacing every line in table XKOMV with the (unchanging) values in the structure 'XKOMV'.

So you will end up with every table line being the same.

cheers

Paul

Read only

0 Likes
1,577

Thank you so much for replying .

Yes, i could figure out that now .

How can I use field symbols to avoid

rettkomv= xkomv

resetting the value of

xkwert = xkomv-kwert .

Apart from using implicit enhancement .

Thanks

Pooja

Read only

0 Likes
1,577

How can I use field symbols to avoid

rettkomv= xkomv

resetting the value of

xkwert = xkomv-kwert .

Sorry Pooja, but I don't understand your question.

The execution of the first statement (rettkomv= xkomv) has no effect on the variables

in the second statement (xkwert = xkomv-kwert)

Please explain?

cheers

Paul

Read only

0 Likes
1,577

Hello Paul,

I am writing a routine in VOFM to change the value of xkwert in billing .

But due to statement

rettkomv= xkomv in the sap standard program , no matter what code I write the values are reset .

The solution I found on SCN forum is by using field symbols . That is what I am trying to do . I have explained the issue in the starting .

Thanks

Pooja

Read only

former_member210541
Active Participant
0 Likes
1,577

Hi,

Is your routine a RV61 type or a RV63 ?

I mean if it is condition value or a condition base value?

If it is not a condition base value, then you need to change it to condition base value and also do the config at condition type with "Manual entry has priority".

Hope this helps.

Read only

0 Likes
1,577

Hello Tee,

Thanks for the reply .

It is a RV64A type and a condition value formula .

pooja

Read only

0 Likes
1,577

change it to condition base value and also do the config at condition type with "Manual entry has priority".

Read only

0 Likes
1,577

Thanks Tee . I will try and update .