01-24-2008 2:40 AM
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?
01-24-2008 2:51 AM
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
01-24-2008 2:51 AM
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
01-24-2008 3:26 AM
Can you explain what should I fill in the parameters of this FM? Is there any guides for it?
01-24-2008 3:40 AM
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
01-24-2008 8:47 AM
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?
01-24-2008 7:15 AM
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