jueves, 24 de julio de 2008

abap mensajes

Los mensajes de abap es una forma de comunicación con los usuarios, No solamente son textos sino que tambien son acciones de flujo en el contexto del programa abap.

http://help.sap.com/saphelp_46c/helpdata/en/9f/dba79435c111d1829f0000e829fbfe/frameset.htm
EN el worbench http://help.sap.com/saphelp_46c/helpdata/en/d1/801b3e454211d189710000e8322d00/frameset.htm

En principio, los mensajes son siemplemente textos almacenados en la tabla T100, que podemos mantener por la transación SE91 y navegando con el workbench.
La extructura de la tabla T100 es:

  • Clave de lenguaje.
  • Clase de mensaje (30 caracteres)
  • Numero de mensaje
  • Texto del mensaje (up to 72 characters)

La clase de mensaje asigna mensajes a una aplicación o a una clase de desarrollo... y los numeros identifican el mensaje individual. Cuando necesitamos un mensaje o nos envian un mensaje, esta identificado por una clave de lenguaje, la clase de mensaje y el número de mensaje.

LA SENTENCIA MENSAJE.

En el propio .report, se puede de fininir la identidad o las clases de mensajes que vamos a utilizar ejemplo:
REPORT DEMO_MESSAGES_SIMPLE MESSAGE-ID SABAPDOCU.

La clase de mensajes que vamos a utilizar son los SABAPDOCU


La clave del mensaje es lo que llamaremos en abap

Messages on Selection Screens

This context includes all situations where a selection screen is being processed, that is, the program is reacting to user input. In ABAP programs, this corresponds to the AT SELECTION-SCREEN processing blocks, except those with the OUTPUT addition.

Message Processing

Type

Display

Processing

A

Dialog box

Program terminates, and control returns to last area menu

E

Status bar

Selection screen processing terminates, and the selection screen is redisplayed. The screen fields specified through the additions to the AT SELECTION-SCREEN statement are ready for input. The user must enter a new value. The system then restarts the selection screen processing using the new values. You cannot use error messages with the ON HELP-REQUEST or ON VALUE-REQUEST additions. Instead, a runtime error occurs.

I

Dialog box

Program continues processing after the MESSAGE statement

S

Status bar of next screen

Program continues processing after the MESSAGE statement

W

Status bar

Like type E, but the user can confirm the message by pressing ENTER without having to enter new values. The system then resumes selection screen processing directly after the MESSAGE statement. You cannot use warning messages with the ON HELP-REQUEST or ON VALUE-REQUEST additions. Instead, a runtime error occurs.

X

None

Triggers a runtime error with short dump


abao USO DE MESSAGE
PRIMER METODO:

Expecificar la clase de mensajes en el report
REPORT ASDFASDF MESSAGE-ID SABAPDOCU.

LLamar al mensaje de la forma
MESSAGE I003.
Así llamamos al mensaje 003 del tipo I, de la clase SABAPDOCU.

SEGUNDA FORMA :
MESSAGE I003(SABAPDOCU).

LLamamos al mensaje 003 de la clase SABAPDOCU, del tipo I

TERCERA FORMA :
DInamicamente:

MESSAGE ID 'SABAPDOCU' TYPE 'S' NUMBER '014'.

Podemos substituir los literales por variables.


OPCIONES DE MESSAGE

MESSAGE ..... {WITH ... ]
a veces el mensaje (el texto del mensaje) tiene caracteres anspersan que se pueden substituir por parametros a la hora de formar el mensaje, con la opción with podemos implementar estos parámetros.

MESAGE ..... RAISING
para lanzar la excepcion exe, caso de no existir, pues el programa continua.

No hay comentarios: