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: 

Item Text in VA01

Former Member
0 Kudos

Hi,

We are making a transaction code similar to VA01 for creating sales order, now whenever user enters a material we get the all the item texts associated with it using the read_text FM.

The issue is if user enters some texts from his side in any of the nodes in the item texts we are not able to save it when the order is saved.

Please suggest how to save these texts.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Richs,

To display text use function module READ_TEXT.

For create new or update text, may be header or item,use function module:(Any one can be used)

CREATE_TEXT

SAVE_TEXT

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = c_id

flanguage = c_en

fname = l_anfnr [Text name]

fobject = c_ekko [Text Object]

save_direct = c_check

fformat = '*'

TABLES

flines = i_headtext[]

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

Regards,

Tutun

5 REPLIES 5

Former Member
0 Kudos

Hi u can use FM

save_text

Refer this ex. code

LV_HEAD-TDOBJECT = 'KNA1'.

LV_HEAD-TDNAME = WA_DATA-KUNNR.

LV_HEAD-TDID = 'ZREM'.

LV_HEAD-TDSPRAS = SY-LANGU.

WA_LINES-TDLINE = WA_DATA-REMARK.

APPEND WA_LINES TO IT_LINES.

IF WA_MESSTAB-MSGTYP = 'S'.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

CLIENT = SY-MANDT

HEADER = LV_HEAD

INSERT = 'X'

SAVEMODE_DIRECT = 'X'

TABLES

LINES = IT_LINES

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OBJECT = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Note:This may cange as per the filed LV_HEAD-TDID = 'ZREM'. here it is for remarks.

For getting this u can save a text manually ane checkk the table STXH , how it is storing

Regards

0 Kudos

Thanks it id working fine now.

Do we use the same process to display the header and item text in VA02 and VA03??

0 Kudos

Hey Richs,

To Display the text use Function Module READ_TEXT with parameters Object ID = 'F01' Object Name = Sale Order Name and Object = 'VBAK' ( VBAK for Header & VBAP for Item) this will return you the text. Also check the table values in STXH before calling the Function Module READ_TEXT.

Regards,

Saravanan M

Former Member
0 Kudos

Hi Richs,

To display text use function module READ_TEXT.

For create new or update text, may be header or item,use function module:(Any one can be used)

CREATE_TEXT

SAVE_TEXT

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = c_id

flanguage = c_en

fname = l_anfnr [Text name]

fobject = c_ekko [Text Object]

save_direct = c_check

fformat = '*'

TABLES

flines = i_headtext[]

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

Regards,

Tutun

Former Member
0 Kudos

thanks