Application Development and Automation 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: 
Read only

SAP Script

abdul_hakim
Active Contributor
0 Likes
983

Currently we have report in that they are calling editor which resembles SAPScript editor for

entering long text.Currently the user has no functionality of saving this long text.Now there is a requirement to save these long text into a Z table.How can i save this long text and retrieve later?

Kindly advice.

Thanks in advance

Hakim

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
856

Hi,

there are 2 function modules, which we use to read text & save the text.

1. READ_TEXT

for this you have to pass the below fields to the fm

ID

LANGUAGE

NAME

OBJECT

and you will get already stored text for this ID into the LINES internal table.

the above values for ID,NAME,OBJECT etc. you can find in the transaction.

for example: for delivery,goto header-> texts -> select the text you want to proceed ->select DETAIL ->

you will see a new screen .there in the menu GOTO -> header .

here you can find all the required fields to pass to the function module.

2. SAVE_TEXT

for this what data you have to process first store in LINES internal table.but remember this function module will overwrite existing text,if it exists.so first get the records by using READ_TEXT . append ur lines to that then finally call this FM.

SAVEMODE_DIRECT set this field to X ,sothat changes will reflect immediately.

why you are storing these into other Z-tables ?? any way these will be stored in standard tables. why dont u access them instead of creating another Ztable ?

6 REPLIES 6
Read only

Former Member
0 Likes
856

Hi

you should use the fm EDIT_TEXT and SAVE_TEXT to call, write and save the text.

These functions return the header data (object, name,...)of the text you should insert in the Z-TABLE.

Max

Message was edited by: max bianchi

Read only

Former Member
0 Likes
856

Abdul,

Welcome to SDN!!!

Use Function Module READ_TEXT for reading the Long Text.

I feel ,u can use 'COMMIT_TEXT' func module to save the text.

Thanks,

Kam

Note: Allot points, if my answer was useful.

Read only

Former Member
0 Likes
856

You cannot save your long text in Z table as with EDIT_TEXT / SAVE_TEXT it will go into standard table STXH / STXL.

You can use the standard table itself with

OBJECT -> "TEXT"

ID -> "ST"

NAME -> <UNIQUE_NAME>

SPARS -> SY-LANGU .

The name should be unique while retriving or saving the text . Maybe you can save the name of text in another ZTABLE also .

Cheers.

Sanjay

Read only

Former Member
0 Likes
857

Hi,

there are 2 function modules, which we use to read text & save the text.

1. READ_TEXT

for this you have to pass the below fields to the fm

ID

LANGUAGE

NAME

OBJECT

and you will get already stored text for this ID into the LINES internal table.

the above values for ID,NAME,OBJECT etc. you can find in the transaction.

for example: for delivery,goto header-> texts -> select the text you want to proceed ->select DETAIL ->

you will see a new screen .there in the menu GOTO -> header .

here you can find all the required fields to pass to the function module.

2. SAVE_TEXT

for this what data you have to process first store in LINES internal table.but remember this function module will overwrite existing text,if it exists.so first get the records by using READ_TEXT . append ur lines to that then finally call this FM.

SAVEMODE_DIRECT set this field to X ,sothat changes will reflect immediately.

why you are storing these into other Z-tables ?? any way these will be stored in standard tables. why dont u access them instead of creating another Ztable ?

Read only

0 Likes
856

Hi Srikanth,

I have solved the problem accroding to your suggestion.

Thanks a lot,

Regards,

Hakim

Read only

Former Member
0 Likes
856

Generally, long texts don't store in Z tables, it should be stored in the texts(transaction code SO10). If you want to store the text, you need to create Text ID, Text object and text name to uniquely identify from each other.

After creating these you call get the data using FM Read_text and edit it by edit_text and save it by save_text.

Cheers,

Satya