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

RV45PFZA: Limiting Code

Former Member
0 Likes
1,513

Hi,

In Include RV45PFZA, there is a user exit USEREXIT_SET_STATUS_VBUK. I want to enter code there that that will only be hit for Transaction VA01. This user exit is also hit for Transaction VKM3. Syst-tcode will work, but I was warned off it as when creating a new sales order through a BAPI, the transaction code will not be VA01. Is there any check that can be put in here to limit the code to only creating a new sales order.

Thanks,

Finbarr

7 REPLIES 7
Read only

Former Member
0 Likes
1,063

HI,

You can write your code in

IF VBAK-VBTYP = 'C'. "This is for order only.

....

ENDIF.

Read only

0 Likes
1,063

No Good,

When I run va02 it contains C

When I run vkm3 it contains C

regards,

Finbarr

Read only

0 Likes
1,063

Try VBAK-AUART."Order type.

Read only

Former Member
0 Likes
1,063

Hi ,

Can you check T180-TRTYP value in this user exit.

IF T180-TRTYP = 'H' means creation of Order then you can exclude it.

IF not you can export a parameter from VA01 and Import the parameter in this user exit and check either "SY-TCODE" or T180-TRTYP.

Lanka

Read only

0 Likes
1,063

Your solution is to combine Phani's and Lanka's conditions into one condition and use.

IF VBAK-VBTYP = 'C' AND T180-TRTYP = 'H'.

*-- only then do this

ENDIF.

Read only

0 Likes
1,063

I dont have access to T180 in my user exit.

An alternative that I am going to use is check is the order status is equal to A and only run the code if it is.

Thanks for your replies.

Regards,

Finbarr

Read only

0 Likes
1,063

Hi,

Srini's solution is Good . You can't set a condition on document type (AUART) bacuse you may have one or more documents types.

So check with Table T180 and document catge. (VBTYP).

Lanka