04-28-2005 2:33 PM
I have one situation to read the item level text before saving the document in VA01
normally when we use READ_TEXT for reading the texts, by passing the VEBLN and PSNR , but here in my case i will not have VEBLN since I want to check the existance of item text before saving, to set a rejection block in pricing conditions.
So essentially i've to check the existance of text when I come to the pricing condition in VA01. I do not mind the exact texts.This check I want to do in USEREXIT SAVE DOCUMENT PREPARE.
Appreciate any feedback
04-28-2005 2:46 PM
Hi Bindu,
If you just want to check the existence of texts then you can use the internal table XTHEAD.
For each item, search for a line in the internal table with the following properties:
TDNAME+10(6) = vbap-posnr
UPDKZ = 'I' or 'U' ' ' (Insert or Update or not changed)
The reason for the +10(6) is that the first ten digits contain the sales order number (which in create mode VA01 is something like ~000000001). As you will probably need your logic in change mode VA02 as well, its best just to ignore this altogether.
The reason for checking the UPDKZ is to make sure that the text you are checking is not being deleted (UPDKZ = 'D'). Again, relevant for change mode. In this case if you did not implement this check you would falsely detect the presence of text for that item.
Hope that helps.
Cheers,
Brad
(ignore the first ten digits as they contain the sales order number which during order create is soething like
04-28-2005 2:46 PM
Hi Bindu,
If you just want to check the existence of texts then you can use the internal table XTHEAD.
For each item, search for a line in the internal table with the following properties:
TDNAME+10(6) = vbap-posnr
UPDKZ = 'I' or 'U' ' ' (Insert or Update or not changed)
The reason for the +10(6) is that the first ten digits contain the sales order number (which in create mode VA01 is something like ~000000001). As you will probably need your logic in change mode VA02 as well, its best just to ignore this altogether.
The reason for checking the UPDKZ is to make sure that the text you are checking is not being deleted (UPDKZ = 'D'). Again, relevant for change mode. In this case if you did not implement this check you would falsely detect the presence of text for that item.
Hope that helps.
Cheers,
Brad
(ignore the first ten digits as they contain the sales order number which during order create is soething like
04-29-2005 6:52 AM
Thanks Brad, That was a great help.
In addition to the fields that you have mentioned I'm checking the field
TDFUSER = sy-uname also.