Skip to Content
1
Nov 27, 2015 at 01:50 PM

ABAP 7.4: SHIFT, places calculated

366 Views

Hi,

I want to re-design the following coding sequence:

CREATE DATA ltype TYPE LINE OF (tabname).
ASSIGN ltype->* TO FIELD-SYMBOL(<ltype>).
typedescr = cl_abap_typedescr=>describe_by_data( <ltype> ).
tabname = typedescr->absolute_name.
SHIFT tabname:
LEFT UP TO '=',
LEFT BY 1 PLACES.


tabname contains i. e. '/TYPE=MARA', I need the table name MARA. The double-shift bothers me. I'd like to do something like this:


tabname = shift_left( shift_left( val = tabname places = find( val = typedescr->absolute_name sub = '=' ) ) places = 2 ).


(wich means: find the '=' in absolute_name, shift to this char, shift 2 places more, the result is the table's name, i. e. MARA).


What I am doing wrong?