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: 

SO10 text does not get displayed when called in Program

Former Member
0 Kudos

HI Guys,

I am facing an issue. I need to call texts from SO10 in the program. Now i went through some threads regarding this and develpoed the code accordingly, but in my case its not displaying the text.

Basically the text is an error message to check validation, which should be shown when the selection field is left blank.

I wrote the following code but its not displaying the message.

DATA BEGIN OF TEXTHEADER.

          INCLUDE STRUCTURE THEAD.

DATA END OF TEXTHEADER.

DATA BEGIN OF LINES OCCURS 10.

          INCLUDE STRUCTURE TLINE.

DATA END OF LINES.

DATA: l_TNAME LIKE THEAD-TDNAME,

           lw_tline LIKE LINE OF lines.

CLEAR TEXTHEADER.

l_tname = 'VALIDATE_SALES_ORG'.

IF *zv3321128_mat_v-vkorg IS INITIAL.

   CALL FUNCTION 'READ_TEXT'

     EXPORTING

*     CLIENT                        = SY-MANDT

       id                                 = 'ST'

       language                      = 'P' "sy-langu'

       name                           = l_tname

       object                          ='TEXT'

*     ARCHIVE_HANDLE      = 0

*     LOCAL_CAT                = ' '

    IMPORTING

      HEADER                       = TEXTHEADER

     tables

       lines                             = lines

    EXCEPTIONS

      ID                                  = 1

      LANGUAGE                   = 2

      NAME                            =3

      NOT_FOUND                  = 4

      OBJECT                         = 5

      REFERENCE_CHECK    = 6

      WRONG_ACCESS_TO_ARCHIVE       = 7

      OTHERS                        = 8

             .

LOOP AT lines INTO lw_tline.

   IF lw_tline-tdline ne ' '.

     WRITE: lw_tline-tdline.

   ENDIF.

ENDLOOP.

Please state if anything wrong with this code.

Thanks.

49 REPLIES 49

former_member259807
Active Participant
0 Kudos

Did you try debugging it? is *zv3321128_mat_v-vkorg  empty? is table 'lines' filled after calling the FM?

0 Kudos

Hello Dharmin Doshi,

Please check the ID, name, language, object,  parameters correct or not.

0 Kudos

hii Wallagh,

yes i debugged and checked.. the lines is getting filled with the message from SO10

Former Member
0 Kudos

Hi,

After the FM executes table values are filling?

Go to SE37,Type READ_TEXT in it and select where used list,

  Thann you will see the difference why that is working and yours not working.

Regards,

Ravi Shankar L

former_member420878
Active Participant
0 Kudos

Hi,

Try to run FM 'READ_TEXT' through se37 by giving the same input which you are passing into above code.

If it giving any error then problem will be with your input and if it returns the output then compare this with your program o/p and check in debugging step by step.

Thanks.

0 Kudos

hi neha

i checked in se37.. the table entry shows the message over there.. and while debugging also.. the lines table gets filled with the text from SO10..

Former Member
0 Kudos

Hi Dharmin,

In all probability you must be passing wrong parameters to the FM READ_TEXT. Please check in the transaction or tell us the transaction whose SO10 text you want to show.  If you do not know the transaction go to SO10 and see the text properties as,

Now pass these 4 properties and you will surely get actual text in table.

BR.

0 Kudos

HI Ankit,

the text is coming in the table, but its not getting displayed..that is where I am stuck..

0 Kudos

Hi Dharmin,

If text is coming in 'lines' table then debug and see why Write is not working since

LOOP AT lines INTO lw_tline.

   IF lw_tline-tdline ne ' '.

     WRITE: lw_tline-tdline.

   ENDIF.

ENDLOOP.

Seems correct. Also you can try

LOOP AT lines. "its an internal table with header line according to your declaration

   IF lines-tdline ne ' '. " or try if lines-tdline ne space.

     WRITE: lw_tline-tdline.

   ENDIF.

ENDLOOP.

But still i do not understand why your code will not work.

BR.

0 Kudos

HI Ankit, i debugged, value is coming in lw_tline-tdline .. it passes through WRITE statement but not displaying. How would i come to know if WRITE statement is working or not since value is coming in lw_tline-tdline?

0 Kudos

How the text appears.. i would be coming as a pop-up right..?

0 Kudos

Hi Dharmin,

It would not come as pop-up.

Write your code in End-of-selection Event.

End-of-selection.

LOOP AT lines INTO lw_tline.

   IF lw_tline-tdline ne ' '.

     WRITE: lw_tline-tdline.

   ENDIF.

ENDLOOP.

BR.

0 Kudos

HI ,

Since it is inside a module, using end of selection is giving me error to end the module before using it..

0 Kudos

What is your requirement ? If it is to show the Long Text as the Report Output then call the module in the End-of-Selection Event.

End-of-selection.

perform <name>.

Form <name>.

*-- Your code of above loop

endform.

BR.

0 Kudos

Hi,

You said it is in module? What module is it? are you writing in function module or using module pool?

Regards,

Swarna

0 Kudos

see the requirement is there is one module created to validate fields.. now inside this module i am validating this field.. if the field entry is initial than it show pop up message that "enter field value".. this message as per requirement should be maintained in SO10. so under that condition i am calling this FM read_text.. so now how do i use end-of-selection over here since i am using everything inside a module. I hope i am able to explain properly..

0 Kudos

a module created within PBO of the screen

arindam_m
Active Contributor
0 Kudos

Hi.

There are 7 inbuilt exceptions

EXCEPTIONS

      ID                                  = 1

      LANGUAGE                   = 2

      NAME                            =3

      NOT_FOUND                  = 4

      OBJECT                         = 5

      REFERENCE_CHECK    = 6

      WRONG_ACCESS_TO_ARCHIVE       = 7

Whats the sy-subrc you get?

Cheers,
Arindam

Former Member
0 Kudos

HI,

Sy-subrc am getting EQ 0.

Former Member
0 Kudos

Hi Doshi,

Provide correct language in export parameters.

problem in language  specification.

CALL FUNCTION 'READ_TEXT'

     EXPORTING

*     CLIENT                        = SY-MANDT

       id                                 = 'ST'

       language                      = 'P'  "sy-langu'

       name                           = l_tname

       object                          ='TEXT'

*     ARCHIVE_HANDLE      = 0

*     LOCAL_CAT                = ' '

    IMPORTING

      HEADER                       = TEXTHEADER

     tables

       lines                             = lines

    EXCEPTIONS

      ID                                  = 1

      LANGUAGE                   = 2

      NAME                            =3

      NOT_FOUND                  = 4

      OBJECT                         = 5

      REFERENCE_CHECK    = 6

      WRONG_ACCESS_TO_ARCHIVE       = 7

      OTHERS                        = 8

             .

former_member217544
Active Contributor
0 Kudos

Hi,

If the table 'Lines' is getting filled then debug the loop and write statement and check whether it is going to write statement or not?

Regards,

Swarna

venkateswaran_k
Active Contributor
0 Kudos

Hi

What is the language you are passing?

language                      = 'P' "sy-langu'

Try with sy-langu.

Regards,

Venkat

0 Kudos

Hi,

P is the language code for Portuguese. So assuming he has maintained the text in that language.

Cheers,

Arindam

0 Kudos

Hi,

Yes I have maintained text in Portuguese language..but i also maintained it in English language and passed language as 'E' over there but still no use..

0 Kudos

Check the window where you are passing and writing the text. Write some fixed text and see if that appears.

Cheers,

Arindam

FredericGirod
Active Contributor
0 Kudos

Hi Dharmin,

when I play with READ_TEXT, I always first check if the text exist using a SELECT statement on the table STXH. (header text)

You will be able to check if text exit, if text exist in an other language, ...

regards

Fred

0 Kudos

Hi Frederic,

The text is getting fetched in the table "lines" in loop statement.. but its not getting displayed..!

0 Kudos

maybe it's simply because your forget "/"

do 10 times.

write : / "Toto".

enddo.

Regards

Fred

former_member217544
Active Contributor
0 Kudos

Hi,

Is this is only code in your program? May not be the reason, but can you keep this '/' after write statement.

LOOP AT lines INTO lw_tline.

   IF lw_tline-tdline ne ' '.

     WRITE: / lw_tline-tdline.

   ENDIF.

ENDLOOP.

Regards,

Swarna

Former Member
0 Kudos

Hi Doshi,

At the standard text creating time which language are given.

The same language is give in function module.

For Ex :- We use 'EN' at the creation time.

CALL FUNCTION 'READ_TEXT'

     EXPORTING

*     CLIENT                        = SY-MANDT

       id                                 = 'ST'

       language                      =   'E' "sy-langu'

       name                           = l_tname

       object                          ='TEXT'

*     ARCHIVE_HANDLE      = 0

*     LOCAL_CAT                = ' '

    IMPORTING

      HEADER                       = TEXTHEADER

     tables

       lines                             = lines

    EXCEPTIONS

      ID                                  = 1

      LANGUAGE                   = 2

      NAME                            =3

      NOT_FOUND                  = 4

      OBJECT                         = 5

      REFERENCE_CHECK    = 6

      WRONG_ACCESS_TO_ARCHIVE       = 7

      OTHERS                        = 8

             .

himanshu_gupta13
Active Participant
0 Kudos

Dear Doshi,

Here, the language P defines the Portuguese language, so the object which you made should also be in P language so please you check it in SO10 first.

Many Thanks / Himanshu Gupta

0 Kudos

HI himanshu,

Yes i hav maintained text in Portuguese language..I hav even maintained it in English language and i changed and passed language as 'E' over there.. but still not displaying...

0 Kudos

Hi,

Have you check the layout text position and the window size in which the text is displayed.

Cheers,

Arindam

0 Kudos

Hi Dharmin,

you should use 'SYST' in place of 'ST' for id in function module.

Many Thanks / Himanshu Gupta

0 Kudos

Hi Himanshu,

Please verify before you advice. Advice should be ideally correct. It should be 'ST' only. You can check the same in SO10 or in my screenshot above.

Please try to give correct guidelines.

BR.

raymond_giuseppi
Active Contributor
0 Kudos

The code seems correct, but where is it called, in a module pool ?

Try to add a LEAVE TO LIST-PROCESSING [AND RETURN TO SCREEN dynnr] after the LOOP/ENDLOOP with WRITE statements.

Regards,

Raymond

0 Kudos

Hi Raymond,

I think it's a very simple things :  write : / ...

regards

Fred

0 Kudos

If the problem was only the missing of “NEW-LINE” in the write statement, at least one line would appear. When I read the initial message, I understand that nothing appears ?

Can

0 Kudos

Hi Dharmin Doshi

You can try statement "LEAVE TO LIST-PROCESSING" before LOOP... ENDLOOP.

LEAVE TO LIST-PROCESSING.

LOOP AT lines INTO lw_tline.

   IF lw_tline-tdline ne ' '.

     WRITE: lw_tline-tdline.

   ENDIF.

ENDLOOP.

Regards,

Narendran.S