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: 

How to get header text in user exit for sales order

Former Member
0 Kudos

Hello all,

My requirement is that I get and modify the header text in user exit when creating a sales order. In the user exit I'll do some validation and put the error code into header text. But I can't use function 'READ_TEXT' to get header text since the text has not been updated into database.

Can anybody help me? point will be rewarded. Thanks in advance.

regards,

--Alex

8 REPLIES 8

Former Member
0 Kudos

Hi Alexandro,

Try looking at FM's SAVE_TEXT and COMMIT_TEXT.

Dan

0 Kudos

Thead contains the text header and Tline will have the text line item. These tables should be accessable from USEREXIT_MOVE_FIELD_TO_VBAP ( MV45AFZZ)

0 Kudos

Hello Shard,

I try what you said, but within this exit thead and tline always are initianl when creating/changing/display a sales order. Do you want me to insert my head and line into these two structure?

Thanks,

--Alex

Former Member
0 Kudos

Use the following internal tables. These internal tables are declared in include <b>THEADDAT</b>. THEADDAT is an include of <b>MV45ATOP</b>.

THEAD,

TLINE.

TVCOM,

TTXID,

TTXIT,

TTXOB,

TTXOT

I hope it helps.

0 Kudos

Thanks, there are so lot of internal table, but i'm confuse how to use these tables.

anybody can give me some details. thanks.

regards,

--Alex

gopi_narendra
Active Contributor
0 Kudos

Since the text is not yet created, in your case you have to create the text using create_text and save_text fuctions.

>>> If thats the case then this is not the right place to do the text creation. make sure you create the text after you meet the necessary validations.

Regards

Gopi

0 Kudos

Hello Gopi,

There is also a problem with using save_text in my user exit. It is that when creating sales failed, the text can't be rollbacked from database. My user exit is

USEREXIT_SOURCE_DETERMINATION in include MV45AFZB.

regards,

--Alex

Former Member
0 Kudos

Hi,

You still can use the FM 'READ_TEXT' to retrieve the text. I have used this in FORM USEREXIT_MOVE_FIELD_TO_VBKD of MV45AFZZ.

You may just put the break point in the FM for clarification.

I hope this helps,

Regards

Raju Chitale