Application Development and Automation 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: 
Read only

INCLUDE statement

Former Member
0 Likes
1,047

I'm new in ABAP. I add a include statement in my ABAP. When the main program calls a FORM which is in INCLUDE statement by using the statement PERFORM, I always get a error message that : Statement is not accessable. Please advise. Thanks.

10 REPLIES 10
Read only

Former Member
0 Likes
1,021

hi,

first add the statement include program name then double click to create the program and simply save and activate and come back to the main program and write perfrom and double click on the form name to create form and endform a popup will come for u to select were to write the form and end form select the include program and write form and endform in the include program save and activate, then back to your main program save activate and execute.

Read only

0 Likes
1,021

Hi ravi chandran ,

I followed the way you introduced , the issue was still there. In the main program, when I double clicked the FORM name, the system can navigate to the INCLUDE program where the FORM exists.

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,021

Hello Jim

Obviously the INCLUDE statement comes after the PERFORM statement. Thus, the main program will not find the FORM routine. Simply change the order of the statements, e.g.:

REPORT zreport.

...
PERFORM subroutine.  " => syntax error, FORM not found

INCLUDE zinclude.  " contains routine subroutine

REPORT zreport.

* Put the includes rather at the top of the program
INCLUDE zinclude.  " contains routine subroutine
...
PERFORM subroutine.  " => ok, FORM found

Regards

Uwe

Read only

0 Likes
1,021

Hi Uwe,

I always put the INCLUDE on the top of the main program. When I double clicked the FORM name, the system can even navigate to the INCLUDE program where the FORM exists.

Read only

anversha_s
Active Contributor
0 Likes
1,021

hi,

please activate ur all includes.

Then try. also chk UWE'S solution

Regards

Anver

Read only

0 Likes
1,021

Hi Anversha s ,

Yes, all INCLUDES have been activated. Please refer my answer to Uwe as well. Thanks.

Read only

0 Likes
1,021

hi

can you plz paste ur code here..

Abdul

Read only

0 Likes
1,021

Hi Abdul, the sample program is attached :

Main program :

REPORT zhr_update_hr_master_data .

INCLUDE zhr_update_hr_master_data_top.

INCLUDE zhr_update_hr_master_data_f01.

perform get_source_data.

include porgram :

  • FORM Fetch source data.

form get_source_data.

P_rfc = 'HRDCLNT120'.

  • fetch tracking start date.

select single update_date into update_start_date from zhr_update_date.

  • Call Remote function to fetch the data

CALL FUNCTION 'ZHR_GET_MASTER_DATA'

DESTINATION p_rfc

EXPORTING

fi_date = update_start_date

TABLES

ft_0000 = lt_0000

ft_0001 = lt_0001

ft_0002 = lt_0002

ft_0006 = lt_0006

ft_0009 = lt_0009.

LOOP AT lt_0000 .

write : / lt_0000-pernr.

ENDLOOP.

endform.

Read only

0 Likes
1,021

HI Jim

Try it this way:

1. Just click on save in each program i.e zhr_update_hr_master_data, zhr_update_hr_master_data_top, zhr_update_hr_master_data_f01.

2. Now click on activate. In the popup window it gives the list of all programs to be activated, select all programs to activate.

Hope this way you can activate the main program...

Kind Regards

Eswar

Read only

0 Likes
1,021

Hello all ,

The issue has been resolved. There is a check box 'Unicode checks active' under Attributes of main program. I uncheck that check box, the main program is activated.

Again, thanks all for your help.

Jim