‎2007 Nov 28 4:24 PM
Hi am using read_text in perform where am passing
5 tp 6 values for ID.......
for one of the values amongst these 6 which i pass to function module
is not fetching any output........
IN THIS CASE WHEN NO OUTPUT IS FETCHED FUNCTION throws the control
out of the program from within.
I WANT THAT IF FUNCTION MODULE IS NOT FETCHING ANY VALUE THAN
IT SHOULD PROCESS ANOTHER VALUE which i am passing through perform
rather than shooting the control outside......
APART from custimising the function module is there any other way.
PLZ suggext
‎2007 Nov 28 4:26 PM
Can you please paste the code of your FORM which is fatching the data?
I think you have some kind of EXIT statement after the READ_TEXT FM.
Regards,
Naimesh Patel
‎2007 Nov 28 4:35 PM
perform read_item using id : '0001','0002','0003'.......
perform.....id1
read_text
object=
id=id1
name =
lang =
if sy-subrc eq 0.
msg
endif.
in one of these value say 0003 no values is fetched....so exit commmand if u place it after FUNCTION ODULE WILL not work as the control is shooted out
from within the FM.
and some method is needed in which we need not custumise fm
‎2007 Nov 28 4:55 PM
Hi Mitesh,
This should not happen, if you have exceptions in the FM.
Try validating the text id with table TTXID before passing them to the FM.
or Try FM
RETRIEVAL_MULTIPLE_TEXTS to retreive text.
There exist a class method also to retreive the text, but I dont remember the same as off now. Will update my post once I find out the same.
Lokesh
Pls. reward if it helps.
Message was edited by:
Lokesh Aggarwal
‎2007 Nov 28 4:59 PM
Include the EXCEPTIONS in your FM call.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = ID
LANGUAGE = SY-LANGU
NAME = NAME
OBJECT = OBJECT
IMPORTING
HEADER = NEWHEADER
TABLES
LINES = TEXT_TAB
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 NE 0.
message
ENDIF.Regards,
Naimesh Patel
‎2007 Nov 29 4:31 AM
hey ,i tried this yesterday....the same thing but i forgot to uncomment exceptions,.......:):).....by mistake..now it works
‎2007 Nov 29 2:54 PM
So, you can mark this thread as complete so, other people can take help from that.
Regards,
Naimesh Patel
‎2007 Nov 29 6:23 AM
Hi,
yes there is another way without using fm.
to concatenate ebeln and ebelp into g_text_key.
u can declair g_text_key in globel def. g_text_key type char15.
CONCATENATE <FS>-ebeln <FS>-ebelp INTO g_text_key.
I hope this is helpfull for you
Regards,
Rahul Kanth Reddy...