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: 

Change "multidimensional condition"

Former Member
0 Kudos

Hello Guys,

i hope anybody can help me.

I have following problem.

Program SAPLV61A
Include LV61AA55

* execute condition value formula not changing xkomv
* will normally be processed in xkomv_kwert_ermitteln
    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.
      xkomv    = rettkomv.
    ENDIF.

I will change u201Crettkomvu201D in this subroutine.

But I can not do an u201CDirty assignu201D because it is a local variable.

Is it somehow possible, to change the local variable of SAPLV61A in the subroutine?

That is a formel of VOFM to change the value for a multidimensional condition.

In the default, I can not change it without creating double conditions. ( SAP Note: 1073779 Point 5)

Kind regards

Florian

7 REPLIES 7

gaurav_sharan
Explorer
0 Kudos

Hi,

Please use Field symbol. This will solve your problem. Use below code:

DATA: fieldname type char8 value 'RETTKOMV'.

**Field symbol declaration.

FIELD-SYMBOLS <i_field>.

ASSIGN (fieldname) TO <i_field>.

then modify data of rettkomv, use <i_field> = xknomv. instead of rettkomv = xkomv.

This will modify local data in Program SAPLV61A.

Thanks,

Gaurav.

0 Kudos

Hello Gaurav,

thanks for you answer, but it doesn't work.

It receive an DUMP:

MOVE_TO_LIT_NOTALLOWED_NODATA

Short text

Error assignment: overwriting a protected field.

0 Kudos

Hi,

Can you please share code, I would like to see what you have written. As it is modification of SAP standard code, I am not able to replicate it. And also if you could let me know value of frm_kondi_wert at run time so that I can check which subroutine of saplv61a it is basically calling.

Normally this dump comes when fields are like importing parameter or a protected field from overwrite.

Thanks & Regards,

Gaurav.

0 Kudos

Hello,

ok i copy some Code, i hope it is enough.

SAP Program: SAPLV61A and INCLUDE LV61AA55, LINE 1143


* execute condition value formula not changing xkomv
* will normally be processed in xkomv_kwert_ermitteln
    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.
      xkomv    = rettkomv.
    ENDIF.

  • Values of the fields

FRM_KONDI_WERT-NR = 903

XKOMV-KOFRM = 903

FRM_KONDI_WERT = FRM_KONDI_WERT_903


******************
* My Coding
**********************
FORM FRM_KONDI_WERT_903.
*{   INSERT         T24K981076                                        1
* 2011-05-31 MarfL
* Runden unter bestimmten Bedingungen

* some coding,... not important
* ....
* some coding,... not important


xkwert = '1234'.


DATA: fieldname type char8 value 'RETTKOMV'.
**Field symbol declaration.
FIELD-SYMBOLS <i_field>.
ASSIGN (fieldname) TO <i_field>.

xkomv-kwert = xkwert.
<i_field> = xkomv.

ENDIF.


*}   INSERT
ENDFORM.

0 Kudos

Hi Florian,

It is not possible to change the local variable values by the method suggested by Gaurav Sharan, you can only change global variables of the associated main program.

Now,

I will change u201Crettkomvu201D in this subroutine.

But I can not do an u201CDirty assignu201D because it is a local variable.

I didn't quite get what you mean by the above, anyways looking at the code,

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.

xkomv = rettkomv.

ENDIF.

i guess you want to change RETTKOMV so that the changes are carried over to XKOMV is that right?

If your intention is to update XKOMV based on some custom logic, then you can use the below userexit for the same,

RV61AFZB - userexit_xkomv_bewerten_end it gets called at the end of the sub routine - xkomv_bewerten in LV61AA55.

Is it somehow possible, to change the local variable of SAPLV61A in the subroutine?

Not unless you do a core mod or implement an explicit enhancement(ECC 6.0).

Regards,

Chen

0 Kudos

Hello Chen

thanks for your answer.

I was hoping that there is a way to change the variable.

But in this case, it is not working well.

Then I'll try it with the user exit, thanks!

Regards

Florian

0 Kudos

I put my coding into

ENHANCEMENT-POINT xkomv_bewerten_04 SPOTS es_saplv61

You must change

xkomv-kwert in the head of the table and in the position of the table.

To handle that this modifikation only take effect to freigtcost you must use:

IF xkomv-kappl = 'F'

Regards