Application Development and Automation 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: 
Read only

read_text problem

Former Member
0 Likes
802

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

7 REPLIES 7
Read only

naimesh_patel
Active Contributor
0 Likes
734

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

Read only

Former Member
0 Likes
734

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

Read only

0 Likes
734

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

Read only

0 Likes
734

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

Read only

Former Member
0 Likes
734

hey ,i tried this yesterday....the same thing but i forgot to uncomment exceptions,.......:):).....by mistake..now it works

Read only

0 Likes
734

So, you can mark this thread as complete so, other people can take help from that.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
734

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...