Application Development 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: 

about function read_text

raffinkira
Participant
0 Kudos

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.

1 ACCEPTED SOLUTION

FredericGirod
Active Contributor
0 Kudos

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

10 REPLIES 10

FredericGirod
Active Contributor
0 Kudos

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

0 Kudos

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

arindam_m
Active Contributor
0 Kudos

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

romit_raina
Active Participant
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Hi Ming,

what popup u are getting , could you please post your code,

thanks.

0 Kudos

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.



Former Member
0 Kudos

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

Former Member
0 Kudos

you can find the text in se75 by text id.

former_member184569
Active Contributor
0 Kudos

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.