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

Display error message query

former_member474499
Participant
0 Likes
1,091

Hello,

I want to create a new query with selection screen but I want to know if it's possible to have an error message when a condition in the screen isn't satisfied.

Can you please help me? If yes, how can I do it?

Thank you in advance

1 ACCEPTED SOLUTION
Read only

amy_king
Active Contributor
0 Likes
708

Hi HK,

You can use the AT SELECTION-SCREEN event to validate the selection screen inputs and issue error message as needed. For example...

AT SELECTION-SCREEN.

IF carrid-low IS INITIAL OR

    city_from IS INITIAL   OR

    city_to IS INITIAL.

    MESSAGE e000(hb).

ENDIF.

Cheers,

Amy

4 REPLIES 4
Read only

amy_king
Active Contributor
0 Likes
709

Hi HK,

You can use the AT SELECTION-SCREEN event to validate the selection screen inputs and issue error message as needed. For example...

AT SELECTION-SCREEN.

IF carrid-low IS INITIAL OR

    city_from IS INITIAL   OR

    city_to IS INITIAL.

    MESSAGE e000(hb).

ENDIF.

Cheers,

Amy

Read only

0 Likes
708

Hello Amy,

Thank you for your answer.

When you talk about the at selection-sreen event, you mean that I can modify the genereted program of the query?

Kind regards.

HK

Read only

amy_king
Active Contributor
0 Likes
708

Hi HK,

My reply assumed you are writing the code for the selection screen in a custom report, is that incorrect? Are you instead using a tool like Quickviewer or SAP Query? If so, please take a look at the following discussions in SCN:

Cheers,

Amy

Read only

former_member474499
Participant
0 Likes
708

Hi Amy,

Thank you for the answer.

I'm using SAP Query. THank you for the links. I'll have a look at them.

thank you so much.