09-09-2013 7:54 AM
hi
when I use function read_text and it doesn't get any value, a popup window will be showed up and then the program stops.
I am wordering if there is a way to continue to execute the program and return a null value.
thanks.
09-09-2013 8:05 AM
Hi Ming,
why didn't you check before using this function if the text exist using an SQL statement on the table : STXH ?
regards
Fred
09-09-2013 8:05 AM
Hi Ming,
why didn't you check before using this function if the text exist using an SQL statement on the table : STXH ?
regards
Fred
09-09-2013 8:23 AM
thank you for your reply.
I think I found the answer for this.
I just comment the exception that result in this problem.
If I uncomment it, the program executes normally and return a sy-subrc valued '4'.
09-09-2013 8:18 AM
Hi,
The wiki will give you a better idea on the usage of the FM
http://wiki.scn.sap.com/wiki/display/EIM/Function+Example+READ_TEXT
Cheers,
Arindam
09-09-2013 8:24 AM
Hi Ming,
I am not sure what you have passed to FM,
It is used as below:
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = ' ' ( Text id )
language = sy-langu
name = likp-vbeln
object = 'VBBK'
TABLES
lines = l_it_lines
The ID will be same which is in table STXH (TDID).
Hope it will work .
Thanks
Romit Raina
09-09-2013 8:33 AM
Hi Ming,
I have used this FM and the program is absolutely fine. There is a table TTXIT from where you can fetch TDID according to your application area(my application area was MM and related to PO so I passed 'EKKO' in TDOBJECT) and this TDID can be used in READ_TEXT FM.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = wa_text-tdid
language = sy-langu
name = gv_ebeln "PO number
object = text-wh4 "EKKO
TABLES
lines = lt_lines "text
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0 AND sy-subrc <> 4.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Hope this will help you.
Cheers.
Dineshwar
09-09-2013 8:35 AM
Hi Ming,
what popup u are getting , could you please post your code,
thanks.
09-09-2013 10:21 AM
use of read_text.............
DATA: lt_line TYPE TABLE OF tline,
ls_line TYPE tline.
data: NAME type THEAD-TDname,
TDOBJECT type THEAD-TDOBJECT value 'VBBK' .
* LV_LINE TYPE TDLINE.
name = p_vbeln.
*BREAK-POINT.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = '0002'
LANGUAGE = sy-langu
NAME = NAME
OBJECT = TDOBJECT
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
* OLD_LINE_COUNTER =
TABLES
LINES = LT_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
LOOP AT lt_line into ls_line.
concatenate LV_string ls_line-tdline into LV_string separated by space.
ENDLOOP.
09-09-2013 10:46 AM
Hi Ming,
Read_text works fine to retreive the texts. Please check whether texts are maintained properly and you are passing correct parameters to function module.
Kindly post your code with pop up window you are receiving in order to resolve the issue.
Best Regards,
Abirami S
09-09-2013 11:00 AM
09-09-2013 11:08 AM
Hi Ming,
Not sure if it will work but worth trying.
Check the values of sy-subrc after the function call.
call function read_text.....
if sy-subrc ne 0.
message text TYPE 'I'. " Just give a message and continue with the program execution.
endif.