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

message type

Former Member
0 Likes
943

Hi,

If I enter wrong data on screen-field, I should get message and after if I press enter, I should come back to that screen-field again so that I can enter proper data and proceed.

What type of mesaage I should use here.

Kindly suggest me with coding.

thanks

5 REPLIES 5
Read only

Former Member
0 Likes
770

write this code:

At selection screen.

IF P_PSPNR IS not initial INITIAL .

select * from <db table> into <> where .......

else.

MESSAGE E011(ZPS) .

LEAVE LIST-PROCESSING.

ENDIF.

Thanks

Read only

Former Member
0 Likes
770

Hi Naresh,

Use Error Message type.

Refer the below coding:

AT SELECTION-SCREEN ON FIELD field_name.
  SELECT query.
    IF SY-SUBRC NE 0.
      MESSAGE 'message text' TYPE 'E'.
    ENDIF.

Regards,

Sunil.

Read only

Former Member
0 Likes
770

Hi,

if u are doing Module pool then in PAI.

Write the field name between CHAIN ENDCHAIN method and write the validation b/w the method.

If u need further clarification revert back.

Regards

Sandipan.

Read only

Former Member
0 Likes
770

use like that:

SELECT bukrs

lifnr

gjahr

INTO CORRESPONDING FIELDS OF TABLE i_bsak

FROM bsak

WHERE budat IN s_budat

AND bukrs IN s_bukrs

AND blart IN s_blart

AND uzawe IN s_uzawe.

IF i_bsak[] IS INITIAL.

MESSAGE i019."No Records found

LEAVE LIST-PROCESSING.

ENDIF.

here if where condition is not satisfied, then internal table i_bsak will empty and a message will be displaying no records found. and once u click it will back to the selection screen, and from there u can again enter the correct inputs..

thanks,

Vipin

Read only

Former Member
0 Likes
770

Hi Naresh,

For printing the Error Messages after validations of EKKO- EBELN, please find below the code.

module validate_ebeln input.

case ok_code_5000.

when 'DISP'.

select single ebeln

into ekko

from ekko

where ebeln = ekko-ebeln.

if sy-subrc <> 0.

clear ekko.

clear ok_code.

message e003 with ekko-ebeln. " PO Does Not exist

endif.

when 'CHAN'.

select single ebeln

into ekko

from ekko

where ebeln = ekko-ebeln.

if sy-subrc <> 0.

clear ekko.

clear ok_code_5000.

message e003 with ekko-ebeln. " PO Does not exists

endif.

when 'CREA'.

clear: w_ebeln,

w_bukrs,

w_bsart,

w_lifnr,

w_ekorg,

w_ekgrp,

w_aedat,

w_ernam,

t_po_item.

refresh t_po_item.

select single ebeln

into ekko

from ekko

where ebeln = ekko-ebeln.

if sy-subrc = 0.

clear ekko.

clear ok_code_5000.

message e004 with ekko-ebeln. " PO Already exists.

endif.

endcase.

endmodule. " VALIDATE_ebeln INPUT