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: 

Syntax check

Former Member
0 Kudos

Can anyone give me the codes on how to implement the syntax check FM namely: EDITOR_SYNTAX_CHECK and RS_SYNTAX_CHECK to my codes?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Here we go....EDITOR_SYNTAX_CHECK

&----


-

  • & Form chcek_syntax_error

&----


-

FORM chcek_syntax_error.

CALL FUNCTION 'EDITOR_SYNTAX_CHECK'

EXPORTING

I_global_check = ''

I_global_program = ''

I_program = 'ZUP19800526'

I_r2_check = ''

I_r2_destination = ''

I_trdir = ''

IMPORTING

O_error_include = er_include

O_error_line = er_line

O_error_message = error_message

O_error_offset = er_off

O_error_subrc = er_subrc

TABLES

I_source = uptab.

IF er_subrc <> 0.

Er_line = er_line - 2.

WRITE: / 1 'Error Line:' er_line.

WRITE: / 1 error_message-line1, error_message-line2,

Error_message-line3.

STOP.

ENDIF.

ENDFORM. "Chcek_syntax_error

Hope this Helps

Vinodh Balakrishnan

5 REPLIES 5

Former Member
0 Kudos

Here we go....EDITOR_SYNTAX_CHECK

&----


-

  • & Form chcek_syntax_error

&----


-

FORM chcek_syntax_error.

CALL FUNCTION 'EDITOR_SYNTAX_CHECK'

EXPORTING

I_global_check = ''

I_global_program = ''

I_program = 'ZUP19800526'

I_r2_check = ''

I_r2_destination = ''

I_trdir = ''

IMPORTING

O_error_include = er_include

O_error_line = er_line

O_error_message = error_message

O_error_offset = er_off

O_error_subrc = er_subrc

TABLES

I_source = uptab.

IF er_subrc <> 0.

Er_line = er_line - 2.

WRITE: / 1 'Error Line:' er_line.

WRITE: / 1 error_message-line1, error_message-line2,

Error_message-line3.

STOP.

ENDIF.

ENDFORM. "Chcek_syntax_error

Hope this Helps

Vinodh Balakrishnan

0 Kudos

Can you explain what should I fill in the parameters of this FM? Is there any guides for it?

Former Member
0 Kudos

In the example i gave you

Just Pass the following Importing Parameter

I_program = 'ZUP19800526' ( Your Program name)

And Provide following Variables as Export Parameters

O_error_include = er_include ( Like SY-REPID)

O_error_line = er_line (like SY-INDEX)

O_error_message = error_message (String)

O_error_offset = er_off (Like SY-TABIX)

O_error_subrc = er_subrc (Like SY-SUBRC)

And Tables

TABLES

I_source = uptab. ( Internal Table with header line)

Hope this Helps

Vinodh Balakrishnan

0 Kudos

I got a problem with the codes given which is here:

-


WRITE: / 1 'Error Line:' er_line.

WRITE: / 1 error_message-line1, error_message-line2,

Error_message-line3.

-


Can you explain what does this codes means and if I should replace it with anything?

Former Member
0 Kudos

Hi inorder to understand wht are the correct input to enter, you may directly enter tcode SE37- ABAP Function Modules.

Enter the EDITOR_SYNTAX_CHECK or RS_SYNTAX_CHECK to check what are the available attributes in each FM. Click on each tab (eg: Import, Export, Changing etc) then you will understand more clearly on the input or output. Hope this will solve your puzzle.

Reward points are highly appreciated. Thanks