cancel
Showing results for 
Search instead for 
Did you mean: 

Read text display

Former Member
0 Kudos

HI ,

I am able to read the header text from "read_text" function module in the smartform in the program lines .

I want to display it in the text element .

The data is available in internal table .I want to display all the internal table data read from read_text in the smartform output.

Pls help

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member181995
Active Contributor
0 Kudos

Bharat,

refer below code:

CALL FUNCTION 'READ_TEXT'
    EXPORTING
      client                  = sy-mandt
      id                      = stxh-tdid
      language                = stxh-tdspras
      name                    = name
      object                  = stxh-tdobject
    TABLES
      lines                   = i_lines[]
    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.
* Only 4 lines of Header text supported. Can add if needed
    LOOP AT i_lines INTO r_lines.
      CONDENSE r_lines-tdline NO-GAPS.
      v_cnt = v_cnt + 1.
      CASE v_cnt.
        WHEN 1.
          zzboldsx = r_lines-tdline.
        WHEN 2.
          zzboldsx2 = r_lines-tdline.
        WHEN 3.
          zzboldsx3 = r_lines-tdline.
        WHEN 4.
          zzboldsx4 = r_lines-tdline.
        WHEN OTHERS.
          EXIT.
      ENDCASE.
*   zzbolDSX =  i_lines-tdline .
    ENDLOOP.

here i print zzboldsx,zzboldsx2,zzboldsx3,zzboldsx4

Former Member
0 Kudos

Hi Bharathiraja,

Instead of using READ_TEXT Function module in smartform program lines and displaying using text element in loop, you can easily include the contents of the header text by;

1) Create a new Text Element

2) Change the type of the text element in the general attributes to I Include text

3) Enter the Textname, textobject, textid and language values which u supply to the function module....

4) Now it will display all the contents of the header text.

No need for program lines or loop or internal table, this is the easiest way to display header text/

Regards

Karthik D

Former Member
0 Kudos

Hi Bharathi Raja,

Put a loop and in that mention your internal table name and wa

and in the text element outout that and in that set the type as append directly.

This is one way or else you can directly create a text element and in that you can chang the type of the text element as include text and in that give the text id text name and text language and dont forget to check the box No error if no text exists.

Hope this helps

Regards,

Ravi

Former Member
0 Kudos

Hi,

use the loop node and give the internal table.

under that loop node create the text node to write the content.

there is Another way to get the text instead of writing the code to get the text

create the text node and change the text type as include text.

and give the text name then it will print the entire text.

Regards,

Jagadeesh.