Posted: Fri Sep 14, 2007 4:51 pm Post subject: Messages | Сообщения
MESSAGE_PREPARE - Read T100 message and format message with parameters
Import: Language; Message Id, # and variables;
Export: formatted message text.
MESSAGE_TEXT_BUILD - Set up a message with parameter
Import: Message Id, # and variables;
Export: formatted message text.
Since 4.x can be replaced by: MESSAGE ... INTO f.
Code:
DATA: w_textout LIKE t100-text.
DATA: BEGIN OF it_error OCCURS 10, " Protokoll
EBELN LIKE EKKO-EBELN,
TEXT LIKE w_textout,
MSGTY LIKE SY-MSGTY,
MSGID LIKE SY-MSGID,
MSGNO LIKE SY-MSGNO.
DATA: END OF it_error.
DATA: wa_error LIKE it_error.
* Call transaction to update customer instalment text
CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'
MESSAGES INTO messtab.
* Check if update was succesful
IF sy-subrc EQ 0.
ADD 1 TO gd_update.
APPEND wa_ekko TO it_success.
ELSE.
* Retrieve error messages displayed during BDC update
LOOP AT messtab WHERE msgtyp = 'E'.
* Builds actual message based on info returned from Call transaction
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = messtab-msgid
msgnr = messtab-msgnr
msgv1 = messtab-msgv1
msgv2 = messtab-msgv2
msgv3 = messtab-msgv3
msgv4 = messtab-msgv4
IMPORTING
message_text_output = w_textout.
ENDLOOP.
* Build error table ready for output
wa_error = wa_ekko.
wa_error-err_msg = w_textout.
APPEND wa_error TO it_error.
CLEAR: wa_error.
ENDIF.
BAPI_MESSAGE_GETDETAIL - Read long text of error message
New in 4.5a.
Import: Message Id, #, variables and formats;
Export: formatted message text and long text.
MESSAGES_INITIALIZE - Delete messages collected up to now, collect future messages.
MESSAGES_ACTIVE - Information, whether the collection of messages is activated
MESSAGES_GIVE - Transfer collected messages into table
MESSAGES_STOP - End collection of messages, report importance of occured errors
Code:
...selektierte Lieferungen
DATA: BEGIN OF xlikpukwa OCCURS 1000.
INCLUDE STRUCTURE likpukwa.
DATA: END OF xlikpukwa.
DATA: BEGIN OF xmesg OCCURS 0.
INCLUDE STRUCTURE mesg.
DATA: END OF xmesg.
DATA: ident LIKE sy-uzeit, "Kennung MESSAGES_INITIAL,
count LIKE sy-msgno,
counter LIKE sy-tabix.
SELECT * FROM likpuk
WHERE vbeln = ivbeln AND
fkstk IN ('A', ' ') AND
wbstk EQ 'C'. "WA-Status = C
MOVE-CORRESPONDING likpuk TO xlikpukwa.
xlikpukwa-stdat = ibudat.
APPEND xlikpukwa.
ENDSELECT.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.