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: 

Create Long Text

Former Member
0 Kudos

Do I need to call CREATE_TEXT if the Long Text does not exist or does EDIT_TEXT implicitly creates the Long Text?

Should I first Read and if sy-subrc NE 0, then call CREATE_TEXT or what?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I resolved it by doing this:

READ_TEXT

if sy-subrc = 0.

EDIT_TEXT.

ELSEIF sy-subrc = 4.

EDIT_TEXT

CREATE_TEXT

6 REPLIES 6

Former Member
0 Kudos

Hi

It depends on what you need to do

- EDIT_TEXT opens a dialog with the editor in order to write and save the text

- CREATE_TEXT or SAVE_TEXT save the text in db, so the text should be created programatically

Max

0 Kudos

I have an editable ALV. Each record will have a blank page icon if it doesn't have long text and a icon with glasses if the long text exists for that record. When I hit that long text icon, it should show up the editor to edit long text (regardless if the icon is the blank page or the page with glasses).

0 Kudos

So you need to call EDIT_TEXT (this fm should save the text by itself) in both situation:


- If the text exist you should read it by FM READ_TEXT and then call EDIT_TEXT (with data from READ_TEXT) and DISPLAY equal to X

- if the text doesn't exit you need to call EDIT_TEXT only, but you need to fill header data (HEADER) by your self


Max



0 Kudos

On my test, the text does not exist and I am doing exactly as your second point. I am filling the header, the editor pops out, but it is not saving the text. I look on table stxh and there is no text there with the Text Object that I am using.

Former Member
0 Kudos

I resolved it by doing this:

READ_TEXT

if sy-subrc = 0.

EDIT_TEXT.

ELSEIF sy-subrc = 4.

EDIT_TEXT

CREATE_TEXT

0 Kudos

Good

but I think you doesn't need to call CREATE_TEXT, EDIT_TEXT should save the text too

Max