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: 

Reg: function Save_text

Former Member
0 Kudos

Hi All,

I have to Store some text at ITEM TEXT Level(VA02 screen -> GOTO -> ITEM -> TEXTS). I am using the function module SAVE_TEXT for this.

I have declared an structure:

DATA: ls_head TYPE thead.

And filled it as:

ls_head-tdid = 'ZCON'.

ls_head-tdobject = 'VBBP'.

ls_head-tdspras = sy-langu.

ls_head-tdname = "Activity number".

I am using SAVE_TEXT as shown below:

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

client = sy-mandt

header = ls_head

insert = 'X'

savemode_direct = 'X'

TABLES

lines = lt_line.

But i have just one "Activity number" for whole order and i want this text to be created for all line items.

E.g. Order number: 1000; Activity number: 012345 and this order has 5 line items: 10,20,30,40,50. Now i want to call SAVE _TEXT 5 times but i have just 1 "Activity number" (for the whole order).

It is working fine if i am calling SAVE_TEXT only once, but i want texts for all line items.

Is there any solution? Can i use SAVE_TEXT by giving same Activity number and different line items?

Thanks in advance,

Regards,

Pankaj.

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
0 Kudos

> ls_head-tdname = "Activity number".

This is wrong. You need to fill TDNAME with the key to your sales order line item, a concatenation of sales order number (length 10) and line item (length 6), e.g. 0000001000000010. You need to call SAVE_TEXT for each of the five line items in your example, changing TDNAME accordingly. The contents of LT_LINE can remain the same.

The text "Activity number" is fixed to the Text ID ZCON already, if you configured it that way.

Thomas

2 REPLIES 2

ThomasZloch
Active Contributor
0 Kudos

> ls_head-tdname = "Activity number".

This is wrong. You need to fill TDNAME with the key to your sales order line item, a concatenation of sales order number (length 10) and line item (length 6), e.g. 0000001000000010. You need to call SAVE_TEXT for each of the five line items in your example, changing TDNAME accordingly. The contents of LT_LINE can remain the same.

The text "Activity number" is fixed to the Text ID ZCON already, if you configured it that way.

Thomas

0 Kudos

Hi Thomas,

By activity number i meant 'VBKA-VBELN', as passing this can also create desirable text.

But whatever you have explained is also write and really was very helpful to me.

Thanks for your help.

Regards,

Pankaj.