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: 

Userexits for conditions in VA01/02/03 not working

Former Member
0 Kudos

Hello,

I wanted to use authorizations for transaction Va01/02/03. Therefore You have to do a modification by using the user-exits:

USEREXIT_FIELD_MODIFICATION, USEREXIT_FIELD_MODIFIC_KZWI, USEREXIT_FIELD_MODIFIC_KOPF, USEREXIT_FIELD_MODIFIC_LEER

...
I have done all described step by step in the

sap-note 105621

But now, when I´m setting breakpoints in the programs MV61AFZA & MV61AFZB and calling the transaction VA01/02/03, it´s not stopping inside the form-routines!

I have included my includes to the programs and generated it afterwards.

Can anybody explain me, what´s wrong?

Regards Michael

1 ACCEPTED SOLUTION

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Michael!

Which SAP-version you are on? Exits in includes MV61AFZA & MV61AFZB are only relevant for release 30B-45B, afterwards you should implement the version for 46A-500 -> it's in include LV69AFZZ!

Regards,

Christian

11 REPLIES 11

Former Member
0 Kudos

Hi,

You have to put the code in the MV45AFZZ User exit in the form <b>USEREXIT_SAVE_DOCUMENT_PREPARE</b>.

check the coding like this. it will be called at the time of saving or creating the sale order.

CHECK SY-TCODE = 'VA02'.

AUTHORITY-CHECK OBJECT 'Z_SALES_OR'

ID 'VKORG' FIELD VBAK-VKORG

ID 'VTWEG' FIELD VBAK-VTWEG.

IF SY-SUBRC NE 0.

  • Added on 12.12.2005 to get the values delivery block

  • and the billing block value from the VBAK table

SELECT SINGLE LIFSK FAKSK INTO (VBAK-LIFSK , VBAK-FAKSK)

FROM VBAK

WHERE VBELN = XVBAK-VBELN.

  • End Of Code Addtion

IF XVBAK-LIFSK NE VBAK-LIFSK.

MESSAGE E000(8I) WITH 'No Authorization to change'

'Delivery Blocking ' VBAK-LIFSK.

ENDIF.

IF XVBAK-FAKSK NE VBAK-FAKSK.

MESSAGE E000(8I) WITH 'No Authorization to change'

'Billing Block ' VBAK-FAKSK.

ENDIF.

LOOP AT XVBAP WHERE UPDKZ NE 'D'.

CLEAR VBAP.

SELECT SINGLE ABGRU INTO (VBAP-ABGRU)

FROM VBAP

WHERE VBELN = XVBAP-VBELN

AND POSNR = XVBAP-POSNR.

CHECK SY-SUBRC EQ 0.

IF XVBAP-ABGRU NE VBAP-ABGRU.

MESSAGE E000(8I) WITH 'No Authorization to change'

'Reason of Rejection ' XVBAP-ABGRU.

ENDIF.

ENDLOOP.

ENDIF.

  • End Of insertion - Sabari

*{ REPLACE DV1K932860 5

*\CHECK VBAK-AUART = 'ZFDD' OR VBAK-AUART = 'ZFDF'.

----


  • Author : OBT/RANDEV2 *

  • Ticket Number : 9999002657 Date : 11-Feb-2005 *

  • SCR Number : SAP/2005/0553 Date : 11-Feb-2005 *

  • Transport req.: DV1K932860 *

----


  • Presently there is a control of adding new line item or change of *

  • quantity in VA01 transaction. Whenever we are adding or modifying the*

  • order VA01 transaction system is allowing to ZFDD and ZFDF order *

  • types only. Now user requires this type order changing option for *

  • ZFDM and ZFMF order types also. *

----


CHECK VBAK-AUART = 'ZFDD' OR VBAK-AUART = 'ZFDF' OR

VBAK-AUART = 'ZFDM' OR VBAK-AUART = 'ZFMF'.

*} REPLACE

LOOP AT XVBAP WHERE UPDKZ EQ 'I'.

MESSAGE E054(ZV) WITH VBAK-AUART.

ENDLOOP.

LOOP AT XVBAP WHERE UPDKZ NE 'D'.

CLEAR VBAP.

SELECT SINGLE MATNR KWMENG INTO (VBAP-MATNR,VBAP-KWMENG)

FROM VBAP

WHERE VBELN = XVBAP-VBELN AND POSNR = XVBAP-POSNR.

CHECK SY-SUBRC EQ 0.

IF XVBAP-MATNR NE VBAP-MATNR.

MESSAGE E055(ZV) WITH VBAP-MATNR VBAK-AUART.

ENDIF.

IF XVBAP-KWMENG GT VBAP-KWMENG.

MESSAGE E052(ZV) WITH VBAP-KWMENG VBAK-AUART.

ENDIF.

IF XVBAP-KWMENG LT VBAP-KWMENG AND XVBAP-KWMENG <> SPACE.

MESSAGE E053(ZV) WITH VBAP-KWMENG VBAK-AUART.

ENDIF.

ENDLOOP.

cheers.

Former Member
0 Kudos

Hi,

check it this include MV45AFZZ

regards,

srinivas

0 Kudos

Hi, thanks!

The problem is, that I need to supress some fields in the conditions for some schemes. The user exit behind the saving process is too late, I think.

regards

0 Kudos

No ideas? It´s quite strange, that it´s not stopping in the exits... Maybe I´m doing something wrong?

Regards Michael

0 Kudos

Hi,

Try to code in the form <b>USEREXIT_FIELD_MODIFICATION</b> in <b>MV45AFZZ</b> . It will be called for each enter, so put conditions in using the same. you can make fields, disable for certain conditions or any thing related to Screen.

rgds

0 Kudos

Hello,

You can change attaributes of the screen in USEREXIT_FIELD_MODIFICATION. Small egs is

CASE SCREEN-NAME.

WHEN 'VBAP-ARKTX'.

SCREEN-ACTIVE = 1.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

There might be a screen-group you might need to change based upon the fields you are trageting.

Thanks,

Jagruti

Former Member
0 Kudos

Did u assign all the authorisation check to the same pricing procedure which is triggered when u r doing VA01/VA02/03?

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Michael!

Which SAP-version you are on? Exits in includes MV61AFZA & MV61AFZB are only relevant for release 30B-45B, afterwards you should implement the version for 46A-500 -> it's in include LV69AFZZ!

Regards,

Christian

0 Kudos

Hi Christian!

I´m working with 4.6C. So the includes MV61AFZA & MV61AFZB are not working any more?

Haven´t looked at LV69AFZZ, are there the same forms like in mv61afza & mv61afzb? From where do You have this information? I got the inlcude names form the customizing...

Cheers Michael

0 Kudos

I just had a look in the OSS-note...

Former Member
0 Kudos

Hello Michael,

This is valid in 4.6C also only thing is u need to copy this to SAPLV69A. Please check the note 313569.

Hope this helps.