‎2007 Mar 07 7:03 AM
hi guys,
How to fetch the word GUI_DOWNLOAD from below CALL Function statement
using Split statement. Suggest me please.
Code should work on 46C to ECC compatible.
<b>
1.CALL<SPACE>FUNCTION 'GUI_DOWNLOAD'.
2.CALL<SPACE><SPACE> FUNCTION 'GUI_DOWNLOAD'.</b>
Thanks
Ambichan
‎2007 Mar 07 7:15 AM
Hi Prince,
Try this:
types: begin of t_text,
text1(40) type c,
text2(40) type c,
text3(40) type c,
end of t_text.
data : i_text type table of t_text,
wa_text type t_text.
data : word(100) type c value 'CALL FUNCTION ''GUI_DOWNLOAD'''.
split word at space into wa_text-text1 wa_text-text2 wa_text-text3.
append wa_text to i_text.
i_text-text3 contains the word GUI_DOWNLOAD
Regards,
George
reward points to helpful answers
‎2007 Mar 07 7:15 AM
Hi Prince,
Try this:
types: begin of t_text,
text1(40) type c,
text2(40) type c,
text3(40) type c,
end of t_text.
data : i_text type table of t_text,
wa_text type t_text.
data : word(100) type c value 'CALL FUNCTION ''GUI_DOWNLOAD'''.
split word at space into wa_text-text1 wa_text-text2 wa_text-text3.
append wa_text to i_text.
i_text-text3 contains the word GUI_DOWNLOAD
Regards,
George
reward points to helpful answers
‎2007 Mar 07 7:39 AM
hi Prince,
you can use the following logics.
data lv_string2(100).
data lv_string1(100).
data lv_string3(100).
lv_string = 'CALL<SPACE>FUNCTION ''GUI_DOWNLOAD'''.
split lv_string at '''' into lv_string1 lv_string2 lv_string3.
write:/ lv_string2.OR
data lv_string(100).
lv_string = 'CALL<SPACE>FUNCTION ''GUI_DOWNLOAD'''.
search lv_string for ''''.
lv_string = lv_string+sy-fdpos
write:/ lv_string.Hope this helps,
Sajan Joseph.
‎2007 Mar 07 7:47 AM
Hi
U can do it with split and search also.
See the examples below for understadning it
For split :
DATA: string10(60) TYPE c ,
p1(20) TYPE c VALUE '++++++++++++++++++++',
p2(20) TYPE c VALUE '++++++++++++++++++++',
p3(20) TYPE c VALUE '++++++++++++++++++++',
p4(20) TYPE c VALUE '++++++++++++++++++++',
del10(3) TYPE c VALUE '***'.
string10 = ' Part 1 *** Part 2 *** Part 3 *** Part 4 *** Part 5'.
WRITE string10.
SPLIT string10 AT del10 INTO p1 p2 p3 p4.
WRITE / p1.
WRITE / p2.
WRITE / p3.
WRITE / p4
Using Search :
DATA string7(30) TYPE c VALUE 'This is a little sentence.'.
WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.
ULINE /1(26).
SEARCH string7 FOR 'X'.
WRITE: / 'X', sy-subrc UNDER 'SY-SUBRC',
sy-fdpos UNDER 'SY-FDPOS'.
SEARCH string7 FOR 'itt '.
WRITE: / 'itt ', sy-subrc UNDER 'SY-SUBRC',
sy-fdpos UNDER 'SY-FDPOS'.
SEARCH string7 FOR '.e .'.
WRITE: / '.e .', sy-subrc UNDER 'SY-SUBRC',
sy-fdpos UNDER 'SY-FDPOS'.
SEARCH string7 FOR '*e'.
WRITE: / '*e ', sy-subrc UNDER 'SY-SUBRC',
sy-fdpos UNDER 'SY-FDPOS'.
SEARCH string7 FOR 's*'.
WRITE: / 's* ', sy-subrc UNDER 'SY-SUBRC',
sy-fdpos UNDER 'SY-FDPOS'.
Regards,
Prasanth
Reward all the helpful answers
‎2007 Mar 07 8:18 AM
pls go through this code
data : text(40).
data : textsp(40).
data : text1(15),text2(15),text3(15).
data : spaces(2) value ' '.
concatenate 'call function' '''gui_upload''' into text separated by space.
concatenate 'call function' '''gui_upload''' into textsp separated by spaces.
*replace '''' in text with '/'.
split text at '''' into text1 text2 text3.
write : / text2.
split textsp at '''' into text1 text2 text3.
write : / text2.
regards
shiba dutta