09-17-2014 6:04 PM
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?
09-17-2014 7:20 PM
I resolved it by doing this:
READ_TEXT
if sy-subrc = 0.
EDIT_TEXT.
ELSEIF sy-subrc = 4.
EDIT_TEXT
CREATE_TEXT
09-17-2014 6:10 PM
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
09-17-2014 6:15 PM
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).
09-17-2014 6:26 PM
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
09-17-2014 6:30 PM
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.
09-17-2014 7:20 PM
I resolved it by doing this:
READ_TEXT
if sy-subrc = 0.
EDIT_TEXT.
ELSEIF sy-subrc = 4.
EDIT_TEXT
CREATE_TEXT
09-18-2014 8:50 AM
Good
but I think you doesn't need to call CREATE_TEXT, EDIT_TEXT should save the text too
Max