08-05-2008 7:20 PM
Hi Experts,
Can anyone help me in fetching the required string from a line of text which is coming from an internal table.
For Eg: Form routines for view cluster maint. (EI_DD_026)
In the above sentence i need to extract only EI_DD_026.
Let's take another example.
Eg: The link DS_FS_023_MN is available in (Repository).
In the above senetence i need to extract only DS_FS_023_MN.
Only the Hint I have is that text will have DD / FF format.
I tried using Split ,CP but did not get desired results due to Dynamic changes in the text .
Thanks in Advance.
Regards
Ullas
08-05-2008 7:35 PM
From the examples you gave, it looks like you might have a underscore in all your required string. Why dont you try splitting and looking for underscore?
08-05-2008 7:40 PM
Will this kind of work around help?
TYPES: BEGIN OF TY_DATA,
TEXT TYPE CHAR200,
END OF TY_DATA.
DATA: IT_DATA TYPE STANDARD TABLE OF TY_DATA,
IT_SPLIT TYPE STANDARD TABLE OF TY_DATA.
DATA: LA_DATA TYPE TY_DATA,
LA_SPLIT TYPE TY_DATA.
LA_DATA-TEXT = 'Form routines for view cluster maint. (EI_DD_026)'.
APPEND LA_DATA TO IT_DATA.
CLEAR LA_DATA.
LA_DATA-TEXT = 'The link DS_FS_023_MN is available in (Repository).'.
APPEND LA_DATA TO IT_DATA.
CLEAR LA_DATA.
LOOP AT IT_DATA INTO LA_DATA.
SPLIT LA_DATA AT SPACE INTO TABLE IT_SPLIT.
LOOP AT IT_SPLIT INTO LA_SPLIT.
REPLACE '(' IN LA_SPLIT-TEXT WITH ' '.
CONDENSE LA_SPLIT-TEXT.
REPLACE ')' IN LA_SPLIT-TEXT WITH ' '.
CONDENSE LA_SPLIT-TEXT.
IF LA_SPLIT-TEXT+2(1) = '_'.
WRITE: / LA_SPLIT-TEXT.
ENDIF.
ENDLOOP.
ENDLOOP.
Regards,
Naimesh Patel