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

USER EXIT for Validation

Former Member
0 Likes
2,607

Dear All,

We have two user group for creating the Sales Order.They are

1. Sales order creation (Real ) and 2. Sales Order creation (Virtual ).

Our requirement is that a user(s) belonging to Real must be able to create Virtual SALES ORDER and vice versa.

We have identified the table and the field as mentioned below.

Table is VBAK ( Transaction Code : VA01 & VA02), & Field is ZZSO_SORT.

As we are planning to write a Validation in FI as per the below logic.

Validation 1.

IF T.CODE ; VA01 or VA02 and User id isXXXXX ( REAL group),then check ZZSO_SORT = REAL (hard code value)

Validation 2.

IF T.CODE ; VA01 or VA02 and User id isXXXXX ( VIRTUAL group),then check ZZSO_SORT = VIRTUAL (hard code value)

But we don't have the table VBAK( and also the feild ZZSO_SORT) in FI validation (OB28),so we have to write an user exit.

As we have fever knowledge about writing a code for user exit( as per above logic) and assigning the same to the respective Validation,it will great,if some one can assist us to achieve our target.

Thanks for your time and patience.

Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,701

Hi

It's very strange you want to put a validation for Sales Order into FI validation: I can't understand it, why do you want to do it?

The main user-exits for sales order are in include MV45AFZ*, perhaps you can try to use the user-exit USEREXIT_CHECK_VBAK defined in the include MV45AFZB

Max

5 REPLIES 5
Read only

Former Member
0 Likes
1,702

Hi

It's very strange you want to put a validation for Sales Order into FI validation: I can't understand it, why do you want to do it?

The main user-exits for sales order are in include MV45AFZ*, perhaps you can try to use the user-exit USEREXIT_CHECK_VBAK defined in the include MV45AFZB

Max

Read only

0 Likes
1,701

Hi,

Thanks for your reply.

As i am an FICO consultant and don't have any idea about ABAP. So if any one can suggest me how can i write the a user exit in VALIDATION, so that i can fix this issue.

As we dont have an ABAPer with us at this point of time and this issue has to fix immediately,so am seeking your help.

Do revert.

Regards,

Edited by: Rob Burbank on Dec 10, 2010 3:13 PM

Read only

0 Likes
1,701

Hi

ZZSO_SORT is a custom field appended in VBAK?

Max

Read only

0 Likes
1,701

Yes that's right.

Read only

0 Likes
1,701

Hi

I don't know where the information for that field is from

Validation 1.
IF T.CODE ; VA01 or VA02 and User id isXXXXX ( REAL group),then check ZZSO_SORT = REAL (hard code value)

Validation 2.
IF T.CODE ; VA01 or VA02 and User id isXXXXX ( VIRTUAL group),then check ZZSO_SORT = VIRTUAL (hard code value)

The field VBAK-ZZSO_SORT can be filled programatically by the user-exit USEREXIT_MOVE_FIELD_TO_VBAK (include MV45AFZZ):

FORM USEREXIT_MOVE_FIELD_TO_VBAK.

  IF T180-AKTYP = 'H' OR                                    "---->VA01
     T180-AKTYP = 'V'.                                      "---->VA02
    IF SY-UNAME = <......>.
      VBAK-ZZSO_SORT = 'REAL'.
    ENDIF.
    IF SY-UNAME = <......>.
      VBAK-ZZSO_SORT = 'VIRTUAL'.
    ENDIF.    
  ENDIF.
ENDFORM.                    "USEREXIT_MOVE_FIELD_TO_VBAK

Otherwise it needs to know who/what inserts the value of VBAK-ZZSO_SORT in order to decide where the control has to be placed.

Max