How to set different menge during the post WA04?

Hi,experts.
I’ve got an issue with adding a different menge during the post.
I got a field ZZMENGE with more than 3 decimal digits and i want a price to calculate with this additional field.
I found a point in code where does it happends : LMBGBFSU.

 

 

 

FORM wert_preisproportional USING w-stprs LIKE mbew-stprs
w-peinh LIKE mbew-peinh
w-menge LIKE menge
w-betrag LIKE betrag.

w-betrag = ( w-menge * w-stprs / 1000 ) / w-peinh.
IF w-betrag > maximum OR w-betrag < minimum.
MESSAGE e302 WITH ‘WERT_PREISPROPORTIONAL’ ‘W-BETRAG’.
ENDIF.

ENDFORM.

 

 

 

I found an enhancement point where i try to change a value of menge field in program LMBGBFSU.

 

 

 

ENHANCEMENT 64 ZVA_TEST. “active version
if betrag is not INITIAL.
menge = mseg-zzmenge / 1000000.
endif.
ENDENHANCEMENT.

 

 

 

below i change w-menge field wich i neen for calculation.
It happnds automaticly at once this perform is started.
Program : LMBGBFAS ( line 591 )

 

PERFORM wert_g_berechnen USING exwrt_bualt
w-exwob
w-mengu
w-wertu
w-bwspa
mseg-shkzg
w-xruem
lbkum
salk3
salkv
stprs
verpr
peinh
vmkum
vmsal
vmsav
vmstp
vmver
vmpei
w-mlmaa
menge
betrag.

FORM wert_g_berechnen USING w-exwrt LIKE exwrt
w-exwob TYPE c
w-mengu LIKE mseg-mengu
w-wertu LIKE mseg-wertu
w-bwspa LIKE dm07m-bwspa
w-shkzg LIKE mseg-shkzg
w-xruem LIKE mseg-xruem
w-lbkum LIKE lbkum
w-salk3 LIKE salk3
w-salkv LIKE salkv
w-stprs LIKE stprs
w-verpr LIKE verpr
w-peinh LIKE dm07m-peinh
w-vmkum LIKE vmkum
w-vmsal LIKE vmsal
w-vmsav LIKE vmsav
w-vmstp LIKE vmstp
w-vmver LIKE vmver
w-vmpei LIKE dm07m-vmpei
w-mlmaa LIKE vm07m-mlmaa
w-menge LIKE menge
w-betrag LIKE betrag.

IF w-xruem IS INITIAL.
PERFORM wert_g_rechnen USING w-shkzg
w-exwrt
w-exwob
w-mengu
w-wertu
w-bwspa
w-salk3
w-salkv
w-stprs
w-verpr
w-lbkum
w-peinh
w-mlmaa
w-menge
w-betrag.
ELSE.
PERFORM wert_g_rechnen USING w-shkzg
w-exwrt
w-exwob
w-mengu
w-wertu
w-bwspa
w-vmsal
w-vmsav
w-vmstp
w-vmver
w-vmkum
w-vmpei
w-mlmaa
w-menge
w-betrag.
ENDIF.

ENDFORM. “wert_g_berechnen

 

 And w-menge suddenly changes to previous mseg value.
It changes at once this form starts. 
So at once it starts mine MENGE and W-MENGE values are different. 

Program :LMBGBFAS ( line 399)

 

PERFORM wert_g_berechnen USING umexw
x
dm07m-ummen
dm07m-umwer
bwspa
shkzg
w-umxrm
umlbk
umsal
umsav
umstp
umver
umpei
umvku
umvsa
umvsv
umvsp
umvvp
umvpe
dm07m-ummlm
ummenge
betrag.

FORM wert_g_berechnen USING w-exwrt LIKE exwrt
w-exwob TYPE c
w-mengu LIKE mseg-mengu
w-wertu LIKE mseg-wertu
w-bwspa LIKE dm07m-bwspa
w-shkzg LIKE mseg-shkzg
w-xruem LIKE mseg-xruem
w-lbkum LIKE lbkum
w-salk3 LIKE salk3
w-salkv LIKE salkv
w-stprs LIKE stprs
w-verpr LIKE verpr
w-peinh LIKE dm07m-peinh
w-vmkum LIKE vmkum
w-vmsal LIKE vmsal
w-vmsav LIKE vmsav
w-vmstp LIKE vmstp
w-vmver LIKE vmver
w-vmpei LIKE dm07m-vmpei
w-mlmaa LIKE vm07m-mlmaa
w-menge LIKE menge
w-betrag LIKE betrag.

IF w-xruem IS INITIAL.
PERFORM wert_g_rechnen USING w-shkzg
w-exwrt
w-exwob
w-mengu
w-wertu
w-bwspa
w-salk3
w-salkv
w-stprs
w-verpr
w-lbkum
w-peinh
w-mlmaa
w-menge
w-betrag.
ELSE.
PERFORM wert_g_rechnen USING w-shkzg
w-exwrt
w-exwob
w-mengu
w-wertu
w-bwspa
w-vmsal
w-vmsav
w-vmstp
w-vmver
w-vmkum
w-vmpei
w-mlmaa
w-menge
w-betrag.
ENDIF.

ENDFORM. “wert_g_berechnen

 

 

 

 

So form  ‘wert_g_berechnen ‘ starts twice.
First at   LMBGBFAS (line 591 ) changes w-menge to menge, which i set previously ( equals to additonal zzmenge field ).
Secondly at LMBGBFSU ( line 399 )  turn back the previous menge field. And it strange that at once it starts mine ‘W-MENGE’ and ‘MENGE’ field have different values.

Why it happends?

 

Scroll to Top