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

SO10 text does not get displayed when called in Program

Former Member
0 Likes
12,722

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.

HI Guys,

Thanks for all your reply.. i tried using WRITE:/ statement after the FM call.. but it didnt help.

So i tried using FM popup_to_displat_text which did show the message in the pop-up window.. but business didn't want the pop-up box..

So now what i did is.. i wrote a READ statement instead of WRITE:/ and then i called this tables text with the help of a message

like.. i had the text in table lines so i called it like this..

Message e000 with lines-tdline.

and this started showing my text.

So thanks again for all your inputs.

49 REPLIES 49
Read only

0 Likes
2,054

HI,

i tried adding WRITE:/ but problem still persists.. text is getting read in "lines" table .. but its not getting displayed..!

Read only

0 Likes
2,054

Hi ,

Write code after End-Of-Selction.

Thanks,

KKP

Read only

venkateswaran_k
Active Contributor
0 Likes
2,054

Hi,

do as follows;

DATA:  final_line type c length 120.

LOOP AT lines INTO lw_tline.

   IF lw_tline-tdline ne ' '.

       CONCATENATE final_line  lw_tline-tdline  into final_line SEPARATED BY space.

   ENDIF.

ENDLOOP.

WRITE 😕  final_line.

Hope this will show you the result

kindly update

REgards,

Venkat

Read only

0 Likes
2,054

Hi Dharmin,

I tried your code and it works perfectly if you pass language parameter as 'E' or sy-langu.

Regards,

Saurabh

Read only

0 Likes
2,054

HI Saurabh,

but is it displaying the text on screen? if yes than how?

Read only

0 Likes
2,054

Hi Dharmin,

Yes, it displays text on the screen. Only thing I changed in your code is the language parameter and it worked fine.

Regards,

Saurabh

Read only

venkateswaran_k
Active Contributor
0 Likes
2,054

Hi Dharmin,

Please try this and let me know....

DATA:  final_line type c length 120.

LOOP AT lines INTO lw_tline.

   IF lw_tline-tdline ne ' '.

       CONCATENATE final_line  lw_tline-tdline  into final_line SEPARATED BY space.

   ENDIF.

ENDLOOP.

WRITE 😕  final_line.

Hope this will show you the result

kindly update

REgards,

Venkat

Read only

former_member217544
Active Contributor
0 Likes
2,054

Hi Doshi,

Did you try all the solutions suggested?

In case of module pool as suggested by Raymond:

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

or else try displaying it in the form of pop-up using any pop-up FMs.

Try these 2 suggestions and if it is still missing paste the code tried with these 2 solutions.

Regards,

Swarna

Read only

Former Member
0 Likes
2,054

HI Guys,

Thanks for all your reply.. i tried using WRITE:/ statement after the FM call.. but it didnt help.

So i tried using FM popup_to_displat_text which did show the message in the pop-up window.. but business didn't want the pop-up box..

So now what i did is.. i wrote a READ statement instead of WRITE:/ and then i called this tables text with the help of a message

like.. i had the text in table lines so i called it like this..

Message e000 with lines-tdline.

and this started showing my text.

So thanks again for all your inputs.

Read only

0 Likes
2,054

hi,

in this code

LOOP AT lines INTO lw_tline.

   IF lw_tline-tdline ne ' '.

*     WRITE: lw_tline-tdline.

store it into a temp internal table.

   ENDIF.

ENDLOOP.

display temp internal table.

Thanks & Regards,

buz_sap