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

problem with user exit

Former Member
0 Likes
917

Hi,

I have an issue working with USEREXIT_CHECK_VBAK, which affects transactions VA02 .

Iplease let me know the logic to validate the combination of Sold-To and Ship-To, against the Partner Table KNVP, under USEREXIT_CHECK_VBAK. And, if a user enters wrong combination of Sold-To and Ship-To, say in transaction VA02, USEREXIT_CHECK_VBAK will be triggered and the validation error message will be displayed.

Thanks and regards,

Nandy

5 REPLIES 5
Read only

Former Member
0 Likes
716

Please have a look at below help provided by sap which gives details about User Exits In Sales Document Processing.

[User Exits In Sales Document Processing|http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/content.htm]

I hope it helps.

Read only

0 Likes
716

Hi vibha,

Thanks a lot for ur reply.but i know the pupose of all those exits i just wanna know if anyone have any idea about the logic to be used

Read only

0 Likes
716

Try like this in the User Exit USEREXIT_CHECK_VBAK:


* Get Ship to Partner
READ TABLE XVBPA INTL L_VBPA WITH KEY PARVW = 'WE'.
IF SY-SUBRC = 0.
  L_SHIPTO = L_VBPA-KUNNR.
ENDIF.

* Check connection
SELECT SINGLE kunnr
              INTO l_kunnr
              FROM knvp
              WHERE kunnr = VBAK-KUNNR   " Sold TO
              AND      kunn2 = L_SHIPTO         " Ship To
              AND      parvw = 'WE' .  " Partner func, Ship to party
IF SY-SUBRC <> 0.
  MESSAGE E398(00) WITH 'Unconnected Ship To'.
ENDIF.

Regards,

Naimesh Patel

Read only

0 Likes
716

Hello,

I have a really similar logic in the USEREXIT_CHECK_VBAK. The problem is however I use an Error Message, the focus of the screen passes to the next field, PO Number. At the same time the Sold-To-Party and Ship-To-Party fields turn gray. So the user can't change them.

Is there a way to force the program to stay in the Ship-To-Party field letting the user to change ??

Thanks in advance.

Read only

0 Likes
716

I am also facing same kind is issue. Any solution for this?