01-18-2018 11:15 AM
Ì 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
01-18-2018 11:42 AM
I have get used to press Ctrl + F7 (Check Master program) instead of Ctrl + F2.
01-18-2018 1:16 PM
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
01-19-2018 5:21 AM
" 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.
01-18-2018 11:48 AM
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.
01-18-2018 1:15 PM
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
01-19-2018 5:25 AM
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.
01-19-2018 6:47 AM
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...
01-18-2018 12:16 PM
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 ...
01-19-2018 6:50 AM
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.
06-04-2019 9:37 AM
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.
06-04-2019 9:56 AM
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.
06-04-2019 10:06 AM
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, …
06-04-2019 12:47 PM
I do use local classes (at least a lcl_main for handling events etc.). I just don't split the program into includes.
06-05-2019 10:26 AM
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.