Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Substr field in SAP Query.

0 Kudos

Dear Developer,

How to substr any field in SAP Query ?

Regards,

Ujed.

2 REPLIES 2

Clemenss
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Ujed,

To do substrings in SAP Query simply use the following syntax:

Field[FromPos : ToPos]

Regards,

Leif