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: 

Actually i have one doubt in message class

Former Member
0 Kudos

Actually i have one doubt in message class. I want create message for following logic.

If the records already exits in database table ,

whatever input i will given in input fields like entry type and material no ,it will need in message.

i want rise the error message in my code like "Record entry type B Material no 029585888 already exits in database table".

I done the coding like.........

in SE80.

IF sy-subrc = 0.

MESSAGE e039 with zdbt-enttyp

zdbt-matnr.

ENDIF.

in SE91.

Record entry type &1 Location &2 already exits in database table.

is it correct? it s not working properly..

could you advice me.......

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

In SE91,create 039th entry as

Record entry type &1 Material No. &2 already exits in database table.

Then save and activate.

8 REPLIES 8

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Wats the doubt u hav e... ellaborate plz..

It should work fine .. instead of location u can give Material ..

uwe_schieferstein
Active Contributor
0 Kudos

Hello Raju

The only possible problem I see is that in your report you send a message of the wrong message class. Assuming that your message class is ZMSG then assure that your report begins with:

REPORT zreport MESSAGE-ID zmsg.

...
IF sy-subrc = 0.

MESSAGE e039 with zdbt-enttyp
zdbt-matnr.

ENDIF.

Regards

Uwe

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

In SE91,create 039th entry as

Record entry type &1 Material No. &2 already exits in database table.

Then save and activate.

0 Kudos

Hi Jayanthi.

Ya,I done it but its not working ,it displays like "Record entry type 1 Material 2 already exits in database table."

this message not fecth the input from selection screen to message class.

Advice me........

0 Kudos

Raju,

try this way..

at selection-screen.
select enttyp matnr from ztab 
into wa
where enttyp = p_enttyp
  and  matnr = p_matnr.
if sy-subrc <> 0.
MESSAGE e039 with p_enttyp
p_matnr.
endif.

Regards

Vijay

0 Kudos

Thanks Vijay i solved my problem ,i given 10 mark for your help.

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

If u wan t the validation at selection screen then u should put the samem piece of code under thevent :

AT SELECTION-SCREEN.

Hope this helps.

Former Member
0 Kudos

Hi

try giving this in your message class

Record entry type & Material No. & already exits in database table.

thanks

pavan