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: 

SO user exit problem

Former Member
0 Kudos

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

10 REPLIES 10

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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.

if v_total > v_value.
message

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

Former Member
0 Kudos

try that way

if....

MESSAGE w398(00) WITH

'FOC sales order limit exceeded!'.

LEAVE TO SCREEN 4001.

endif.

0 Kudos

Hi,

Still iam getting errors.

Is there anyway to stop exiting from screen?

Thanks

kaki

0 Kudos

Hi Kaki,

Use a Status Message or try using SET SCREEN.

Cheers,

YJR.

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

HI KAKI

Is table xkonv not working ???

BR, Jacek