09-25-2008 11:19 AM
How to extract string seperately into different units .
i need CALL FUNCTION into one and then the remanining part into other.
The problem is the string may be not be of same size.But it will always hold 'CALL FUNCTION'.
Example
CALL FUNCTION 'UPLOAD'
CALL FUNCTION 'WS_UPLOAD'.
PLEASE HELP.
09-25-2008 11:22 AM
HERE you will see in upload method set it.
HAS_FIELD_SEPARATOR = 'X'
09-25-2008 11:26 AM
Hello,
Check this sample:
DATA: STR TYPE STRING,
STR1 LIKE STR,
STR2 LIKE STR.
STR = 'CALL FUNCTION `WS_UPLOAD'.
SPLIT STR AT '`' INTO STR1 STR2.
WRITE:/ STR1,
/ STR2.
Cheers,
Vasanth
09-25-2008 11:27 AM
hi look at this..
or use this..
HR_EFI_CONVERT_STRING_TO_TABLE
SWA_STRING_TO_TABLE
09-25-2008 11:27 AM
Hi
PARAMETERS :
p_str(35) TYPE c.
DATA :
w_cf TYPE string VALUE 'CALL FUNCTION',
w_str TYPE string,
w_str1 TYPE string,
w_str2 TYPE string,
w_len TYPE i,
w_temp TYPE i.
CONCATENATE w_cf ' ''' p_str '''' INTO w_str.
w_len = STRLEN( w_str ).
w_temp = w_len - 13.
WRITE :
/ w_str.
w_str1 = w_str+0(13).
w_str2 = w_str+13.
WRITE /:
w_str1 , w_str2.
Regards
Pavan
09-25-2008 11:27 AM
get the string length
v_strlen = strlen ( field ).
v_strlen = v_strlen - 14.
v_val1 = field+0(13).
v_val2 = field+14(v_strlen).
09-25-2008 11:36 AM
Hi Susmitha,
PARAMETER p_str TYPE string.
DATA : abc TYPE i.
abc = STRLEN( p_str ).
abc = abc - 13.
WRITE 😕 p_str+abc.
WRITE 😕 p_str+0(13).
Thanks & Regards
09-25-2008 11:46 AM
just check this.
data:prefix type string value 'CALL FUNCTION'.
data:suffix type string.
data:split_string type tring 'CALL FUNCTION WS_UPLOAD'
data:length type i.
length = strlen( split_string ).
length = length - 1.
suffix = split_string+13(length).
write prefix
write suffix.
09-25-2008 11:55 AM
Hi,
first find the length(say x) and then deduct 13 from that(y = x-13) and copy the remaining string to another string like this
data:c type string value 'CALL FUNCTION XYZ' ,
a type string ,
b type string,
x type i,
y type i.
x = STRLEN( c ) .
y = x - 13.
a = c+13(y).
Rhea.