06-11-2011 4:45 AM
Dear Developer,
How to substr any field in SAP Query ?
Regards,
Ujed.
06-12-2011 5:02 PM
Hi Ujed,
if SUBSTR stands for substring, then possibly your question may be how to get the substr method as konown in languages like php in ABAP. If SAP Query points to a SAP query as created in transaction SQ01, then you should explain what you want to achieve.
Note: Better ask a specific question and get am answer you can or which is already generalized.
If I need a substr function, I'd create a functional method for that:
method substr
importing
anyfield type any
offset type i
length type i
returning substring type string.
try.
substring = anyfield+offset(length).
catch cx_root.
* handle error
endtry.
endmethod.
Regards,
Clemens
04-10-2013 6:54 AM
Hi Ujed,
To do substrings in SAP Query simply use the following syntax:
Field[FromPos : ToPos]
Regards,
Leif