‎2015 Apr 24 11:25 AM
hi All,
My requirment is to get character from String
for E.G.
hithisistest_EN.Doc this is my text
now i want to onaly EN in my result.
Also check whether this language is exist or not in system?
Thanks,
Mahipal
‎2015 Apr 24 11:31 AM
Hi,
Is the format of text going to be same as you have mentioned in your example??
‎2015 Apr 24 11:37 AM
‎2015 Apr 24 11:41 AM
Try this.
lv_str = 'hithisistest_EN.Doc'
split lv_str at '_' into lv_str1 lv_str2.
split lv_str2 at '.' into lv_str1 lv_str2.
lv_str1 will contain 'EN'
Check it in T002 table.
‎2015 Apr 24 11:44 AM
every time EN is not fixed but there should be any two character of language in SAP
‎2015 Apr 24 11:49 AM
As long as your text contains '_' and '.' above code will work fine.
You can test it by replacing text with any value. Variable lv_str1 will contain text that follows '_' and precedes '.'.
‎2015 Apr 24 11:38 AM
i am looking for any direct Keyword in ABAP which is giving expected Result
‎2015 Apr 24 2:55 PM
Mahipalsinh Parmar wrote:
i am looking for any direct Keyword in ABAP which is giving expected Result
Sometimes you just have to roll up your sleeves and write code.
Rob
‎2015 Apr 24 2:43 PM
DATA: lo_matcher TYPE REF TO cl_abap_matcher,
ls_result TYPE match_result,
lv_lang TYPE sy-langu.
lo_matcher = cl_abap_matcher=>create(
pattern = '\_([A-Z]{2})\.'
text = 'hithisistest_EN.Doc' ).
lo_matcher->find_next( ).
lv_lang = lo_matcher->get_submatch( 1 ).
WRITE lv_lang.
‎2015 Apr 24 4:33 PM
To complement the table with languages is the T002 but if you wanna know only languages installed (Founded in transaction SMLT), so you need check the T002C table and looking up rows with X value on LAINST field.