ABAP Help Information

Colour Code for WRITE Statement:

Colour No. Colour
1 Gray-blue (blue sky)
2 Light Gray (light cyan)
3 Yellow
4 Blue-green (between light cyan and blue sky)
5 Green
6 Red
7 Violet (orange)

Sample:
COLOR INTENSIFIED OFF
COLOR INTENSIFIED ON
COLOR INVERSE ON


Message Type:

Sometimes we need to show error message for specific situation. But we need to stay on that screen. To achieve this we can fix this into Information or Success message with display like Error.

REPORT zsr_test.

PARAMETERS p_inp TYPE char12.

IF p_inp 'INFORMATION'.
  MESSAGE 'Information Message' TYPE 'I'.


ELSEIF p_inp 'ERROR'.
  MESSAGE 'Error Information' TYPE 'I' DISPLAY LIKE 'E'.

ELSEIF p_inp 'SUCCESS'.
  MESSAGE 'Success' TYPE 'S'.

ELSEIF p_inp 'FALSE'.
  MESSAGE 'False' TYPE 'S' DISPLAY LIKE 'E'.
ENDIF.


Output options Field Catalog:

outputlen (column width)
       Value range: 0 (initial), n
       For fields with reference to the Data Dictionary you can leave this
       parameter set to initial.
       For fields without reference to the Data Dictionary (program fields)
       you must set the parameter to the desired field output length on the
       list (column width).
       initial = The column width is derived from the output length of the
       referenced field (domain) in the Data Dictionary.
       n = The column width is n characters.
key (key column)
         Value range: SPACE, 'X'
         'X' = Key field (colored output for key fields)
         Key fields cannot be hidden interactively by the user.
         Parameter FIELDCAT-NO_OUT must be left set to initial.
         For exceptions, see the documentation on parameter FIELDCAT-KEY_SEL.
key_sel (key column that can be hidden)
         Value range: SPACE, 'X'
         Only relevant if FIELDCAT-KEY = 'X'
         Key field that can be hidden interactively by the user.
         The user cannot interactively change the sequence of the key
         columns.
         As with non-key fields, output control is performed using parameter
         FIELDCAT-NO_OUT.
no_out (field in the available fields list)
         Value range: SPACE, 'X'
         'X' = Field is not displayed on the current list.
         The field is available to the user in the field list and can be
         interactively selected as a display field.
         At row level, the user can use the detail function to display the
         content of these fields.
         See also the documentation on the 'Detail screen' section of
         parameter IS_LAYOUT.
no_zero (suppress zeros)
         Value range: SPACE, 'X'
         Only relevant to value fields
         'X' = Supress zeros
no_sign (no +/- sign)
         Value range: SPACE, 'X'
         Only relevant to value fields
         'X' = Value output without +/- signs.
tech (technical field)
         Value range: SPACE, 'X'
         'X' = Technical field
         The field cannot be output on the list and cannot be shown
         interactively by the user.
         The field may only be used in the field catalog (not in IT_SORT,...).
emphasize (highlight column in color)
        Value range: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on)
        'X' = The column is highlighted in the default color for color
        highlighting.
        'Cxyz' = The column is highlighted in the coded color:
-   C: Color (coding must start with C)
 -   x: Color number
-   y: Intensified
 -   z: Inverse
hotspot (column as hotspot)
        Value range: SPACE, 'X'
        'X' = The cells of the column are output as a hotspot.
do_sum (calculate totals for column)
        Value range: SPACE, 'X'
        'X' = Totals are calculated for this field of the internal output
        table.
        This function can also be used interactively by the user.
no_sum (totals calculation not allowed)
        Value range: SPACE, 'X'
        'X' = No totals may be calculated for this field although the data
        type of the field allows totalling.
Formatting column contents
icon (icon)
         Value range: SPACE, 'X'
         'X' = The column contents are displayed as an icon.
         The column contents of the internal output table must consist of
         valid icon strings (@xx@).
         The caller should consider the problem of printing icons.
symbol (symbol)
         Value range: SPACE, 'X'
         'X' = The column contents are output as a symbol.
         The column contents of the internal output table must consist of
         valid symbol characters.
         The caller should consider the problem of printing symbols.
         Although symbols can generally be printed, they are not always shown
         correctly depending on the printer configuration.
just (justification)
         Value range: SPACE, 'R', 'L', 'C'
         Only relevant to fields of data type CHAR or NUMC
         ' ' = Default justification according to data type
         'R' = Right-justified output
'L' = Left-justified output
         'C' = Centered output
         The justification of the column header depends on the justification
         of the column contents. You cannot justify the column header
         independently of the column contents.
lzero (leading zeros)
         Value range: SPACE, 'X'
         Only relevant to fields of data type NUMC
         By default, NUMC fields are output in the ALV right-justified
         without leading zeros.
         'X' = Output with leading zeros
edit_mask (field formatting)
         Value range: SPACE, mask
         mask = See documentation on the WRITE formatting option
         USING EDIT MASK mask
         Using mask = '== conv' you can force an output conversion conv.


ALV Color Code:

* Colour code : *
* Colour is a 4-char field where : *
* - 1st char = C (color property) *
* - 2nd char = color code (from 0 to 7) *
* 0 = background color *
* 1 = blue *
* 2 = gray *
* 3 = yellow *
* 4 = blue/gray *
* 5 = green *
* 6 = red *
* 7 = orange *
* - 3rd char = intensified (0=off, 1=on) *
* - 4th char = inverse display (0=off, 1=on) *
* *
* Colour overwriting priority : *
* 0 = background color *
* 1. Line *
* 2. Cell *
* 3. Column *


Calling Standard Buttons in Custom PF Status:

- Go to program SAPLSLVC_FULLSCREEN 
- Go to GUI status STANDARD_FULLSCREEN 
- Add required standard code to your custom PF status


Fetching System Terminal Name:

DATA: opcode_usr_attr(1) TYPE VALUE 5,
      terminal           TYPE usr41-terminal.

CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_usr_attr
  ID 'TERMINAL' FIELD terminal.

WRITE:/ 'Terminal:', terminal.


Finding IP Address:

  CALL METHOD cl_gui_frontend_services=>get_ip_address
    RECEIVING
      ip_address           = ip (string)
    EXCEPTIONS
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      OTHERS                4.



How to unset MS word as editor:
Go to report RSCPSETEDITOR & execute. Unselect the Smartform as follows.





Different Viewing of Output as Modal Dialog:
cl_demo_output=>displayit_mara ). 

LihatTutupKomentar