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: 

SE80 sometimes checks an include, sometimes not. Why?

jrgkraus
Active Contributor

Ì usually use lots of includes in my programs. Now sometimes, when I press the syntax check button in SE80 while editing an include, the check runs automatically for the master program.

But in some cases (depends on the program I am working with), I get the error "REPORT/PROGRAM statement missing, or program type is INCLUDE."

To be clear:
Program A consists of 20 includes. When I edit one of those includes and press "Check", a syntax check is performed correctly for the main program.

Program B consists also of 20 includes. When I try the same thing, I get "REPORT/PROGRAM statement missing, or program type is INCLUDE."

Is there anything I can do? For prog B, this is very annoying

14 REPLIES 14

nomssi
Active Contributor

I have get used to press Ctrl + F7 (Check Master program) instead of Ctrl + F2.

jrgkraus
Active Contributor
0 Kudos

Of course this works fine. But I have the CTRL+F2 "in my blood" and I am wondering why this works in prog A and not in prog B

kiran_k8
Active Contributor
0 Kudos

" But I have the CTRL+F2 "in my blood" "

Well Said :-).

Jacques,

CTRL+F7 - That's a news to me.

Seems lot many short cuts and options I am still not aware of.Thanks for sharing.

K.Kiran.

horst_keller
Product and Topic Expert
Product and Topic Expert

I'd say, you need a top include. The compiler incorporates a top include into the syntax check for an individual include program. This enables meaningful syntax checks to be made on individual include programs.

0 Kudos

Here are the two examples. In each program, for testing, I do the following:

- double click the first include

- press CTRL+F2

In program A I get an error:

*&---------------------------------------------------------------------*
*& Report  ZDV03_DEMO_DYNPRO
*&
report  zp_pp48_label_maintain message-id zm_pp48.


include zp_pp48_label_maintain_mac.


include zp_pp48_label_maintain_if01. "lif_report


include zp_pp48_label_maintain_cd01. "lcl_model
include zp_pp48_label_maintain_cd02. "lcl_main
include zp_pp48_label_maintain_cd04. "lcl_alv
include zp_pp48_label_maintain_cd03. "lcl_alv_labels
include zp_pp48_label_maintain_cd05. "lcl_stralv
include zp_pp48_label_maintain_cd06. "lcl_stralv_label
include zp_pp48_label_maintain_cd07. "lcl_alv_fields
include zp_pp48_label_maintain_cd08. "lcl_alv_values
include zp_pp48_label_maintain_cd09. "lcl_dp_materials


include zp_pp48_label_maintain_top.


include zpp_pp48_label_maintain_ci01. "lcl_model
include zpp_pp48_label_maintain_ci02. "lcl_main
include zpp_pp48_label_maintain_ci03. "lcl_alv_labels
include zpp_pp48_label_maintain_ci04. "lcl_alv
include zpp_pp48_label_maintain_ci05. "lcl_stralv
include zpp_pp48_label_maintain_ci06. "lcl_stralv_label
include zpp_pp48_label_maintain_ci07. "lcl_alv_fields
include zpp_pp48_label_maintain_ci08. "lcl_alv_values
include zpp_pp48_label_maintain_ci09. "lcl_dp_materials


include zpp_pp48_label_maintain_m01.

In program B it works:

report  zp_cs01_confirm.


include zp_cs01_confirm_mac.


include zp_cs01_confirm_types.


class lcl_con_selscr_1000 definition deferred.
include zp_cs01_confirm_cd01.  " lcl_model
include zp_cs01_confirm_cd02.  " lcl_con_main
include zp_cs01_confirm_cd03.  " lcl_con_selscr_1000
include zp_cs01_confirm_cd04.  " lcl_con_dyndoc
include zp_cs01_confirm_cd05.  " lcl_con_stralv
include zp_cs01_confirm_cd06.  " lcl_con_stralv_h1
include zp_cs01_confirm_cd07.  " lcl_con_toolbar
include zp_cs01_confirm_cd08.  " lcl_con_alv
include zp_cs01_confirm_cd09.  " lcl_con_opers
include zp_cs01_confirm_cd10.  " lcl_con_time_conf
include zp_cs01_confirm_cd11.  " lcl_con_time_conf_exist


include zp_cs01_confirm_data.


include zp_cs01_confirm_evt.


include zp_cs01_confirm_ci01.  " lcl_model
include zp_cs01_confirm_ci02.  " lcl_con_main
include zp_cs01_confirm_ci03.  " lcl_con_selscr_1000
include zp_cs01_confirm_ci04.  " lcl_con_dyndoc
include zp_cs01_confirm_ci05.  " lcl_con_stralv
include zp_cs01_confirm_ci06.  " lcl_con_stralv_h1
include zp_cs01_confirm_ci07.  " lcl_con_toolbar
include zp_cs01_confirm_ci08.  " lcl_con_alv
include zp_cs01_confirm_ci09.  " lcl_con_opers
include zp_cs01_confirm_ci10.  " lcl_con_time_conf
include zp_cs01_confirm_ci11.  " lcl_con_time_conf_exist


include zp_cs01_confirm_mod.   " modules

I do non see a structural difference... strange

0 Kudos

Jorg,

May be the second program when created initially structured in the same program (without includes ) and then over a period of time shifted to INCLUDES.Could be a reason ?

K.Kiran.

0 Kudos

Indeed - program B has been copied from a template that was already split into includes, whilst A has been copied from a program without includes and has later been split. I rely on SAP development that this will be resolved in some future release...

NTeunckens
Active Contributor

I can duplicate something of the same when you Create a new Report with a TOP-Include, but in the TOP-Include, you Move the "REPORT"-Statement to the Main Program ...

In this way : your MAIN program will be something like this :

*&---------------------------------------------------------------------*
*& Include ZTMP_PRGR_CHECKINCLUDE3TOP                        Report ZTMP_PRGR_CHECKINCLUDE3
*&
*&---------------------------------------------------------------------*
*REPORT ZTMP_PRGR_CHECKINCLUDE3. "Remove or Comment this Statement

Your TOP-Include will be something like this ...

*&---------------------------------------------------------------------*
*& Report  ZTMP_PRGR_CHECKINCLUDE3
*&
*&---------------------------------------------------------------------*
*& Created Report with TOP Include, REMOVED the REPORT-Statement
*& from TOP and put it in the MAIN program => Run SyntaxCheck
*&---------------------------------------------------------------------*
REPORT ztmp_prgr_checkinclude3. "Copied over from TOP-include
INCLUDE ztmp_prgr_checkinclude3top              .    " global Data
* INCLUDE ZTMP_PRGR_CHECKINCLUDE3O01              .  " PBO-Modules
* INCLUDE ZTMP_PRGR_CHECKINCLUDE3I01              .  " PAI-Modules
* INCLUDE ZTMP_PRGR_CHECKINCLUDE3F01              .  " FORM-Routines

When in this TOP-Include, the Regular SyntaxCheck with throw the Error, the Check on the Master Program won't ...

jrgkraus
Active Contributor
0 Kudos

Thanks to kiran.k8 I now understand how this happens: When a program is being created with includes from scratch, CTRL+F2 will work in the includes, when not, you have to use CTRL+F7.

michał_badura
Participant
0 Kudos

Hi, I know this is an old topic, but since I was facing same problem lately, and the last conclusion here is not quite right, I just wanted to share my observations (which correlate with the answers from nic.teunckens and horst.keller).

If You define a TOP-Include, the REPORT / PROGRAM statement must be there, otherwise You get the error message You mentioned. If You don't have a TOP-Include, then everything is fine. In Your first program You have a TOP-Include, but the REPORT statement is in the main program, that's why You get an error. In Your second program there is no TOP-Include, so everything is fine.

matt
Active Contributor

I find includes a pain in Eclipse, so I've stopped using them... but I use Global classes primarily as recommend in the Clean Code initiative.

0 Kudos

matthew.billingham, yes You're right. But there are parts, which You can't move to a global (not even local in the report) class, like selection screen, reporting events, …

matt
Active Contributor

I do use local classes (at least a lcl_main for handling events etc.). I just don't split the program into includes.

0 Kudos

Maybe after copy program, you could right click on program (in se80), chose addition function / rebuild object list. I sometimes have to do the same.