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

MESSAGES

Former Member
0 Likes
957

hi guys,

I am selecting some data from some table.

If data not found i should get the following message.

No number range maintained in table <zabc1> for company code <vbrk-bukrs>

how should i write a ERROR MESSAGE for above.

THE TABLE NAME SHOULD BE CONSTANCT AND COMPANY CODE VBRK-BUKRS WILL BE CONSTANT.

HOW SHOULD I DO.

AHMED

1 ACCEPTED SOLUTION
Read only

athavanraja
Active Contributor
0 Likes
920

if itab[] is initial .

messagee398(00) with 'No number range maintaned in table' <var holding tab name> 'for company code' <var holding bukrs> .

endif .

Raja

hi guys,

I am selecting some data from some table.

If data not found i should get the following message.

No number range maintained in table <zabc1> for company code <vbrk-bukrs>

how should i write a ERROR MESSAGE for above.

THE TABLE NAME SHOULD BE CONSTANCT AND COMPANY CODE VBRK-BUKRS WILL BE CONSTANT.

HOW SHOULD I DO.

AHMED

7 REPLIES 7
Read only

athavanraja
Active Contributor
0 Likes
921

if itab[] is initial .

messagee398(00) with 'No number range maintaned in table' <var holding tab name> 'for company code' <var holding bukrs> .

endif .

Raja

Read only

Former Member
0 Likes
920

select vbeln from ztable into table it_vbrk

where bukrs = s_bukrs.

if sy-subrc <> 0.

message e000(0) with 'Maintain data for' s_bukrs 'in table ztable'.

endif.

Read only

anversha_s
Active Contributor
0 Likes
920

hi,

try this.


MESSAGE s005(zm00) WITH p_table p_cmpany_code.

s005 -> meesage number

s->status bar 

zm00 -> message class.

http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801b3e454211d189710000e8322d00/frameset.htm

Regards

anver

Read only

Former Member
0 Likes
920

Hi Ahmed,

you can use 1) message id '<message class>' type 'E' number '<message number in message class>'

create a message class in se91 and give the messages for the particular number and give the number in the above statement.

2) MESSAGE text TYPE 'E'.

3) MESSAGE e<number>(messageclass) WITH text-002.

Message was edited by:

Pradeep Kumar

Read only

Former Member
0 Likes
920

Hi Ahmed,

U can refer this.

For Eg: Select *

into corresponding fields of itab

from mara .

If sy-subrc NE 0.

message A000. --> error message.

endif.

where u can maintain the A000 as the error message in the message class(se91).

Regards,

Neslin.

Read only

former_member404244
Active Contributor
0 Likes
920

Hi,

first retrieve the data as

select field1 field2 from <dbtable> into table itab

where bukrs in s_bukrs.

if sy-subrc ne 0.

message E001(ZMESSAGE).

endif.

In the message class ZMESSAGE for the number 001 u should write

'No number range maintaned in table' <var holding tab name> 'for company code' <var holding bukrs> .

Regards,

Nagaraj

Read only

Former Member
0 Likes
920

Hello,

check out the 'MESSAGE' statement in the sap library.

Regards,

Shehryar Dahar