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: 

reading item line texts before saving the document in VA01

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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

0 Kudos

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.