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

Routine for Group Condition Pricing Condition Type.

Former Member
0 Likes
923

Hi

We have a Condition Type which is a Group Condition.

We have created a Condition Value Routine to do some calculations to recalculate the Condition Value of the Condition Type.

The Routine is getting triggered from SAP from program ude LV61AA55 from following Location

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

if xkomv-kofrm ne 0 and wertformel eq space and komp-kposn ne 0.

rettkomv = xkomv.

xkwert = xkomv-kwert.

frm_kondi_wert-nr = xkomv-kofrm.

perform (frm_kondi_wert) in program saplv61a if found.

<b> xkomv = rettkomv.</b>

endif.

Problem is Inside the routine we are not able to access Structure rettkomv and Routine is not passing the calculated value.

Can someone please tell any solution OR Any other type of routine with which we can modify the Condition Value of the Cond Type having Type as Group Type.

Thanks in Advance

Hi

We have a Condition Type which is a Group Condition.

We have created a Condition Value Routine to do some calculations to recalculate the Condition Value of the Condition Type.

The Routine is getting triggered from SAP from program ude LV61AA55 from following Location

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

if xkomv-kofrm ne 0 and wertformel eq space and komp-kposn ne 0.

rettkomv = xkomv.

xkwert = xkomv-kwert.

frm_kondi_wert-nr = xkomv-kofrm.

perform (frm_kondi_wert) in program saplv61a if found.

<b> xkomv = rettkomv.</b>

endif.

Problem is Inside the routine we are not able to access Structure rettkomv and Routine is not passing the calculated value.

Can someone please tell any solution OR Any other type of routine with which we can modify the Condition Value of the Cond Type having Type as Group Type.

Thanks in Advance

3 REPLIES 3
Read only

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert
0 Likes
725

Hm... you could do something like this in your condition routine:

field-symbols: <rettkomv> type KOMV_INDEX.

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

assign (c_rettkomv) to <rettkomv>.

Then you should be able to access the individual fields of rettkomv with <rettkomv>-<i>fieldname</i>. You can even change it if that's what you need. Be careful though

Sort of a hack, but it should work.

You may have to change the field-symbol declaration to "type standard table of KOMV_INDEX" if you get a runtime error - experiment with this. Basically, the idea is to use a memory pointer to refer to the RETTKOMV content of program SAPLV61A.

Read only

0 Likes
725

Hi Tamas,

I tried all the options in this.

But Assign statement for the Field symbol is giving me Sy-subrc = 4.

I am not sure why I am not able to refer it to the

structure (SAPLV61A)RETTKOMV.

Can someone please help in this?

Thanks in Advance.

Read only

Former Member
0 Likes
725

Simply update the variable xkwert.