注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

XINBO'S SAP BLOG

你所浪费的今天,是昨天死去的人奢望的明天。你所厌恶的现在,是未来的你回不去的曾经

 
 
 

日志

 
 

SAP DEMO-Messages  

2010-02-04 11:18:24|  分类: SAP DEMO |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Messages

Simple Message Example

REPORT demo_messages_simple MESSAGE-ID sabapdocu.

 

MESSAGE i014.

 

MESSAGE s015.

 

WRITE text-001.

       

Demonstration of all Message Types

    PERFORM call_message.

  ENDIF.

 

************************************************************************

* List events

************************************************************************

 

AT USER-COMMAND.

  CASE sy-ucomm.

    WHEN 'MESSAGE'.

      message_event = 'AT USER-COMMAND'.

      message_place = 'on list'(008).

      WRITE: / 'Detail list, level:'(009), sy-lsind.

      PERFORM call_message.

    WHEN 'DETAIL'.

      WRITE: / 'Detail list, level:'(009), sy-lsind.

    WHEN 'FUNCT'.

      message_event = 'AT USER-COMMAND'.

      message_place = 'in funktion module on list'(010).

      PERFORM call_function.

      WRITE: / 'Detail list, level:'(009), sy-lsind.

  ENDCASE.

 

************************************************************************

* Subroutines                                                          *

************************************************************************

 

FORM call_message.

  MESSAGE ID 'SABAPDOCU' TYPE message_type NUMBER '777'

          WITH message_type message_place message_event.

ENDFORM.

 

FORM call_function.

  IF except-no = 'X'.

    CALL FUNCTION 'DEMO_FUNCTION_MESSAGE_RAISING'

         EXPORTING

              message_type  = message_type

              message_place = message_place

              message_event = message_event.

  ELSEIF except-yes = 'X'.

    CALL FUNCTION 'DEMO_FUNCTION_MESSAGE_RAISING'

         EXPORTING

              message_type  = message_type

              message_place = message_place

              message_event = message_event

         EXCEPTIONS

              mess          = 4.

    CASE sy-subrc.

      WHEN 0.

        MESSAGE i888(sabapdocu)

                WITH 'No exception raised in function module'(012).

      WHEN 4.

        message_type = sy-msgty.

        MESSAGE i888(sabapdocu)

                WITH 'Handling exception from function module.'(013)

                     'Message type was '(014) message_type '.'.

    ENDCASE.

  ELSEIF except-catch = 'X'.

    CALL FUNCTION 'DEMO_FUNCTION_MESSAGE'

         EXPORTING

              message_type  = message_type

              message_place = message_place

              message_event = message_event

         EXCEPTIONS

              error_message = 4.

    CASE sy-subrc.

      WHEN 0.

        MESSAGE i888(sabapdocu)

                WITH 'No exception raised in function module'(012).

      WHEN 4.

        message_type = sy-msgty.

        MESSAGE i888(sabapdocu)

                WITH 'Handling exception from function module.'(013)

                     'Message type was '(014) message_type '.'.

    ENDCASE.

  ELSEIF except-nocatch = 'X'.

    CALL FUNCTION 'DEMO_FUNCTION_MESSAGE'

         EXPORTING

              message_type  = message_type

              message_place = message_place

              message_event = message_event.

  ENDIF.

ENDFORM.

 

FORM convert_user_input.

  IF type-a = 'X'.

    message_type = 'A'.

  ELSEIF type-e = 'X'.

    message_type = 'E'.

  ELSEIF type-i = 'X'.

    message_type = 'I'.

  ELSEIF type-s = 'X'.

    message_type = 'S'.

  ELSEIF type-w = 'X'.

    message_type = 'W'.

  ELSEIF type-x = 'X'.

    message_type = 'X'.

  ENDIF.

ENDFORM.

  评论这张
 
阅读(1050)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017