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

how to pass so10 text in Function Module Read_text

Former Member
0 Likes
9,272

Hello,

I have a requirement, I have created a So10 text, which contains some text that is content of email.

Now i have requirement I have to use FM READ_TEXT for this SO10 text.

CALL FUNCTION 'READ_TEXT'

  EXPORTING

    id                      = c_id

    language                = t_spras

    name                    = t_text

    object                  = c_object

  TABLES

    lines                   =  ht_tline

  EXCEPTIONS

    id                      = 1

    language                = 2

    name                    = 3

    not_found               = 4

    object                  = 5

    reference_check         = 6

    wrong_access_to_archive = 7

    OTHERS                  = 8.

Here I have declared this variable like below

c_id     LIKE thead-tdid VALUE 'ST',

c_object LIKE thead-tdobject VALUE 'TEXT'.

t_spras          LIKE     nast-spras,

t_text         LIKE thead-tdname,

ht_tline         LIKE STANDARD TABLE OF tline WITH HEADER LINE,

gt_tline         LIKE STANDARD TABLE OF tline WITH HEADER LINE.

But i do not know where to pass my so10 text to appear in email body.

Can anybody help on this.

Hello,

I have a requirement, I have created a So10 text, which contains some text that is content of email.

Now i have requirement I have to use FM READ_TEXT for this SO10 text.

CALL FUNCTION 'READ_TEXT'

  EXPORTING

    id                      = c_id

    language                = t_spras

    name                    = t_text

    object                  = c_object

  TABLES

    lines                   =  ht_tline

  EXCEPTIONS

    id                      = 1

    language                = 2

    name                    = 3

    not_found               = 4

    object                  = 5

    reference_check         = 6

    wrong_access_to_archive = 7

    OTHERS                  = 8.

Here I have declared this variable like below

c_id     LIKE thead-tdid VALUE 'ST',

c_object LIKE thead-tdobject VALUE 'TEXT'.

t_spras          LIKE     nast-spras,

t_text         LIKE thead-tdname,

ht_tline         LIKE STANDARD TABLE OF tline WITH HEADER LINE,

gt_tline         LIKE STANDARD TABLE OF tline WITH HEADER LINE.

But i do not know where to pass my so10 text to appear in email body.

Can anybody help on this.

3 REPLIES 3
Read only

Former Member
0 Likes
5,048

Hi Asha,

Pass the Name of the Standard Text Created to the Exporting Parameter NAME.

The Standard Text will appear in the Tables Parameter.

Regards,

Vinay Mutt

Read only

RaymondGiuseppi
Active Contributor
5,048

Call transaction SO10 and display your text, then in menu navigate to Goto, Header and you see the required keys top/down TDNAME, TDSPRAS, TDID ('ST' for standard text), TDOBJECT.

Regards,

Raymond

Read only

santanunayek
Explorer
0 Likes
5,048

Hi Asha,

Check the below code. Its reading text for particular sales order and item.

CLEAR name.

     CONCATENATE lw_vbap-vbeln lw_vbap-posnr INTO name.

*          CONDENSE NAME.

     CALL FUNCTION 'READ_TEXT'

       EXPORTING

         client                  = sy-mandt

         id                      = 'Z010'

         language                = 'E'

         name                    = name

         object                  = 'VBBP'

       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.

     IF sy-subrc EQ 0.

       CONCATENATE LINES OF lines INTO lw_final-remarks RESPECTING BLANKS.

       REPLACE ALL OCCURRENCES OF '*' IN lw_final-remarks WITH space.

*           REPLACE ALL OCCURRENCES OF '*' IN LW_FINAL-REMARKS WITH SPACE.

     ENDIF.