Skip to Content
author's profile photo Former Member
Former Member

Error message and it shd give a popup

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Aug 27, 2007 at 04:42 PM

    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. 
    

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 27, 2007 at 04:45 PM
    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Alvaro Tejada Galindo

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2012 at 07:47 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.