I know I am late to this thread but yes you are right. Samrtform gets executed before the Logntext gets saved in Database.
I just did the following and it's working perfectly fine
Please go through the code below and this solution is working best for me and I just implemented that today.
DATA iv_header_guid TYPE crmt_object_guid.
DATA et_textdata TYPE comt_text_textdata_t.
DATA ls_textdata TYPE comt_text_textdata.
DATA et_alltexts TYPE comt_text_textdata_t.
DATA et_error TYPE comt_text_error_t.
DATA ev_text_procedure TYPE comt_text_det_procedure.
DATA et_text_cust TYPE comt_text_cust_struc1_tab.
DATA: stxh TYPE stxh.
DATA: lines TYPE comt_text_lines_t.
DATA: ls_lines TYPE tline.
iv_header_guid = wa_header-guid.
CALL FUNCTION 'CRM_DNO_READ_ORDER_TEXT'
EXPORTING
iv_header_guid = iv_header_guid
IMPORTING
et_textdata = et_textdata
et_alltexts = et_alltexts
et_error = et_error
ev_text_procedure = ev_text_procedure
et_text_cust = et_text_cust.
LOOP AT et_alltexts INTO ls_textdata.
stxh = ls_textdata-stxh.
IF stxh-tdid = 'ZARD'.
lines[] = ls_textdata-lines[].
LOOP AT lines INTO ls_lines.
CONCATENATE gv_comments ' ' ls_lines-tdline
INTO gv_comments SEPARATED BY space.
ENDLOOP.
ENDIF.
ENDLOOP.
Tresna Cahya wrote:
Dear Gurus,
Need your insight on this issue. I'm trying to insert long text (Response/Description/etc) from the message into body of e-mail notification. I use function module 'CRM_DNO_READ_ORDER_TEXT' to get the text in the smartform and then use function module 'READ_TEXT' to get the text lines but it returns exception 'not_found'.
I try to debug and it seems like the smartform is executed before the long text is saved into the table (STXH), thus i can't get those text. I have set Action Processing Time to Processing when saving document.
Anyone had this problem before? Need your help.
Thanks and Best Regards,
Tresna
No need for READ_TEXT.
Message was edited by: Mansoor Ahmed