on 10-17-2007 4:49 AM
hi,
i have 2 strings :
AB:9085
123AB:9085
as 9085 not in the same start or fixed position, may i know how to extract it? the length to extract is always 4 and after AB:
thanks
Hi,
U can use SEARCH statement as follows:
DATA : str1 TYPE string VALUE 'AB:9085',
str2 TYPE string VALUE '123AB:9085',
index TYPE i.
SEARCH str1 FOR 'AB:'.
IF sy-subrc = 0.
index = sy-fdpos + 3.
WRITE : str1+index(4).
ENDIF.
Regards,
Himanshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use search syntax
or contain string co
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please give me reward points..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
variable = var+3(4)
where var = AB:9085.
Regards,
Atish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.