Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Application Log

Former Member
0 Likes
935

Hi,

I get an Application log with 4 or 5 messages in it when i create an IDOC.

I would like to know in which tables are these messages stored or is there any

function module which can retrieve these messages.

The input which i have is the Application log number.

Pls. let me know and points will be definitely awarded.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
762

Hi,

Ok...check this sample program..Give the application log number as input..You will see the corresponding texts..

PARAMETERS: p_aplog TYPE balognr.

DATA: s_logn TYPE bal_s_logn.

DATA: r_logn TYPE bal_r_logn.

DATA: s_lfil TYPE bal_s_lfil.

DATA: l_head TYPE balhdr_t.

DATA: t_logh TYPE bal_t_logh.

DATA: t_msgh TYPE bal_t_msgh.

START-OF-SELECTION.

s_logn-sign = 'I'.

s_logn-option = 'EQ'.

s_logn-low = p_aplog.

APPEND s_logn TO r_logn.

s_lfil-lognumber[] = r_logn[].

CALL FUNCTION 'BAL_DB_SEARCH'

EXPORTING

i_s_log_filter = s_lfil

IMPORTING

e_t_log_header = l_head

EXCEPTIONS

log_not_found = 1

no_filter_criteria = 2

OTHERS = 3.

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_LOAD'

EXPORTING

i_t_log_header = l_head

IMPORTING

e_t_log_handle = t_logh

e_t_msg_handle = t_msgh

EXCEPTIONS

no_logs_specified = 1

log_not_found = 2

log_already_loaded = 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.

DATA: s_msgh LIKE LINE OF t_msgh.

DATA: text(70).

LOOP AT t_msgh INTO s_msgh.

CALL FUNCTION 'BAL_LOG_MSG_READ'

EXPORTING

i_s_msg_handle = s_msgh

IMPORTING

e_txt_msg = text

EXCEPTIONS

log_not_found = 1

msg_not_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

ENDIF.

WRITE: / text.

ENDLOOP.

Thanks,

Naren

3 REPLIES 3
Read only

Former Member
0 Likes
762

Hi,

Try using the FM BAL_LOG_MSG_READ

Thanks,

Naren

Read only

0 Likes
762

Hi Muthu,

I tried this FM but what should be the Log Handle and Message Num?

Thanks.

Read only

Former Member
0 Likes
763

Hi,

Ok...check this sample program..Give the application log number as input..You will see the corresponding texts..

PARAMETERS: p_aplog TYPE balognr.

DATA: s_logn TYPE bal_s_logn.

DATA: r_logn TYPE bal_r_logn.

DATA: s_lfil TYPE bal_s_lfil.

DATA: l_head TYPE balhdr_t.

DATA: t_logh TYPE bal_t_logh.

DATA: t_msgh TYPE bal_t_msgh.

START-OF-SELECTION.

s_logn-sign = 'I'.

s_logn-option = 'EQ'.

s_logn-low = p_aplog.

APPEND s_logn TO r_logn.

s_lfil-lognumber[] = r_logn[].

CALL FUNCTION 'BAL_DB_SEARCH'

EXPORTING

i_s_log_filter = s_lfil

IMPORTING

e_t_log_header = l_head

EXCEPTIONS

log_not_found = 1

no_filter_criteria = 2

OTHERS = 3.

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_LOAD'

EXPORTING

i_t_log_header = l_head

IMPORTING

e_t_log_handle = t_logh

e_t_msg_handle = t_msgh

EXCEPTIONS

no_logs_specified = 1

log_not_found = 2

log_already_loaded = 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.

DATA: s_msgh LIKE LINE OF t_msgh.

DATA: text(70).

LOOP AT t_msgh INTO s_msgh.

CALL FUNCTION 'BAL_LOG_MSG_READ'

EXPORTING

i_s_msg_handle = s_msgh

IMPORTING

e_txt_msg = text

EXCEPTIONS

log_not_found = 1

msg_not_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

ENDIF.

WRITE: / text.

ENDLOOP.

Thanks,

Naren