2007 Nov 30 7:36 AM
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.
2007 Nov 30 7:44 AM
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.
2007 Nov 30 7:39 AM
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á
2007 Nov 30 7:39 AM
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
2007 Nov 30 7:43 AM
Hi,
u have to give like this
if sy-subrc NE 0
MESSAGE E001 with text .
else
MESSAGE S002 with text .
ENDIF.
Regards,
nagaraj
2007 Nov 30 7:44 AM
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.
2007 Nov 30 7:46 AM
Hi!
IF my_itab[] IS INITIAL. "no entries
MESSAGE E000(ZSD).
ENDIF.
Regards
Tamá
2007 Nov 30 8:10 AM
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.
2007 Nov 30 8:56 AM