‎2012 Aug 14 10:53 AM
The following code was copied from here:-
Could anyone please advice what is wrong.... We are on SAP ECC 6.0 with the following details:-
SAP_BASIS 701 0003 SAPKB70103 SAP Basis Component
SAP_ABA 701 0003 SAPKA70103 Cross-Application Component
PI_BASIS 701 0003 SAPK-70103INPIBASIS Basis Plug-In
ST-PI 2008_1_700 0005 SAPKITLRD5 SAP Solution Tools Plug-In
SAP_BS_FND 701 0003 SAPK-70103INSAPBSFND SAP Business Suite Foundation
SAP_BW 701 0003 SAPKW70103 SAP Business Warehouse
GRCPINW V1000_700 0007 SAPK-10307INGRCPINW SAP GRC NW Plug-in
SAP_AP 700 0015 SAPKNA7015 SAP Application Platform
*****************EXAMPLE CODE********************************
CLASS demo IMPLEMENTATION.
METHOD main.
DATA result TYPE string VALUE 'oo'.
WRITE result.
DO strlen( result ) / 2 - 1 TIMES.
result =
shift_left( val = substring( val = result
len = strlen( result ) / 2 )
circular = 1 ) &&
shift_right( val = substring( val = result
off = strlen( result ) / 2 )
circular = 1 ).
WRITE / result.
ENDDO.
DO strlen( result ) / 2 - 1 TIMES.
result =
shift_right( val = substring( val = result
len = strlen( result ) / 2 )
circular = 1 ) &&
shift_left( val = substring( val = result
off = strlen( result ) / 2 )
circular = 1 ).
WRITE / result.
ENDDO.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
demo=>main( ).
‎2012 Aug 14 12:18 PM
Thanks for providing all relevant information (a huge exception, unfortunately).
You are on AS ABAP 701, however the example you are quoting is for 702. 702 introduced many new features, enhanced logic for expression positions being just one:
http://help.sap.com/abapdocu_702/en/abennews-71-expressions.htm
In your release, you will have to split your statements into several pieces, e.g.
DO strlen( result ) / 2 - 1 TIMES.
into something like
i = strlen( result ) / 2 - 1.
DO i TIMES.
and so on.
Thomas
‎2012 Aug 14 12:27 PM
Thank you for replying. Please can you advice how i can split this according to my version. The expression in bold is also giving similar error..or shall i say there is no substring function at all on 701? thanks alot in advance......
DATA result TYPE string.
...
result = substring( val = 'ABCDEFGH' off = 2 len = 2 ).
‎2012 Aug 14 12:37 PM
Correct, only available from 702. Please read about the release specfic changes in the ABAP documentation (link aready known).
I guess above is the same as
val = 'ABCDEFGH'.
result = val+2(2).
Please try solving the other ones yourself.
Thomas
‎2012 Aug 14 1:27 PM
Hi,
Check out the below link for your reference.
http://maxdb.sap.com/doc/7_8/44/d901b762684426e10000000a155369/content.htm