宏申's profileClick's BlogPhotosBlogListsMore Tools Help
    January 24

    Application Log: create

    T-CODE:

    SLG0  创建对象

    SLG1  察看日志

    slg1

    REPORT  zctest01.

    DATA: wa_log TYPE bal_s_log,
          wa_msg TYPE bal_s_msg.

    wa_log-object = 'ZCTEST01'.
    wa_log-alprog = sy-cprog.


    CALL FUNCTION 'BAL_LOG_CREATE'
      EXPORTING
        i_s_log                       = wa_log
     EXCEPTIONS
       log_header_inconsistent       = 1
       OTHERS                        = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    wa_msg-msgty = 'E'.
    wa_msg-msgid = '00'.
    wa_msg-msgno = '001'.
    wa_msg-msgv1 = 'MSGV1'.
    wa_msg-msgv2 = 'MSGV2'.
    wa_msg-msgv3 = 'MSGV3'.
    wa_msg-msgv4 = 'MSGV4'.

    CALL FUNCTION 'BAL_LOG_MSG_ADD'
      EXPORTING
        i_s_msg                   = wa_msg
     EXCEPTIONS
       log_not_found             = 1
       msg_inconsistent          = 2
       log_is_full               = 3
       OTHERS                    = 4.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    wa_msg-msgty = 'S'.
    wa_msg-msgid = '00'.
    wa_msg-msgno = '001'.
    wa_msg-msgv1 = 'AA'.
    wa_msg-msgv2 = 'BB'.
    wa_msg-msgv3 = 'CC'.
    wa_msg-msgv4 = 'DD'.

    CALL FUNCTION 'BAL_LOG_MSG_ADD'
      EXPORTING
        i_s_msg                   = wa_msg
     EXCEPTIONS
       log_not_found             = 1
       msg_inconsistent          = 2
       log_is_full               = 3
       OTHERS                    = 4.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    CALL FUNCTION 'BAL_DB_SAVE'
      EXPORTING
        i_save_all             = 'X'
      EXCEPTIONS
        log_not_found          = 1
        save_not_allowed       = 2
        numbering_error        = 3
        OTHERS                 = 4.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://17thagl.spaces.live.com/blog/cns!15A80D15BC2743B3!345.trak
    Weblogs that reference this entry
    • None