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

Error when using INCLUDE statement

Former Member
0 Likes
1,261

Hi,

If you could please help ...

I've created an INCLUDE program - Z01INIT - to be used in a dialogue program. I've added the INCLUDE z01init in the GLOBAL DATA.

When I activate Z01INIT I get the following error : Statement is not accessible -- line 6.

Z01INIT :

1 TABLES : z000.

2

3 DATA : wa_z000 TYPE z000.

4 *

4 **-Get default values

6 SELECT SINGLE * FROM z000 INTO wa_z000 WHERE werks_prod_veh > ''.

Dialogue program is UNICODE active.

Thanx !

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,101

Hi

You can declare all your data in the include Program.

Remove the select statement from the include and put this some other PBO module where you can actually do the validation.

I hope this anwers your question.

Regards

Neha

8 REPLIES 8
Read only

Former Member
0 Likes
1,101

hhh

Edited by: Abhilash on Nov 17, 2008 1:13 PM

Read only

Former Member
0 Likes
1,101

You commonly get this error when the code is placed after a FORM ....... ENDFORM. Check whether the INCLUDE is properly placed in a subroutine.

Just for your reference

[http://www.saptechnical.com/Tips/ABAP/StatementNotAccessible/Solution.htm]

Read only

0 Likes
1,101

Hi,

So if the fields that I declared in the INCLUDE is going to be used in 1001 subroutines I must add the select stamement to 1001 subroutines ?

Read only

0 Likes
1,101

Yes, the fields and the processing logic of the screen must be related. Please try it.

Read only

0 Likes
1,101

Thanx Neha & Avinash - your advice worked ! Much appreciated.

Read only

Former Member
0 Likes
1,101

Hi ,

Check the below thread,

Best Regards.

Read only

Former Member
0 Likes
1,102

Hi

You can declare all your data in the include Program.

Remove the select statement from the include and put this some other PBO module where you can actually do the validation.

I hope this anwers your question.

Regards

Neha

Read only

Former Member
0 Likes
1,101

Hi,

There is no problem ,

check the below code


tables : mara.

data : wa type mara.

select single * from mara into wa.

just retype the code what you have written.

regards

Kumar M