*&---------------------------------------------------------------------* *& Report _LIB_BASIC_01_WRITE *& *&---------------------------------------------------------------------* *& Description: *& Demonstration of WRITE statement *& *& Technical description: *& - Hello World basic output using non-translatable and translatable *& technique *& - Changing background color using FORMAT COLOR statement *& - Using additional frequently used WRITE options *& - Displaying system variables *& - Displaying icons *& *& More Information: *& - http://help.sap.com/saphelp_470/helpdata/en/9f/db9e2335c111d1829f0000e829fbfe/content.htm *& *&---------------------------------------------------------------------* *& Change log: *& Date Author Action *& *& *&---------------------------------------------------------------------* REPORT _LIB_BASIC_01_WRITE. *-----------------------------------* * DECLARATIONS *-----------------------------------* * MAIN LOGIC *------------------------* * Hello World " Non-translatable way " Output "Hello World" using hardcoded text " Output "Hello World" using hardcoded text in new line " Output "Hello World" using chained hardcoded text " Output "Hello World" using string variable with default value " Output "Hello World" using character variable with defined text " Translatable way " Output "Hello World" using Text Element. In case that there is no text " element defined in the system, does not display anything " Output "Hello World" using Text Element. In case that there is no text " element defined in the system, SAP uses at least hardcoded string " See what happens when Text element is not defined in both cases *------------------------* * Background color " { 0 | COL_BACKGROUND } 0 GUI-specific " Changing BG color can be written both ways " { 1 | COL_HEADING } 1 Gray-blue " { 2 | COL_NORMAL } 2 Light gray " { 3 | COL_TOTAL } 3 Yellow " { 4 | COL_KEY } 4 Blue-green " { 5 | COL_POSITIVE } 5 Green " { 6 | COL_NEGATIVE } 6 Red " { 7 | COL_GROUP } 7 Violet *------------------------* * Additional WRITE options " Display string starting from position 20 " Display string starting from position of 'Hello World' string " Display 16 characters long string starting from position 20 -> Output: "WRITE /20(16)"He" " Display part of string variable; Starting from position 14, displaying 10 characters " Display part of character variable; Starting from position 14, displaying 10 characters *------------------------* * Icons " Lets display some icons " Icons can be used in text as well *------------------------* * System variables " Formatting is done using "UNDER" statement which aligns printed word under defined text string " For more information use: https://help.sap.com/saphelp_46c/helpdata/en/7b/fb96c8882811d295a90000e8353423/content.htm SKIP. ULINE. WRITE: / 'Use F3 keyboard shortcut to get back.'.