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

Why parameter 'rest' always blank when call FM 'TEXT_SPLIT'?

Former Member
0 Likes
602

Dear All:

     Please help. As subject. When I using SE37 to run TEXT_SPLIT,parameter 'rest' return is correct, but in t he abap program to call TEXT_SPLIT

'rest' always return blank?

     Please help. Thanks a lot!!

1 ACCEPTED SOLUTION
Read only

rosenberg_eitan
Active Contributor
0 Likes
489

Have a look at this code I hope it will help.

DATA: p_big_text TYPE line1000 .
  DATA: p_line TYPE string .

  p_big_text = '11111111112222222222333333333344444' .

  DATA: it_text TYPE TABLE OF string .

  WHILE p_big_text NE space.

    CALL FUNCTION 'TEXT_SPLIT'
      EXPORTING
        length = 10
        text   = p_big_text
      IMPORTING
        line   = p_line
        rest   = p_big_text.

    IF p_line IS NOT INITIAL .
      APPEND p_line TO it_text .
    ENDIF .

  ENDWHILE.

Using Debug look at it_text

Dear All:

     Please help. As subject. When I using SE37 to run TEXT_SPLIT,parameter 'rest' return is correct, but in t he abap program to call TEXT_SPLIT

'rest' always return blank?

     Please help. Thanks a lot!!

1 REPLY 1
Read only

rosenberg_eitan
Active Contributor
0 Likes
490

Have a look at this code I hope it will help.

DATA: p_big_text TYPE line1000 .
  DATA: p_line TYPE string .

  p_big_text = '11111111112222222222333333333344444' .

  DATA: it_text TYPE TABLE OF string .

  WHILE p_big_text NE space.

    CALL FUNCTION 'TEXT_SPLIT'
      EXPORTING
        length = 10
        text   = p_big_text
      IMPORTING
        line   = p_line
        rest   = p_big_text.

    IF p_line IS NOT INITIAL .
      APPEND p_line TO it_text .
    ENDIF .

  ENDWHILE.

Using Debug look at it_text