‎2006 Sep 07 2:21 PM
Hi,
i have the following code:
LOOP AT itab INTO wa_itab.
CALL FUNCTION 'BAPI...'
LOOP AT i_return.
g_counter = g_counter + 1.
CALL FUNCTION 'MESSAGE_STORE'
EXPORTING
arbgb = i_return2-id
exception_if_not_active = ' '
msgty = i_return2-type
msgv1 = i_return2-message_v1
msgv2 = i_return2-message_v2
msgv3 = i_return2-message_v3
msgv4 = i_return2-message_v4
txtnr = i_return2-number
zeile = <b>g_counter</b>
EXCEPTIONS
message_type_not_valid = 1
not_active = 2
OTHERS = 3.
ENDLOOP.
ENDLOOP.
what do i have to do in order to control the <u>number of the message displayed</u> (<b>g_counter</b>) in the popup (MESSAGES_SHOW)?
Best regards.
‎2006 Sep 07 2:24 PM
hi,
give this code just above g_counter = g_counter + 1..
if g_counter = 5.
clear g_counter.
endif.
regards,
anver
‎2006 Sep 07 2:24 PM
hi,
give this code just above g_counter = g_counter + 1..
if g_counter = 5.
clear g_counter.
endif.
regards,
anver
‎2006 Sep 07 2:49 PM
Hi,
you can control messages displayed
in following way.
Assume you ant to display only 2 messages
of BAPI return FM
LOOP AT itab INTO wa_itab.
CALL FUNCTION 'BAPI...'
LOOP AT i_return.
g_counter = g_counter + 1.
CALL FUNCTION 'MESSAGE_STORE'
EXPORTING
arbgb = i_return2-id
exception_if_not_active = ' '
msgty = i_return2-type
msgv1 = i_return2-message_v1
msgv2 = i_return2-message_v2
msgv3 = i_return2-message_v3
msgv4 = i_return2-message_v4
txtnr = i_return2-number
zeile = g_counter
EXCEPTIONS
message_type_not_valid = 1
not_active = 2
OTHERS = 3.
<b>if g_counter LE 2.
call FM 'MESSAGE_SHOW'.
endif.
</b>
ENDLOOP.
ENDLOOP.
Regards
Amole
‎2006 Sep 08 6:52 AM
Hi,
my problem is that while processing the BAPI, the second time the loop is done it clears table i_return (which is the internal table that keeps all messages of the bapi run).
That is, if the BAPI is processed twice, what do i have to to in order to save the messages ob both executions?
I´ve tried to move the results to another internal table (i_return2) but when i display the results the numbers of the messages are not correct.
Suppose i get two messages after the execution of the bapi. They have numbers 1 and 2. Then i move them from
i_return to i_return2 and when i display them with fm 'MESSAGESS_SHOW' they appear with numbers 3 and 4.
Why is this happenning?
Best regards.