Application Development 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: 

forms

jhansi_raja
Explorer
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

jhansi_raja
Explorer
0 Kudos

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.

jhansi_raja
Explorer
0 Kudos

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

0 Kudos

"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.