<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: write statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938481#M942371</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check  this ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e3d35c111d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e3d35c111d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 May 2008 09:46:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-30T09:46:44Z</dc:date>
    <item>
      <title>write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938477#M942367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;explain the different formatting options for write statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 09:41:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938477#M942367</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T09:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938478#M942368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://venus.imp.mx/hilario/Libros/TeachYrslfAbap4/ch14.htm" target="test_blank"&gt;http://venus.imp.mx/hilario/Libros/TeachYrslfAbap4/ch14.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extras: &lt;/P&gt;&lt;P&gt;1. ... LEFT-JUSTIFIED|CENTERED|RIGHT-JUSTIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... NO-GAP &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ... UNDER other_dobj &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. ... EXPONENT exp &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. ... NO-GROUPING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. ... NO-SIGN &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. ... NO-ZERO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8. ... CURRENCY cur &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9. ... DECIMALS dec &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10. ... ROUND scale &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11. ... UNIT unit &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12. ... TIME ZONE tz &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;13. ... USING { {NO EDIT MASK}|{EDIT MASK mask} } &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;14. ... DD/MM/YY   | MM/DD/YY &lt;/P&gt;&lt;P&gt;     | DD/MM/YYYY | MM/DD/YYYY &lt;/P&gt;&lt;P&gt;     | DDMMYY     | MMDDYY &lt;/P&gt;&lt;P&gt;     | YYMMDD &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;These format options override the predefined settings. Without the specification of these additions, the output format depends implicitly on the data type. The result of formatting is adjusted to match the output length. If, during output, a conversion routine is executed, all the formatting options - except for NO-GAP and UNDER - are ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The additions can be used together with the following limitations: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The addition UNIT cannot be used together with the additions DECIMALS and ROUND. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The addition TIME ZONE cannot be used together with the additions CURRENCY, DECIMALS, EXPONENT, NO-GROUPING, NO-SIGN, NO-ZERO, ROUND, or UNIT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... LEFT-JUSTIFIED|CENTERED|RIGHT-JUSTIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition defines whether the output formatted according to the other options is aligned left-justified, centered, or right-justified outside the current output length in the list buffer. Closing blanks are ignored in the case of fields of the type c and they are treated like the other characters in the case of fields of type string. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The alignment takes place in that the superfluous positions in the list buffer are filled up either right-justified, or left-justified, or alternating right and left. If the output length is not sufficient, the characters are cut off to the right for left-justified and centered, and to the left for right-justified alignment. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the output length in the list display is not sufficient in Unicode systems, characters are cut off during transfer of data from the list buffer into the list. They are cut off to the right for left-justified, and to the left for right- justified output. In the case of centered output, blanks are removed in alternating fashion on both sides, whereby the cut-off starts on the side with more blanks, and then the other characters on the right side. If, during data transfer from the list buffer into the list, characters are cut off, this is made visible on the left side with the character &amp;lt; and on the right side with the character &amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output of three literals left, in the middle, and to the right of an output area 60 characters in length. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: /(60) 'Left'   LEFT-JUSTIFIED, &lt;/P&gt;&lt;P&gt;       /(60) 'Center' CENTERED, &lt;/P&gt;&lt;P&gt;       /(60) 'Right'  RIGHT-JUSTIFIED. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... NO-GAP &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The list cursor is positioned directly after the output and not in the position in the list buffer after the next one. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output for both WRITE statements is " NoGap". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'No' NO-GAP, 'Gap'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 3 &lt;/P&gt;&lt;P&gt;... UNDER other_dobj &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The output takes place in the current line at the position where, in a previous WRITE statement, the data object other_dobj was output. The data object other_dobj must be written in the same way as in the respective WRITE statement - that is, including possible offset/length specifications, and so on. if the data object other_dobj was not specified beforehand, the addition is ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The addition UNDER cannot be used together with a position specification pos after AT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vertical positioning must be taken care of. If the list cursor is at the same position as the output of other_dobj, this will be overwritten. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data object other_dobj should be defined globally in the current program. The use of local data objects in procedures can lead to undesirable results, for example, if components with the same structure are used in different procedures. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Table-type output of flight connections. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: carrid TYPE spfli-carrid, &lt;/P&gt;&lt;P&gt;      connid TYPE spfli-connid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 10 'Carrier', 40 'Connection'. &lt;/P&gt;&lt;P&gt;ULINE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT carrid connid &lt;/P&gt;&lt;P&gt;       FROM spfli &lt;/P&gt;&lt;P&gt;       INTO (carrid,connid). &lt;/P&gt;&lt;P&gt;  WRITE: / carrid UNDER 'Carrier', &lt;/P&gt;&lt;P&gt;           connid UNDER 'Connection'. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 4 &lt;/P&gt;&lt;P&gt;... EXPONENT exp &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition cannot be used together with the addition TIME ZONE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition defines the exponent for output of data objects of the data type f. For all other data types, the addition is ignored. For exp, a data object of the type i is expected that contains the required exponent. The mantissa is adjusted by moving the decimal point and inserting zeroes to the exponent. If exp contains the value 0, no exponent is output. If the value of exp is larger than the exponent in dobj plus 16, only zeroes are displayed in the mantissa. If the value of exp is less than the exponent in dobj and the output length is not sufficient for the required positions bfore the decimal separator, the addition is ignored. If the value in exp is positive and more than three digits, only the first three positions of the exponent are displayed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output of the WRITE statement is "1,414". The standard output for an output length of 6 would be "1E+00". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA float TYPE f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;float = sqrt( 2 ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE (6) float EXPONENT 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 5 &lt;/P&gt;&lt;P&gt;... NO-GROUPING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition cannot be used together with the addition TIME ZONE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition suppresses the thousands separator in the output of data objects of data types i or p. In all other data types, the addition is ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 6 &lt;/P&gt;&lt;P&gt;... NO-SIGN &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition cannot be used together with the addition TIME ZONE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition suppresses the plus/minus sign in the output of data objects of data types i, p, or f. In all the other data types, the addition is ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the addition NO-SIGN is used with the length specification * or ** after AT, it is used first and the output length is determined from the result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output with red background color instead of with a plus/minus sign. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA number TYPE i. &lt;/P&gt;&lt;P&gt;  DO 10 TIMES. &lt;/P&gt;&lt;P&gt;  number = sy-index - 5. &lt;/P&gt;&lt;P&gt;  IF number &amp;lt; 0. &lt;/P&gt;&lt;P&gt;    WRITE number NO-SIGN COLOR = 6. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;ENDDO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 7 &lt;/P&gt;&lt;P&gt;... NO-ZERO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition cannot be used together with the addition TIME ZONE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;If dobj has a numeric data type and contains the value 0, blanks are output for the length of the output. If dobj has the data type c, n, or string, leading zeroes are displayed by blanks. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output of 22 blanks with red background color instead of the standard output "0,0000000000000000E+00". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA float TYPE f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET BLANK LINES ON. &lt;/P&gt;&lt;P&gt;IF float = 0. &lt;/P&gt;&lt;P&gt;  WRITE float NO-ZERO COLOR = 6. &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 8 &lt;/P&gt;&lt;P&gt;... CURRENCY cur &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition cannot be used together with the addition TIME ZONE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition defines currency-dependent decimal places for the output of data objects of data types i or p. For all other data types, except for f, the addition is ignored. For cur, a three-digit, character-type field is expected that contains a currency key from the column CURRKEY of the database table TCURX in uppercase letters. The system determines the number of decimal places from the column CURRDEC of the respective row in the database table TCURX. If the content of cur is not found in TCURX, two decimal places are used. The following applies for numeric data types: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of data types of type i, a decimal separator is inserted at the position determined by cur and the thousands separators are moved accordingly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of data objects of type p, the decimal places defined in the definition of the data type are ignored completely. Irrespective of the actual value and without rounding actions, the decimal separators and the thousand separators are inserted at the positions in the numbers determined by cur. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of data objects of type f, the addition CURRENCY has the same effect as the addition DECIMALS (see below). Here, the number of decimal places is determined by cur. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the addition CURRENCY with length specification * or ** is used after AT, it is used first and the output length is determined from the result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The addition CURRENCY is appropriate for the display of data objects of type i or p without decimal places, whose contents are currency amounts in the smallest unit of the currency. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output of the WRITE statement is "123456,78". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA int TYPE i VALUE 12345678. &lt;/P&gt;&lt;P&gt;WRITE int NO-GROUPING CURRENCY 'EUR'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 9 &lt;/P&gt;&lt;P&gt;... DECIMALS dec &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition cannot be used together with the addition TIME ZONE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition defines the number of displayed decimal places for the output of data objects of data types i, p, or f. For all other data types, the addition is ignored. For dec, a data object of type i is expected that contains the number of required decimal places. If the content of dec is less than 0, it is treated as 0, whereby the content of data objects of data types i or p is previously multiplied by 10 to the power of dec. For the individual numeric data types, the following applies: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of data objects of type i, a decimal separator and as many zeroes as are specified in dec are added on. The content of dec can be maximum 14. Otherwise, an exception that cannot be handled will be triggered. If the content of dec is 0, the output is unchanged. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of data objects of type p, as many decimal places as are specified in dec are displayed - irrespective of the number of decimal places defined in the data type. The content of dec can be maximum 14. Otherwise, an exception that cannot be handled will be triggered. If dobj has more decimal places, it is rounded to the decimal places in dec. If dobj has less decimal places, a corresponding number of zeroes are inserted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of data objects of type f, the content of dec determines the number of decimal places in scientific notation. If the content of dec is greater than 16, it will be treated like 16. If the content of dec is greater than the number of decimal places in dobj, a corresponding number of zeroes will be inserted. If the content of dec is less than the number of decimal places in dobj, it is rounded to the decimal places defined in dec. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the addition DECIMALS is used with length specification * or ** after AT, it is used first and then the output length is determined from the result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the addition CURRENCY is specified as well, this is executed first in the case of data types i and p, and then the addition DECIMALS is applied. In the case of data type f, the addition CURRENCY is ignored if it is specified together with DECIMALS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output for the WRITE statement is "1234,57". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA pack TYPE p LENGTH 8 DECIMALS 4 VALUE '1234.5678'. &lt;/P&gt;&lt;P&gt;WRITE pack NO-GROUPING DECIMALS 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 10 &lt;/P&gt;&lt;P&gt;... ROUND scale &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition cannot be used together with the addition TIME ZONE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;If dobj has the data type p, this addition multiplies the value of the data object, before output, by 10 to the power of scale. In all other data types, the addition is ignored. For scale, a data object of type i is expected that contains the value of the required scale. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value of scale is greater than 0 and the addition DECIMALS is not specified, the interim result is rounded to the number of decimal places defined in the data type. If the addition DECIMALS is specified, it is rounded to the number of decimal places specified in dec and these are then output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the addition ROUND is used with the length specification * or ** after AT, it is used first and the output length is determined from the result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the addition CURRENCY is specified, this is used, before multiplication, for the content of dobj. If the addition DECIMALS is not specified, the number of decimal places specified through cur is used for rounding off and for the output. If the addition DECIMALS is specified, the value in dec is used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output of the WRITE statement is "123456,7800". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA pack TYPE p VALUE '12345678'. &lt;/P&gt;&lt;P&gt;WRITE pack NO-GROUPING ROUND 2 DECIMALS 4. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 11 &lt;/P&gt;&lt;P&gt;... UNIT unit &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition cannot be used together with the addition TIME ZONE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition cuts off decimal places that have the value 0 and are outside the exactness of a unit of measure during output of data objects of data type p. For all other data types, except f, this addition is ignored. For unit, a three-digit, character-type field is expected that contains a unit key from the column MSEHI in the database table T006 in uppercase letters. The system determines the number of decimal places from the column DECAN in the corresponding row in the database table T006. If the content of unit is not found in T006, the addition is ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the data type of dobj is p and has at least as many decimal places as specified by unit, and if no positions are thus cut off that are not equal to 0, then dobj is output with this number of decimal places. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of data objects of type f, the addition UNIT will be treated like the addition DECIMALS (see above). Here, the number of decimal places is determined by unit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the addition UNIT is used with the length specification * or ** after AT, it is used first, and the output length is determined from the result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the addition CURRENCY is used at the same time, this is used first for data type p and then the addition UNIT is used. In the case of data type f, the addition UNIT is ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;If no decimal places are specified for the number "PC" in T006, the output of the WRITE statement is "1234". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA pack TYPE p DECIMALS 4 VALUE '1234.0000'. &lt;/P&gt;&lt;P&gt;WRITE pack NO-GROUPING UNIT 'PC'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 12 &lt;/P&gt;&lt;P&gt;... TIME ZONE tz &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition edits a time stamp in relation to a time zone. The data object dobj must be of type p of length 0 without decimal places, or of type p of length 11 with seven decimal places. The content of dobj is interpreted in such a way as if it contained the long or the short form of a time stamp in UTC reference time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For tz, a data object of type TIMEZONE from the ABAP Dictionary must be specified. It must contain a time zone from the column TZONE of the database table TTZZ in uppercase letters. If tz is initial, the UTC reference time is output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The time stamp in dobj is converted to the time zone given in tz, and edited as follows from the left: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, the date is output. The format depends on the settings in the user master record or on any data mask date_mask specified concurrently. After the date, a blank is output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly, the time is output in the format predefined for type t. Colons ":" are inserted here as separators between hours, minutes, and seconds. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the time stamp is in the long form, a comma "," is output directly after the time, and after that the milliseconds. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value of tz is not contained in the database table TTZZ or if dobj does not contain any valid time stamp, the content of dobj is output without conversion. Before the date, an asterisk "*" is entered, and the last position of the time is cut off. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The editing takes place in an interim result of length 19 if the time stamp is in its short form or of length 27, or if the time stamp is in the long form. If the output length is shorter than 19 or 27, respectively, first all the separators in date and time are removed in the interim result, then the blanks between date and time, and only then characters are cut off at the right. If, at the same time, a date mask date_mask is specified, the separators in the date are not removed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The data objects dobj and tz can be declared in relation to data types TIMESTAMP, TIMESTAMPL, and TIMEZONE in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output of a UTC time stamp in Tasmanian time. In daylight-saving time, the output is "28.06.2002 04:00:00". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: time_stamp TYPE timestamp, &lt;/P&gt;&lt;P&gt;      tzone      TYPE timezone. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;time_stamp = 20020627180000. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tzone = 'AUSTAS'. &lt;/P&gt;&lt;P&gt;WRITE / time_stamp TIME ZONE tzone. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 13 &lt;/P&gt;&lt;P&gt;... USING { {NO EDIT MASK}|{EDIT MASK mask} } &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition overrides a conversion routine defined through reference to the ABAP Dictionary. The addition NO EDIT MASK only switches off the execution of an assigned conversion routine. The addition EDIT MASK calls either another conversion routine or defines an edit mask. For mask, a data object of the same name is expected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to call an arbitrary conversion routine CONV, mask must contain two equals signs, followed directly by the name of the conversion routine: "==CONV". During output, the content of dobj is passed to the function module CONVERSION_EXIT_CONV_OUTPUT, converted there, and then the result is displayed. If the function module is not found, an exception that can be handled is triggered (as of Release 6.10). The statement DESCRIBE FIELD contains an addition in order to fill mask accordingly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the output length is specified explicitly with len, the conversion routine is executed for the specified length; otherwise for the implicit output length. If * or ** is specified for the output length, the appropriate rules are used for the converted result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the first two characters in mask are not equals signs, the content is interpreted as an edit mask in which some characters have a particular meaning. The WRITE statement does not then output the content of dobj directly, but the character string in mask as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the first two characters in mask are "LL" or "RR ", these are not output, They control whether the edit mask is left-justified or right-justified. If the first two characters are other characters, the edit mask is left-justified. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All "_" characters are replaced from the left (in the case of "LL") or from the right (in the case of "RR") with characters for character-type types or numbers for the types p or i from dobj. In the case of fields of type c, closing blanks are ignored. Data objects of type f or x are converted into type c before editing. Superfluous characters "_" in mask are replaced by blanks. Characters from dobj for which there are no characters "_" in mask are not displayed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If dobj is of type i or p, the first character from the left "V" in mask is replaced with "-" in the case of a negative number and by blank in the case of a positive number. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the other characters of the edit mask are displayed unchanged. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If no output length is specified, the implicit output length of dobj is used. If len is specified for the output length, the value of len is used. If * is specified for the output length, exactly that length that is required for the list display is set. If, in Unicode systems, characters of the edit mask are replaced by characters that take up more than one column on the list, the output length is increased accordingly and the output is filled with blanks in the list buffer. If ** is specified for the output length, double the length of the edit mask mask is used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If other formatting options are specified concurrently for an edit mask, these are used first and then the special characters in the edit mask are replaced by the interim result. The date masks date_mask are an exception to this. If these are specified, the edit mask is ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;In Unicode systems, you must remember that a character "_"in the edit mask does not necessarily correspond to a column in the list display since the space required in the display depends on the character to be replaced. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The minus sign for a negative number is not displayed if no edit character "V" is specified. The decimal separator of a packed number with decimal places must be specified at the required position in the edit mask. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Edited output of time duration. In the first output, the function module CONVERSION_EXIT_DURA_OUTPUT is executed. This converts the duration specified in seconds into minutes. In the second output, the edit mask is output according to the above rules. However, the underscore characters "_" are replaced by the characters from time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: dura TYPE i, &lt;/P&gt;&lt;P&gt;      time TYPE t VALUE '080000'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dura = sy-uzeit - time. &lt;/P&gt;&lt;P&gt;time = dura. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE /(30) dura USING EDIT MASK '==SDURA'. &lt;/P&gt;&lt;P&gt;WRITE /(30) time USING EDIT MASK &lt;/P&gt;&lt;P&gt;                       'RRThe duration is __:__:__'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 14 &lt;/P&gt;&lt;P&gt;... DD/MM/YY   | MM/DD/YY &lt;/P&gt;&lt;P&gt;  | DD/MM/YYYY | MM/DD/YYYY &lt;/P&gt;&lt;P&gt;  | DDMMYY     | MMDDYY &lt;/P&gt;&lt;P&gt;  | YYMMDD &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect: These additions influence the output of data objects of the data type d. In all other data types, the addition is ignored. &lt;/P&gt;&lt;P&gt;The content of a data object of type d is interpreted as a valid date in the format YYYYMMDD and is output as follows for the individual additions: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DD/MM/YY and MM/DD/YY: &lt;/P&gt;&lt;P&gt;Both additions have the same effect. The date output has a two-digit year value and a separator. The separator and the order are taken from the definition for date output in the user master record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DD/MM/YYYY und MM/DD/YYYY: &lt;/P&gt;&lt;P&gt;Both additions have the same effect. The date output has a four-digit year value and separator. The separator and the order are taken from the definition for date output in the user master record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DDMMYY und MMDDYY: &lt;/P&gt;&lt;P&gt;Both additions have the same effect. The date output has a two-digit year value and no separator. The order is taken from the definition for date output in the user master record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YYMMDD: &lt;/P&gt;&lt;P&gt;This addition provides a date output with a two-digit year value without a separator in the format YYMMDD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the output length is defined implicitly or specified using len, this is used. If it is too short, the edited output is cut off to the right. If the output length is specified using * or **, it is set to the length of the specified edit mask (6, 8, or 10). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The behavior for abbreviation differs from the output of a data in accordance with the user master record, where the separator is removed first and then cut off. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output of the WRITE statement is, for example, "230402". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE sy-datum YYMMDD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpful&lt;/P&gt;&lt;P&gt;prasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 09:42:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938478#M942368</guid>
      <dc:creator>prasanth_kasturi</dc:creator>
      <dc:date>2008-05-30T09:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938479#M942369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE - Output to a list &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basic form &lt;/P&gt;&lt;P&gt;WRITE f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extras: &lt;/P&gt;&lt;P&gt;1. ... [AT] [/][pos][(len|&lt;STRONG&gt;|&lt;/STRONG&gt;*) (position and length specification) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... option (formatting option) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ... fmt (field-by-field display format) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. ... AS CHECKBOX (output as a checkbox) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. ... AS SYMBOL (output as a symbol) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. ... AS ICON (output as an icon) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. ... AS LINE (output as a line) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8. ... QUICKINFO g (output as a tool tip) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Outputs an elementary field f in the correct format for its type in the current list. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples&lt;/P&gt;&lt;P&gt;DATA SPFLI_WA TYPE SPFLI. &lt;/P&gt;&lt;P&gt;DATA N TYPE I VALUE 123. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;WRITE N. &lt;/P&gt;&lt;P&gt;WRITE SPFLI_WA-FLTIME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;CF&amp;gt; TYPE ANY. &lt;/P&gt;&lt;P&gt;ASSIGN 'NEW YORK' TO &amp;lt;CF&amp;gt;. &lt;/P&gt;&lt;P&gt;WRITE &amp;lt;CF&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: '----&amp;gt;', SPFLI_WA-DISTANCE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: TEXT-001, SPFLI_WA-ARRTIME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'Time:'(001), SPFLI_WA-ARRTIME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As in all ABAP statements, text symbols can be addressed in two different ways (TEXT-001 or 'Time:'(001)). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;If no explicit position is specified for a field on a new line, it is output on the left (in column 1). Otherwise, output is one column removed from the previously output field. If a field does not fit on one line, a new line is started. &lt;/P&gt;&lt;P&gt;You can perform explicit positioning with a position and length specification (see addition 1) or with ABAP/4 statements (e.g. POSITION). In this case, the field is always output at the defined position, even if the line is not quite long enough for it to fit completely. &lt;/P&gt;&lt;P&gt;If a field is too long to fit completely on the line, the excess characters are truncated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you explicitly position fields on a list, you should almost always use the ... LINE-SIZE (for the corresponding REPORT- or NEW-PAGE NEW-PAGE- statement); otherwise, the width of the list will depend on the current width of the display window, the font used, and other such factors that can lead to the list display being truncated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Predefined Output Formats &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System fields that are useful when generating lists are documented in System Fields for Lists. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please consult Data Area and Modularization Unit Organization documentation as well. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... [AT] [/][pos][(len|&lt;STRONG&gt;|&lt;/STRONG&gt;*) (position and length specification before the field) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.See Incorrect Dynamic Position Specifications. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;After AT, you can specify the output position and output length of the current WRITE statement. Any output that already exists at the output position is overwritten in the list buffer in the output length of the new output. After overwriting an existing output, the system sets the list cursor to the next position and not the one after. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The elements of the position and length specification /, pos and len or * or ** must be listed in the specified order and without spaces. If no named data objects are specified in the position and length specification, the AT addition can be omitted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using / results in the output in the next line after the current line. If no position pos is specified, the system writes from the first column. Specifying / directly after positioning the list cursor in a list row that is not preceded by an output statement has no effect. This is the case when first writing to a page of a list and after explicit positioning using the statements SKIP, NEW-LINE, NEW-PAGE, and BACK. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying pos defines the output position. pos should be a data object of the type i that contains a value within the current list width. If the value in pos is less than 1 or greater than the current list width, no output takes place. The defined output position specifies the postion in the list buffer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying len, *, or ** in parentheses defines the output length. You can specify an absolute value with len. len should be a data object of the type i that contains a value within the current list width. If the value of len is less than or equal to 0, no output takes place. When specifying len in Unicode systems, the number of characters displayed on the list can differ from the number of characters stored in the list buffer. When specifying * or **, the output length depends on the data type of the data object dobj, as described in the following table: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Type * ** &lt;/P&gt;&lt;P&gt;c Number of columns required to display the entire contents in the list; closing blanks are ignored. In Unicode systems, this length can be greater than the implicit length. Double the length of the data object &lt;/P&gt;&lt;P&gt;string implicit length Double the number of contained characters &lt;/P&gt;&lt;P&gt;n, x, xtring implicit length implicit length &lt;/P&gt;&lt;P&gt;d 10 10 &lt;/P&gt;&lt;P&gt;t 8 8 &lt;/P&gt;&lt;P&gt;i, f, p Length required to display the current value including thousand separators; the system uses the value that exists after the use of any of the additions CURRENCY, DECIMALS, NO-SIGN, ROUND, or UNIT. Length required to display the maximum possible values of these types including prefixes and thousand separators; the system uses the value that exists after the use of any of the additions CURRENCY, DECIMALS, NO-SIGN, ROUND, or UNIT. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a conversion routine is executed with reference to a data type in the ABAP Dictionary, the routine is executed either for the length defined forlen or for the output length defined in the ABAP Dictionary for* or **, depending on which is specified. If you specify * or **, the output length is determined from the result of the conversion routine according the rules above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;It is always better to specify the output length len after AT than to use a length specification for the data object dobj (accesing part of a field). Unlike the latter option, specifying the output length is not only possible for byte-type and character-type data objects. Furthermore, when accessing part of a field, the assignment of the list output to the data object is lost and it can no longer be addressed in the list. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying * or ** for the output length ensures that it is sufficient - regardless of the data type - to also display all characters of dobj in Unicode systems, even if more columns are required in the list than spaces in the list buffer. For * the system uses the smallest necessary length and for ** the largest possible length. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When specifying an output position within an existing output, you must ensure that the position always refers to the characters stored in the list buffer. If, in a Unicode system, characters are displayed that require more than one column in the list, the displayed output position can differ from the specified output position and the displayed content of a partially overwritten output may be moved, depending on the characters used to overwrite. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples&lt;/P&gt;&lt;P&gt;DATA: WORD(16), VALUE '0123456789ABCDEF', &lt;/P&gt;&lt;P&gt;      COL TYPE I VALUE 5, &lt;/P&gt;&lt;P&gt;      LEN TYPE I VALUE 10. &lt;/P&gt;&lt;P&gt;WRITE AT / WORD.          "new line &lt;/P&gt;&lt;P&gt;WRITE AT 5 WORD.          "column 5 &lt;/P&gt;&lt;P&gt;WRITE AT (10) WORD.       "output length 10 &lt;/P&gt;&lt;P&gt;WRITE AT /5(10) WORD.     "new line, column 5, length 10 &lt;/P&gt;&lt;P&gt;WRITE AT COL WORD.        "column = contents of COL &lt;/P&gt;&lt;P&gt;WRITE AT (LEN) WORD.      "output length = contents of LEN &lt;/P&gt;&lt;P&gt;WRITE AT /COL(LEN) WORD.  "new line, column = contents of COL &lt;/P&gt;&lt;P&gt;                          "output length = contents of LEN &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;The position and length specification must appear before the field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the position and length specification contains only constants, you the introductory AT is unnecessary. (In the first four of the above examples, you can therefore omit AT.) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always write the position and length specification without gaps and in the specified order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Leave at least one space between the position and length specification and the field name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For dynamic positioning, see also POSITION. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No output results from positioning to the right of the far right edge of the page. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With explicit column specifications, the field is output from this column, even if it no longer completely fits on the line or overwrites another field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the output length is too short, numeric fields (types P, I and F are prefixed with an asterisk ('*'), while all other types are truncated on the right. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want the abbreviated output of a variable, you should always use WRITE (10) T100-TEXT rather than WRITE T100-TEXT(10) (sub-field access). &lt;/P&gt;&lt;P&gt;On the one hand, the first form is always allowed and the second form can be forbidden for certain data types (e.g. TYPE P). On the other hand, only the first form guarantees the identity of the variables for GET CURSOR ... FIELD and F1 help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... option (formatting option) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;You can modify the output of the field f by using one of the special formatting options. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 3 &lt;/P&gt;&lt;P&gt;... fmt (output format by field) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Outputs the field with the specified output formats (color, intensity, ready for input, ...). &lt;/P&gt;&lt;P&gt;You can use the same output options as for FORMAT. If no specifications are made, the field is output with the standard formats or with the format set by a preceding FORMAT statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;DATA F. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORMAT INTENSIFIED OFF INPUT. &lt;/P&gt;&lt;P&gt;WRITE F INPUT OFF INVERSE COLOR 3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The format specifications with WRITE apply only for output of the field f. They modify the currently valid format for this field. This means that, in the above example, the non-highlighted output remains for the field F. When f has been output, the system reverts to the old format. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 4 &lt;/P&gt;&lt;P&gt;... AS CHECKBOX (output as checkbox) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE - Output as checkbox &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Outputs the field f as a checkbox. The contents of the first character of f is interpreted as the "status": &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' ' = not selected &lt;/P&gt;&lt;P&gt;'X' = selected &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user can change this as required. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;To prevent the user changing the contents of the checkbox, you can use the addition ... INPUT OFF. The checkbox is then nothing more than a status display and can only be changed by programming. &lt;/P&gt;&lt;P&gt;In technical terms, a checkbox behaves exactly like an input field with a length of 1 (FORMAT INPUT). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples&lt;/P&gt;&lt;P&gt;DATA: MARKFIELD(1) TYPE C VALUE 'X'. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;WRITE MARKFIELD AS CHECKBOX.           "checkbox selected &lt;/P&gt;&lt;P&gt;MARKFIELD = SPACE. &lt;/P&gt;&lt;P&gt;WRITE MARKFIELD AS CHECKBOX.           "deselected &lt;/P&gt;&lt;P&gt;WRITE MARKFIELD AS CHECKBOX INPUT OFF. "deselected, protected &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional help &lt;/P&gt;&lt;P&gt;List Creation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 5 &lt;/P&gt;&lt;P&gt;... AS SYMBOL (output as symbol) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE - Output as symbol &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;You can output certain characters as symbols using the addition ... AS SYMBOL. You should only address these characters with their system-defined names. The include &amp;lt;SYMBOL&amp;gt; (or the more comprehensive include &amp;lt;LIST&amp;gt;) contains the relevant identifiers as constants, e.g. SYM_PHONE, SYM_CIRCLE. (List of symbols, Proposals for use). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;INCLUDE . &lt;/P&gt;&lt;P&gt;WRITE: / SYM_RIGHT_HAND AS SYMBOL,    " output as symbol &lt;/P&gt;&lt;P&gt;         'Tip, Note', &lt;/P&gt;&lt;P&gt;         SYM_LEFT_HAND  AS SYMBOL.    " output as symbol &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;An output length of one character is enough for most symbols, but some (e.g. SYM_FAX) are twice as long. &lt;/P&gt;&lt;P&gt;You can determine the length of a symbol with DESCRIBE FIELD SYM_... OUTPUT-LENGTH ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional help &lt;/P&gt;&lt;P&gt;List Creation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 6 &lt;/P&gt;&lt;P&gt;... AS ICON (output as icon) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE - Output as icon &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;You can output certain characters as icons using the addition ...AS ICON. You should only address these characters with their system-defined names. The include &amp;lt;ICON&amp;gt; (or the more comprehensive include &amp;lt;LIST&amp;gt;) contains the relevant identifiers as constants, e.g. ICON_OKAY (see List of icons). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;INCLUDE . &lt;/P&gt;&lt;P&gt;WRITE: / ICON_OKAY AS ICON,         "output as icon &lt;/P&gt;&lt;P&gt;         'Text line'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;Although an output length of 2 characters is enough for most icons, some (e.g. the traffic light icons ICON_RED_LIGHT, ...) have a greater output length. &lt;/P&gt;&lt;P&gt;You can determine the length of an icon with DESCRIBE FIELD ICON_... output length .... &lt;/P&gt;&lt;P&gt;You cannot print out all list icons. The printable icons are flagged as such in the 'list of icons' mentioned above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional help &lt;/P&gt;&lt;P&gt;List Creation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 7 &lt;/P&gt;&lt;P&gt;... AS LINE (output as line) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE - Output as line &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;On list output, automatically links certain characters together to form continuous lines or boxes, if there is no space between them: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vertical lines, output with the system field SY-VLINE or using a field with the contents "|" (vertical line) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;horizontal lines, output with the system field SY-ULINE or using a field with at least 2 consecutive minus signs "--". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exactly how each line segment is output (e.g. whether as straight line, corner, T-piece or cross) depends on the adjoining characters. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A good rule of thumb sipulates that if the cell adjacent to a line character also contains a line character, the missing piece required to form a connection is added. If an adjacent cell does not also contain a line character, the line character is truncated on that side. Line characters standing on their own remain unchanged. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This technique is sufficient to cope with most cases (e.g. tables, boxes, simple hierarchies). However, no matter how carefully you use some empty characters and lines, it is not possible to stop adjacent line characters being joined in an inappropriate way (e.g. very compact hierarchy diagrams, or densely boxes). The solution here is to output the required line segment explicitly using the addition ... AS LINE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The include &amp;lt;LINE&amp;gt; (or the more comprehensive include &amp;lt;LIST&amp;gt;) contains the relevant identifiers for lines as constants, e.g. LINE_TOP_LEFT_CORNER, LINE_BOTTOM_MIDDLE_CORNER. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;Lines cannot have any other display attributes. If attributes such as color ( COLOR), reverse video (INVERSE) or intensified (INTENSIFIED) are set, these are ignored on output. If the ready for input attribute (INPUT) is set, the actual characters (minus sign, vertical line) are displayed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output two nested corner segments: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ULINE /1(50). &lt;/P&gt;&lt;P&gt;WRITE: / SY-VLINE NO-GAP, LINE_TOP_LEFT_CORNER AS LINE. &lt;/P&gt;&lt;P&gt;ULINE 3(48). &lt;/P&gt;&lt;P&gt;WRITE: / SY-VLINE NO-GAP, SY-VLINE NO-GAP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional help &lt;/P&gt;&lt;P&gt;List Creation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;General notes on outputting boxes to lists &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you output a list, this is sometimes combined with vertical and horizontal lines to form closed boxes: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vertical lines are output by the system field SY-VLINE or by a field containing "|" (vertical bar), &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Horizontal lines are output by the system field SY-ULINE or by a field containing only "-" (minus sign), &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vertical and horizontal lines converge (without gaps). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 8 &lt;/P&gt;&lt;P&gt;... QUICKINFO g &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The field f is displayed with the tool tip g: Whenever the mouse pointer is positioned on the display area of f, the contents of g are displayed as an explanatory text on the list (in a small, differently-colored box). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;The tool tip can be up to 40 characters long. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g must be a non-numeric field (data type C, N, D, or T). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tool tips are unsuitable for lines, input fields, or checkboxes. Their suitability is also limited for icons that are normally displayed in longer fields (the icon assignment may be inexact). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If two output fields overlap (for example, when one field is placed over another with the POSITION ... statement, the 'bottom' field may not have a tool tip. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output length of f must be greater than zero (f must actually be placed on the list) if you want to use the ... QUICKINFO addition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;INCLUDE . &lt;/P&gt;&lt;P&gt;DATA: INFO(20) VALUE 'Information'. &lt;/P&gt;&lt;P&gt;WRITE: / SY-UNAME QUICKINFO 'User name'. &lt;/P&gt;&lt;P&gt;WRITE: / ICON_INFORMATION AS ICON QUICKINFO info &lt;/P&gt;&lt;P&gt;                          HOTSPOT COLOR COL_POSITIVE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional help &lt;/P&gt;&lt;P&gt;Creating Lists&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 09:44:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938479#M942369</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2008-05-30T09:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938480#M942370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read the examples&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output of three literals left, in the middle, and to the right of an output area 60 characters in length. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: /(60) 'Left'   LEFT-JUSTIFIED, &lt;/P&gt;&lt;P&gt;       /(60) 'Center' CENTERED, &lt;/P&gt;&lt;P&gt;       /(60) 'Right'  RIGHT-JUSTIFIED. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output for both WRITE statements is " NoGap". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'No' NO-GAP, 'Gap'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Table-type output of flight connections. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: carrid TYPE spfli-carrid, &lt;/P&gt;&lt;P&gt;      connid TYPE spfli-connid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 10 'Carrier', 40 'Connection'. &lt;/P&gt;&lt;P&gt;ULINE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT carrid connid &lt;/P&gt;&lt;P&gt;       FROM spfli &lt;/P&gt;&lt;P&gt;       INTO (carrid,connid). &lt;/P&gt;&lt;P&gt;  WRITE: / carrid UNDER 'Carrier', &lt;/P&gt;&lt;P&gt;           connid UNDER 'Connection'. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output of the WRITE statement is "1,414". The standard output for an output length of 6 would be "1E+00". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA float TYPE f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;float = sqrt( 2 ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE (6) float EXPONENT 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output with red background color instead of with a plus/minus sign. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA number TYPE i. &lt;/P&gt;&lt;P&gt;  DO 10 TIMES. &lt;/P&gt;&lt;P&gt;  number = sy-index - 5. &lt;/P&gt;&lt;P&gt;  IF number &amp;lt; 0. &lt;/P&gt;&lt;P&gt;    WRITE number NO-SIGN COLOR = 6. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;ENDDO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output of 22 blanks with red background color instead of the standard output "0,0000000000000000E+00". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA float TYPE f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET BLANK LINES ON. &lt;/P&gt;&lt;P&gt;IF float = 0. &lt;/P&gt;&lt;P&gt;  WRITE float NO-ZERO COLOR = 6. &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output of the WRITE statement is "123456,78". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA int TYPE i VALUE 12345678. &lt;/P&gt;&lt;P&gt;WRITE int NO-GROUPING CURRENCY 'EUR'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output for the WRITE statement is "1234,57". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA pack TYPE p LENGTH 8 DECIMALS 4 VALUE '1234.5678'. &lt;/P&gt;&lt;P&gt;WRITE pack NO-GROUPING DECIMALS 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output of the WRITE statement is "123456,7800". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA pack TYPE p VALUE '12345678'. &lt;/P&gt;&lt;P&gt;WRITE pack NO-GROUPING ROUND 2 DECIMALS 4. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;If no decimal places are specified for the number "PC" in T006, the output of the WRITE statement is "1234". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA pack TYPE p DECIMALS 4 VALUE '1234.0000'. &lt;/P&gt;&lt;P&gt;WRITE pack NO-GROUPING UNIT 'PC'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output of a UTC time stamp in Tasmanian time. In daylight-saving time, the output is "28.06.2002 04:00:00". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: time_stamp TYPE timestamp, &lt;/P&gt;&lt;P&gt;      tzone      TYPE timezone. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;time_stamp = 20020627180000. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tzone = 'AUSTAS'. &lt;/P&gt;&lt;P&gt;WRITE / time_stamp TIME ZONE tzone. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Edited output of time duration. In the first output, the function module CONVERSION_EXIT_DURA_OUTPUT is executed. This converts the duration specified in seconds into minutes. In the second output, the edit mask is output according to the above rules. However, the underscore characters "_" are replaced by the characters from time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: dura TYPE i, &lt;/P&gt;&lt;P&gt;      time TYPE t VALUE '080000'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dura = sy-uzeit - time. &lt;/P&gt;&lt;P&gt;time = dura. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE /(30) dura USING EDIT MASK '==SDURA'. &lt;/P&gt;&lt;P&gt;WRITE /(30) time USING EDIT MASK &lt;/P&gt;&lt;P&gt;                       'RRThe duration is __:__:__'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The output of the WRITE statement is, for example, "230402". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE sy-datum YYMMDD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 09:45:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938480#M942370</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T09:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938481#M942371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check  this ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e3d35c111d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e3d35c111d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 09:46:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938481#M942371</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T09:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938482#M942372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the formatting options for write statement :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use various formatting options with the WRITE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE .... &amp;lt;f&amp;gt; &amp;lt;option&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Formatting options for all data types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option&lt;/P&gt;&lt;P&gt; Function&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LEFT-JUSTIFIED&lt;/P&gt;&lt;P&gt; Output is left-justified.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CENTERED&lt;/P&gt;&lt;P&gt; Output is centered.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;RIGHT-JUSTIFIED&lt;/P&gt;&lt;P&gt; Output is right-justified.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;UNDER &amp;lt;g&amp;gt;&lt;/P&gt;&lt;P&gt; Output starts directly under field &amp;lt;g&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;NO-GAP&lt;/P&gt;&lt;P&gt; The blank after field &amp;lt;f&amp;gt; is omitted.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;USING EDIT MASK &amp;lt;m&amp;gt;&lt;/P&gt;&lt;P&gt; Specifies format template &amp;lt;m&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;USING NO EDIT MASK&lt;/P&gt;&lt;P&gt; Deactivates a format template specified in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;NO-ZERO&lt;/P&gt;&lt;P&gt; If a field contains only zeros, these are replaced by blanks. For type C and N fields, leading zeros are replaced automatically.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Formatting options for numeric fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option&lt;/P&gt;&lt;P&gt; Function&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;NO-SIGN&lt;/P&gt;&lt;P&gt; The leading sign is not displayed on the screen.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DECIMALS &amp;lt;d&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;lt;d&amp;gt; defines the number of digits after the decimal point.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;EXPONENT &amp;lt;e&amp;gt;&lt;/P&gt;&lt;P&gt; In type F fields, the exponent is defined in &amp;lt;e&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ROUND &amp;lt;r&amp;gt;&lt;/P&gt;&lt;P&gt; Type P fields are multiplied by 10**(-r) and then rounded.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CURRENCY &amp;lt;c&amp;gt;&lt;/P&gt;&lt;P&gt; Format according to currency &amp;lt;c&amp;gt; in table TCURX.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;UNIT &amp;lt;u&amp;gt;&lt;/P&gt;&lt;P&gt; The number of decimal places is fixed according to unit &amp;lt;u&amp;gt; specified in table T006 for type P fields.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Formatting options for date fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option&lt;/P&gt;&lt;P&gt; Function&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DD/MM/YY&lt;/P&gt;&lt;P&gt; Separators as defined in useru2019s master record.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;MM/DD/YY&lt;/P&gt;&lt;P&gt; Separators as defined in useru2019s master record.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DD/MM/YYYY&lt;/P&gt;&lt;P&gt; Separators as defined in useru2019s master record.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;MM/DD/YYYY&lt;/P&gt;&lt;P&gt; Separators as defined in useru2019s master record.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DDMMYY&lt;/P&gt;&lt;P&gt; No separators.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;MMDDYY&lt;/P&gt;&lt;P&gt; No separators.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;YYMMDD&lt;/P&gt;&lt;P&gt; No separators.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are some examples of formatting options. For more examples, see Creating Complex Lists. The decimal character and thousands separators (period or comma) of numeric fields are defined in the useru2019s master record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP Code&lt;/P&gt;&lt;P&gt; Screen output&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: g(5) TYPE c VALUE 'Hello',&lt;/P&gt;&lt;P&gt;      f(5) TYPE c VALUE 'Dolly'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: g, f.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: /10 g,&lt;/P&gt;&lt;P&gt;       /   f UNDER g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: / g NO-GAP, f.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello Dolly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          Hello&lt;/P&gt;&lt;P&gt;          Dolly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HelloDolly&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA time TYPE t VALUE '154633'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: time,&lt;/P&gt;&lt;P&gt;  /(8) time USING EDIT MASK '__:__:__'.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;154633&lt;/P&gt;&lt;P&gt;15:46:33&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;WRITE: '000123',&lt;/P&gt;&lt;P&gt;     / '000123' NO-ZERO.&lt;/P&gt;&lt;P&gt; 000123&lt;/P&gt;&lt;P&gt;   123&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA float TYPE f VALUE '123456789.0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE float EXPONENT 3.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;123456,789E+03&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA pack TYPE p VALUE '123.456'&lt;/P&gt;&lt;P&gt;                        DECIMALS 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE pack DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: / pack ROUND -2,&lt;/P&gt;&lt;P&gt;       / pack ROUND -1,&lt;/P&gt;&lt;P&gt;       / pack ROUND 1,&lt;/P&gt;&lt;P&gt;       / pack ROUND 2.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    123,46&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12.345,600&lt;/P&gt;&lt;P&gt;1.234,560&lt;/P&gt;&lt;P&gt;    12,346&lt;/P&gt;&lt;P&gt;     1,235&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;WRITE: sy-datum,&lt;/P&gt;&lt;P&gt;     / sy-datum yymmdd.&lt;/P&gt;&lt;P&gt; 27.06.1995&lt;/P&gt;&lt;P&gt;950627&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from the formatting options shown in the above tables, you can also use the formatting options of the FORMAT statement. These options allow you to specify the intensity and color of your output. For more information, see The FORMAT Statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 09:47:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-statement/m-p/3938482#M942372</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T09:47:47Z</dc:date>
    </item>
  </channel>
</rss>

