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: 

what is the difference between syntax error runtime error?

Former Member
0 Kudos

what is the difference between syntax error runtime error?

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello

A program with a syntax error cannot be executed.

The program with a runtime error can be executed but dumps under certain conditions.

Example: You have a division statement in your program. If for some reason the denominator becomes zero then you will get a runtime error (something like DIVISION_BY_ZERO).

Syntax errors are static error that can be detected by the compiler.

Runtime errors are dynamic error that cannot be detected by the compiler.

Regards

Uwe

4 REPLIES 4

Former Member
0 Kudos

Hi

Syntax error means you are not using proper syntx in coding

Runtime error means syntax is correct but you are trying to do some operation whih is logically not possible like

you are having a FM with 5 parameters and both of them are necessary to pass and you are calling it without passing them then it raise runtime error

or

a = 5 % 0.

Regards

Aditya

uwe_schieferstein
Active Contributor
0 Kudos

Hello

A program with a syntax error cannot be executed.

The program with a runtime error can be executed but dumps under certain conditions.

Example: You have a division statement in your program. If for some reason the denominator becomes zero then you will get a runtime error (something like DIVISION_BY_ZERO).

Syntax errors are static error that can be detected by the compiler.

Runtime errors are dynamic error that cannot be detected by the compiler.

Regards

Uwe

Former Member
0 Kudos

HI

syntax error: if u have done mistake in declaring a particular predefined type then it gives syntax error.

for example: if u have done any mistake in declaration i.e instead of ATLINE-SELECTION U WRITE AT LINE SELECTION.....IT GIVES SYNTAX ERROR.

runtime error:the error which occurs during runtime.....

for example: if u give 5/0...then it gives runtime error.

if u declare a internal table with 5 feilds and u select 4 feilds and try to place in internal table...it gives runtime error.

Former Member
0 Kudos

Hi,

Syntax error:

A syntax error refers to an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language.

If a syntax error is encountered during compilation it must be corrected if the source code is to be successfully compiled.

Runtime error:

An error that occurs during the execution of a program. In contrast, Syntax errors occur while a program is being compiled. Runtime errors indicate bugs in the program or problems that the designers had anticipated but could do nothing about. For example, running out of memory will often cause a runtime error.

Note that runtime errors differ from bombs or crashes in that you can often recover gracefully from a runtime error.