04-11-2006 1:31 PM
Hi experts,
In VA01 at Item level, condition tab i want to check price
limit.If it is more than 500 i want to through the message.So i have written the following code using FORM USEREXIT_SAVE_DOCUMENT in MV45AFZZ program.
data: v_total like vbap-netwr.
check sy-tcode = 'VA01' or sy-tcode = 'VA02'.
check sy-dynno = '5003'.
check vbak-auart = 'ZR01' or
vbak-auart = 'ZR02'.
loop at xvbap where abgru = 'ZC'.
v_total = v_total + <b>xvbap-netwr</b>.
endloop.
if v_total gt 500.
message e000(zmsg) with
'FOC sales order limit exceeded!'.
endif.
Now everything is fine.But,if iam creating SO with VA01, <b>xvbap-netwr not picking the value</b>.If in VA02 (change mode)it is picking the value and program is working fine.
Can any one tell me what might be the reason?
Do this program is storing <b>NETWR</b> value in other TABLE insead of XVBAP in VA01 mode?
Reward guaranteed
Thanks
kaki
04-11-2006 2:17 PM
You can check xtkomv table for field kbetr
with key KAPPL = position and kschl = NETP. That is a table for pricing.
But the situation is strnage - in my system tha field netwr is filled correctly in xvbap when saving document. Areu ju sure thaht jou pricing procedure is correctly set ??
BR, Jacek
04-11-2006 2:22 PM
Hi Jacek S³owikowski,
In my system, in VA02 mode is working.But in creation (VA01) it is not working. xvbap-netwr value picking as 0.
But value is there in my condition tab.
I wll try with your table.
Thanks
kaki
04-11-2006 2:58 PM
Va02 is workin becouse it already has pricings.
Pricings must be made to have coorect value of netwr.
In normal way they are made after confirming new position (by clicking enter, after filling SO position). so thay are done before saving document.
So is my questin, are you sure yor pricing procedure is ok ??
BR, Jacek
04-11-2006 3:17 PM
Hi Jacek S³owikowski,
Atlast i got it using by your table xkomv.Thanks a lot.
Since iam using
ERROR
message in document saving subroutine, iam getting the error.E398(00)
with'FOC sales order limit exceeded!'.
exit.
endif.
Is there any way to rectify it?My intension is, if price limit is more than 500, i want to through error message and user should not move further.
thanks a lot,
I wll allot full point for u.
Kaki
04-11-2006 3:35 PM
try that way
if....
MESSAGE w398(00) WITH
'FOC sales order limit exceeded!'.
LEAVE TO SCREEN 4001.
endif.
04-12-2006 2:46 AM
Hi,
Still iam getting errors.
Is there anyway to stop exiting from screen?
Thanks
kaki
04-12-2006 3:12 AM
04-12-2006 3:36 AM
Hi YJR,
I have written like this..
if v_total > v_value.
message <b>E398(00)</b> with
'FOC sales order limit exceeded!'.
endif.
When i press enter first time, it is showing message.If i press enter second time, it is showing the popup window that "Item 000001 does not exit". If i click on Tick button on this window, enitre screen is closing down.
How can i keep always in the same screen(condition tab screen)after showing the error message?
If i give Warning message(message <b>W398(00)</b>) also iam getting same problem.
Rewared guranteed
thanks
kaki
04-12-2006 4:42 AM
Hi,
Try this..
if v_total > v_value.
message E398(00) with
'FOC sales order limit exceeded!'.
<b>LEAVE TO SCREEN SY-DYNNR.</b>
endif.
Hope it helps.
Regards,
Shashank
04-12-2006 7:19 AM