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

forms

jhansi_raja
Explorer
0 Likes
706

Hi,

Help me if any one of you know this answer.

There is a textfield called sgtxt in Goodsreceipt which holds four field details with spaces after every fieldvalue in single line.We have to divide the text into fourfields and display.please provide the logic

5 REPLIES 5
Read only

Former Member
0 Likes
657

This works


DATA: wkfld(20).

DATA:
  BEGIN OF wkrec,
    line(30),
  END OF wkrec,
  it_split LIKE STANDARD TABLE OF wkrec.

START-OF-SELECTION.

  wkfld = 'One Two Three Four'.

  SPLIT wkfld AT space INTO TABLE it_split.

  LOOP AT it_split INTO wkrec.
    WRITE:/ wkrec-line.
  ENDLOOP.

Read only

Former Member
0 Likes
657

Hi,

data : str1(10) type c,
         str2(10) type c,
         str3(10) type c,
         str4(10) type c.

SPLIT sgtxt AT space INTO: str1 str2 str3 str4.

Regards,

Morris Bond.

Reward Points if Helpful.

Read only

jhansi_raja
Explorer
0 Likes
657

DATA:lit_words TYPE TABLE OF string WITH HEADER LINE.

SPLIT gwa_mseg-sgtxt AT space INTO TABLE lit_words.

I made it.please refer it.

Read only

jhansi_raja
Explorer
0 Likes
657

DATA:lit_words TYPE TABLE OF string WITH HEADER LINE.

SPLIT gwa_mseg-sgtxt AT space INTO TABLE lit_words.

read table lit_words into lv_str1 index 1.

read table lit_words into lv_str2 index 3.

read table lit_words into lv_str3 index 2.

read table lit_words into lv_str4 index 4.

i made it please refer

Read only

0 Likes
657

"READ Statement may fail some times if value is not filled in.
"You can use this follwing statement also.

SPLIT gwa_mseg-sgtxt AT space INTO lv_str1
                                   lv_str2
                                   lv_str3
                                   lv_str4.