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: 

user exit to check item text in VA01

Former Member
0 Kudos

I want to valicate and create hard error when user create order and did not input certain item text in the order depending on order type.

The text object is VBBP with textname as order number and item posnr.

I tried userexit_save_document_prepare but at that time, there is no sales order number created yet, therefore I cannot call function read_text with the text object to check for item text.

I also tried userexit_save_document, I got order number and item posnr but still function call always return text not found even I input item text during the order creation.

Does anyone know where to put this exit or any enhancement point to check for item text?

Thanks

5 REPLIES 5

Former Member
0 Kudos

Check below Enhancement

Enhancement V45A0003

Function exit EXIT_SAPMV45A_003

EXIT_SAPMV45A_004

nirajgadre
Active Contributor
0 Kudos

Hi,

I guess you will not get the sales document number in the userexit 'userexit_save_document_prepare' because this exit call before document number gets generated hence you will not able to use the READ_TEXT function module.

Instead try to use the global table XTHEAD[] which contains the all the text ID available in the sales order during the runtime hence try to use this in userexit 'userexit_save_document_prepare' .

0 Kudos

With global table XTHEAD at run time I can see all available text at run time but how do I know whether user has entered the required item text? Because if they did not entered, I would like to flag error. It would be nice to put in incompletion log but I do not know how you can add to incompletion log for an item text field. Any suggestion would be appreciated.

By the way, with enhancement VA45A0003 I am not sure how to put my code in. Do we need access key to add the code in EXIT_SAPMV45A_004 or EXIT_SAPMV45A_003?

0 Kudos

Not true...you don't need the document number to exist in create mode to use READ_TEXT during sales order processing. Check the code. You can use 'XXXXXXXXXX' as the 'name' and READ_TEXT will read the values from memory.

I would use the incompletion log and checking process, but if you must have a hard error, you can still use the USEREXIT_SAVE_DOCUMENT_PREPARE approach.

0 Kudos

Hi Brad Bohn,

I have quite the same issue,

I have add a new subroutine to be able to change the KUNNR/goods receipt.

every goods-receipt has a specific text, how can I change the item text when there is no VBELN/doc number based on the new kunnr ?

Is that also applicable in the user-exit that you mentioned?

Best Regards,

Robert