Entering content frame

 Procedure documentation Using WRITE via a Statement Structure Locate the document in its SAP Library structure

The SAP system provides a useful facility for trying out all options and output formats of the WRITE statement and inserting them into your program. To do this, choose Edit Insert Statement... in the ABAP Editor and then select WRITE in the relevant dialog box:

This graphic is explained in the accompanying text

When you have confirmed your selection with Enter, you see the following screen:

This graphic is explained in the accompanying text

On this screen, you can

        determine the output format of an internal field by entering its name or a literal in field Fld. You then choose the formatting options on this screen or on another screen which you can access by selecting More formatting options This graphic is explained in the accompanying text.

        generate the WRITEstatements for symbols, icons, lines, and checkboxes simply by selecting the appropriate fields.

        generate the WRITEstatements for components of structures defined in the ABAP Dictionary. This is useful, for example, after executing a SELECT statement (see Reading Data from Database Tables).

Example

On the screen Assemble a WRITE-Statement, select the radio button Symbol and then Display. The following dialog box appears:

This graphic is explained in the accompanying text

Here, you can choose a symbol, for example, SYM_FOLDER. The next dialog box displays the relevant WRITE statement and the resulting output on the output screen:

This graphic is explained in the accompanying text

In addition, a note is displayed informing you that you need an include program in your program (see Displaying Symbols and Icons on the Screen).

After choosing Continue, you see that the Symbol field on the Assemble a WRITE Statement screen now contains a value:

This graphic is explained in the accompanying text

If you now choose Execute, the following text is inserted into your program:

WRITE sym_folder AS SYMBOL.

Example

On the Assemble a WRITE Statement screen, select the radio button Structure and enter the following in the appropriate input field:

This graphic is explained in the accompanying text

Then, choose Select components. On the next screen, you can select the components of the ABAP Dictionary structure SFLIGHT you want to output with WRITE, for example:

This graphic is explained in the accompanying text

If you adopt this selection, the following WRITEstatement is inserted into your program:

WRITE: sflight-carrid,
       sflight-connid,
       sflight-fldate,
       sflight-price,
       sflight-planetype,
       sflight-seatsocc.

 

 

 

 

Leaving content frame