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

MESSAGE_STORE

former_member182371
Active Contributor
0 Likes
1,339

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.

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
851

hi,

give this code just above g_counter = g_counter + 1..

if g_counter = 5.

clear g_counter.

endif.

regards,

anver

3 REPLIES 3
Read only

anversha_s
Active Contributor
0 Likes
852

hi,

give this code just above g_counter = g_counter + 1..

if g_counter = 5.

clear g_counter.

endif.

regards,

anver

Read only

Former Member
0 Likes
851

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

Read only

former_member182371
Active Contributor
0 Likes
851

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.