The following methods gives different results based upon indentation of source code:
Results:
PROGRAM test. CLASS cl_test DEFINITION. PUBLIC SECTION. CLASS-METHODS bug1 RETURNING VALUE(r_string) TYPE string. CLASS-METHODS bug2 RETURNING VALUE(r_string) TYPE string. ENDCLASS. CLASS cl_test IMPLEMENTATION. METHOD bug1. CONCATENATE '______________________________________________________' '______________________________________________________________________' " not indented '______________' INTO r_string. ENDMETHOD. METHOD bug2. CONCATENATE '______________________________________________________' '______________________________________________________________________' " indented '______________' INTO r_string. ENDMETHOD. ENDCLASS. START-OF-SELECTION. WRITE: / 'Exact same code, only differ in indent:', / `bug1: `, cl_test=>bug1( ), / `bug2: `, cl_test=>bug2( ).
Results:
Exact same code, only differ in indent: bug1: ______________________________________________________'____...____ bug2: ___________________________________________________________...___
Comments