Application Development 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: 

show the message in the status bar

Former Member
0 Kudos
1,822

I have a report in which i have to update the standard table depending on the entries i get in the internal table.

i have to give a message

Update VBRP table if atleast one entries are found in the internal table else

No entries found.

Can anyone give me a code for this? i think we have to use some system fields..

But not sure which one.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
142

My question is that it will always show the first message as sy-subrc is 0 even if the entries are not found in the internal table as the loop is sucessfully executed. so i dont think that sy-subrc would work?

i want a message if the entries are not found in the internal table.

Sy-subrc would be zero even if i dont get entries in the internal table.

7 REPLIES 7

Former Member
0 Kudos
142

Hi!

It's not as though as you think.

Define an error message in SE91 transaction. F.e ZSD/000 - No entries found.

Then is your program:

MESSAGE E000(ZSD).

Regards

Tamá

Former Member
0 Kudos
142

Hi

after writing the code you need to put message as lik this

if sy-subrc NE 0

MESSAGE S100 with text .

else

MESSAGE S101 with text .

ENDIF.

here S for status

former_member404244
Active Contributor
0 Kudos
142

Hi,

u have to give like this

if sy-subrc NE 0

MESSAGE E001 with text .

else

MESSAGE S002 with text .

ENDIF.

Regards,

nagaraj

Former Member
0 Kudos
143

My question is that it will always show the first message as sy-subrc is 0 even if the entries are not found in the internal table as the loop is sucessfully executed. so i dont think that sy-subrc would work?

i want a message if the entries are not found in the internal table.

Sy-subrc would be zero even if i dont get entries in the internal table.

0 Kudos
142

Hi!

IF my_itab[] IS INITIAL. "no entries

MESSAGE E000(ZSD).

ENDIF.

Regards

Tamá

jayanthi_jayaraman
Active Contributor
0 Kudos
142

Hi,

I am assuming Itab1 is the internal table.

select * from db_table into table itab2 for all entries in itab1

where primary_key1 = itab1-primary_key

and primary_key2 = itab1-primary_key2.

if not itab2[] is initial.

modify db.....

else.

message s000 with 'No entries found'.

endif.

Former Member
0 Kudos
142

Hey tamas..

Thank you so much..

Your code worked.