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

Program Abort

Former Member
0 Likes
2,722

Hello,

I am writing an ABAP program which validates data from an excel spreadsheet.

What I want to do is, if any of the data from the excel spreahseet is invalid

I simply want to display a pop up message saying 'Program Aborted' and

then exit the program without any further processing.

What is the best and safest way to abort a program in this case???

Any ideas?

Cheers

Andy

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,692

Just do an ABORT message.

Message A001(00) with 'Program is ending'.

Regards,

RIch Heilman

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,693

Just do an ABORT message.

Message A001(00) with 'Program is ending'.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
1,692

Hello,

If u find a invalid value in the file.

Just do this.


If sy-subrc Ne 0.
message a000 with 'Program Aborted'.
endif.

Vasanth

Read only

Former Member
0 Likes
1,692

Hi,

For this u need to use ABORT message type .

After validating data from an excel spreadsheet. i,e

In message class for message number 001 , provide ur message as :

'Program Aborted' .

and in ur coding :

if sy-subrc <> 0 / or any validation.

message A001.

endif.

This will show pop up message saying 'Program Aborted' adn then exit the program.

Revert back if any issues,

Reward with points if helpful.

Regards,

Naveen

Read only

Former Member
0 Likes
1,692

there are 5 message type are available in SAP

A - Abort - it will go out of the current screen and it will be at sap initial screen.

message a000.

I - Information message - popup window will open and shows message

E- Error message - error message in status bar

W - Warning message - message on status bar

S - Suceess message - message on status bar

for your requirement use Type A.

Read only

0 Likes
1,692

Thanks guys,

I didn't realise it was that simple

Cheers

Andy