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: 

Error message and it shd give a popup

Former Member
0 Kudos

have to check for venum if the venum is present then it shd come out of the program

FORM validate_venum .

DATA : lv_venum TYPE vekp-venum.

SELECT handling_unit

UP TO 1 ROWS

INTO lv_venum

FROM zws_data

WHERE handling_unit EQ nast-objky.

ENDSELECT.

IF sy-subrc NE 0.

  • MESSAGE e006 WITH lv_venum.

  • WRITE:/ sy-msgty, sy-msgno NO-GAP, ':', l_msg.

Write 😕 lv_venum, ' already present '.

ENDIF.

ENDFORM.

7 REPLIES 7

former_member194669
Active Contributor
0 Kudos

Hi,


FORM validate_venum .

DATA : lv_venum TYPE vekp-venum.

SELECT handling_unit
UP TO 1 ROWS
INTO lv_venum
FROM zws_data
WHERE handling_unit EQ nast-objky.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE e006 WITH lv_venum display like 'I'. "<<< Check this
ENDIF.

ENDFORM. 

former_member182779
Active Contributor
0 Kudos

FORM validate_venum .

DATA : lv_venum TYPE vekp-venum.

SELECT SINGLE handling_unit
INTO lv_venum
FROM zws_data
WHERE handling_unit EQ nast-objky.
IF sy-subrc NE 0.
MESSAGE i006 WITH lv_vemun 'Already present'.
ENDIF.

ENDFORM. 

Greetings,

Blag.

0 Kudos

getting an error

A message ID has not been entered. You can specify this entry for the

whole program using the "MESSAGE-ID msgid" addition with the statment

that . or in number. - or in parentheses after the error number. -

how to get this solved

0 Kudos

Put this in the beginning of your report...


REPORT  zfir0004 MESSAGE-ID ZFI0001.

You need a MESSAGE-ID...Check transaction SE91 -:)

Greetings,

Blag.

0 Kudos

FORM validate_venum .

DATA : lv_venum TYPE vekp-venum.

SELECT SINGLE handling_unit

INTO lv_venum

FROM zws_data

WHERE handling_unit EQ nast-objky.

IF sy-subrc NE 0.

<b>MESSAGE i001(ZMyMessageClass) WITH lv_vemun</b>

EXIT.

ENDIF.

ENDFORM.

double click on ZMyMessageClass or Go to SE91 and create the message class "ZMyMessageClass".

Enter Message number "001" and give the text: "Venum & not found"

Now, the message would look Venum 12345 not found.

Former Member
0 Kudos

Hi,

TRY THIS CODE...

IF sy-subrc NE 0.

DATA:TEXT TYPE STRING.

TEXT = lv_venum.

MESSAGE TEXT TYPE 'I'.

Write 😕 lv_venum, ' already present '.

ENDIF.

0 Kudos

for displaying the message without any message ID, you can pop up the message with the SAP HELP message class straight away as below



message i888(sabapdocu) with '<<your message>>'.                     " for I type message

message e888(sabapdocu) with '<<your message>>'.                    "for E type message

eg.: message e888(sabapdocu) with 'its an error'.

try this and let me know whe