03-28-2008 11:33 AM
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
03-28-2008 11:38 AM
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.
03-28-2008 11:44 AM
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.
03-28-2008 11:55 AM
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.
03-28-2008 11:57 AM
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
03-28-2008 12:14 PM
"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.