on 09-09-2014 9:13 AM
Hello,
my requirement is as such, lets say we have an input string ABHISHEK #1234, or BOMBAY 123 #235,
i need to find if the character string has # in it,, if yes pick all the numbers after # .
in the above example, i need output as 1234 and 235
and if any non numeric values after # set a flag
please help me in this.
regards
Abhishek
Hi Abhishek,
$GV_VALUE -- Is your String value
Index function can be used to identify # in string
decode(index($GV_VALUE,'#',1)>0,substr( $GV_VALUE ,index($GV_VALUE,'#',1)+1,length($GV_VALUE)- index($GV_VALUE,'#',1)+1),$GV_VALUE)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello Balakrishna,
tried your logic but gives error syntax incorrect.
lets say , input is not a global variable but a table1.field 10
and output field is table2.field11
decode(index(table1.field 10,'#',1)>0,substr( table1.field 10 ,index(table1.field 10,'#',1)+1,length(table1.field 10)- index(table1.field 10,'#',1)+1),table1.field 10)
thanks and regards,
abhishek
Hi Abhishek,
This can be done in BODS using below settings in file format (only if your source is flat file):
Below is the source file data :
abcd#1234,Bombay#23456
By using this file format setting, you should be able to get all the numbers in one column which you can use futher and you can verify this columns data by using "is_valid_int", not null function in BODS.
I think it should give you solution.
Thanks,
Tanvi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhishek,
one way of doing it is
DATA a type string,
b type string ,
c type string,
.
a = 'abhis#1234'.
split a at '#' into b c.
if sy-subrc = 0.
write : c.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.