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

kiran_k8
Active Contributor
0 Kudos

Hi Folks,

Hi Folks,

I am getting the error message as a pop up and with no selection-screen.But I want the error message to be displayed in the status bar and with the selection-screen.Can anyone here please let me know how.

START-OF-SELECTION.

AT SELECTION-SCREEN OUTPUT.

PERFORM GETDATA.

IF P_MATNR IS NOT INITIAL.

UOM = T_MEINS.

ENDIF.

IF SY-SUBRC = 0.

  • To write the data

LOOP AT ITAB1.

IF ITAB1-MRPVAL IS INITIAL.

MESSAGE E004(ZKK).

ELSE.

MOVE ITAB1-MRPVAL TO C_KBETR.

ENDIF.

ENDLOOP.

Thanks,

K.Kiran.

1 ACCEPTED SOLUTION

former_member223537
Active Contributor
0 Kudos
START-OF-SELECTION.
*AT SELECTION-SCREEN OUTPUT.
PERFORM GETDATA.
IF P_MATNR IS NOT INITIAL.
UOM = T_MEINS.
ENDIF.

IF SY-SUBRC = 0.
* To write the data
LOOP AT ITAB1.
IF ITAB1-MRPVAL IS INITIAL.
MESSAGE E004(ZKK).
ELSE.
MOVE ITAB1-MRPVAL TO C_KBETR.
ENDIF.
ENDLOOP.
4 REPLIES 4

Former Member
0 Kudos

Comment line AT SELECTION-SCREEN OUTPUT.

This is not required in Start of selection.

Make above change and it should work.

Else you can move the validation to the At selection-screen event.

At selection-screen.

AT SELECTION-SCREEN OUTPUT.

PERFORM GETDATA.

IF P_MATNR IS NOT INITIAL.

UOM = T_MEINS.

ENDIF.

IF SY-SUBRC = 0.

  • To write the data

LOOP AT ITAB1.

IF ITAB1-MRPVAL IS INITIAL.

MESSAGE E004(ZKK).

ELSE.

MOVE ITAB1-MRPVAL TO C_KBETR.

ENDIF.

ENDLOOP.

Start-of-selection

  • Put your logic here.

ashish

Message was edited by:

Ashish Gundawar

0 Kudos

Ashish,

But I am using the AT seleciton-screen output to display base unit of measure once the user enters the MATNR.If I comment that I will not be getting UoM in the selection-screen as text.

Moreover if I comment at selection-screen output,it is giving the error message in the status bar but without the selection screen.

I want the error message to be displayed in the status bar but with the selection-screen.Kindly let me know.

Thanks,

K.Kiran.

0 Kudos

Check this out

AT SELECTION-SCREEN OUTPUT.

  • Here you are getting UoM.

PERFORM GETDATA.

IF P_MATNR IS NOT INITIAL.

UOM = T_MEINS.

ENDIF.

start-of-selection

  • Here add validation, i feel you are populating internal table with data ITAB1 in AT SELECTION SCREEN OUTPUT EVENT.

If this is blank, display error message "No data found for selection criteria.".

  • To write the data

LOOP AT ITAB1.

IF ITAB1-MRPVAL IS INITIAL.

MESSAGE E004(ZKK).

ELSE.

MOVE ITAB1-MRPVAL TO C_KBETR.

ENDIF.

ENDLOOP.

former_member223537
Active Contributor
0 Kudos
START-OF-SELECTION.
*AT SELECTION-SCREEN OUTPUT.
PERFORM GETDATA.
IF P_MATNR IS NOT INITIAL.
UOM = T_MEINS.
ENDIF.

IF SY-SUBRC = 0.
* To write the data
LOOP AT ITAB1.
IF ITAB1-MRPVAL IS INITIAL.
MESSAGE E004(ZKK).
ELSE.
MOVE ITAB1-MRPVAL TO C_KBETR.
ENDIF.
ENDLOOP.