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

Problem with FM TEXT_SYMBOL_SETVALUE

Former Member
0 Likes
949

Hi Forum,

When using FM TEXT_SYMBOL_SETVALUE for replacimg variable in SO10 text.

Data declaration in FM:

data: nam like tline-tdline,

       val(c_ts_maxval),                     

       val_length like integer,

       field_type.

In the above code c_ts_maxval is always 80 hence the string is truncated after 80 chars.

I tried passing different lengths in importing param VALUE_LENGTH to the FM but still the string is truncated after 80 chars.

Has anyone faced this issue, is there a note for this?

Thank you,

Anubhav

1 ACCEPTED SOLUTION
Read only

former_member194152
Contributor
0 Likes
809

Check with FM documentation, in which 80 character restriction is thr in FM itself you cant increase it :

Check with FM documentation, in which 80 character restriction is thr in FM itself you cant increase it :

2 REPLIES 2
Read only

former_member194152
Contributor
0 Likes
810

Check with FM documentation, in which 80 character restriction is thr in FM itself you cant increase it :

Read only

Former Member
0 Likes
809

Just for info, I am handling long strings with below code...

DATA:

         lv_chat(80),

         lv_strlen TYPE i,

         lv_rem TYPE p DECIMALS 1,

         lv_loop TYPE i,

         lv_remaining TYPE i.

   DATA lv_param(12).

   DATA lv_index.

   DATA lv_completed TYPE i.

   DATA lv_offset_s TYPE i.

  lv_strlen = strlen( ls_chat-message ).

     lv_rem = lv_strlen / 80.

     lv_loop = ceil( lv_rem ).

     lv_completed = 80 * ( lv_loop - 1 ).

     lv_remaining = lv_strlen - lv_completed.

     DO lv_loop TIMES.

       lv_index = sy-index.

       lv_offset_s = 80 * ( lv_index - 1 ).

       CONCATENATE `QUES_TEXT` lv_index INTO lv_param.

       IF sy-index = lv_loop.

         lv_chat = ls_chat-message+lv_completed(lv_remaining).

       ELSEIF sy-tabix LT lv_loop.

         lv_chat = ls_chat-message+lv_offset_s(80).

       ENDIF.

       CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'

         EXPORTING

           name            = lv_param

           value           = lv_chat

           replace_symbols = 'X'.

     ENDDO.

in SO10 text I have used 4 place holders like QUES_TEXT1, QUES_TEXT2 and so on since in my case text can not be longer 300 chars i.e less then apprx 80*4 = 320 chars hence 4 place holders. In above code I determine the string length and based on the calculations replace the place holders.

Thanks

Anubhav