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 the Include modularizarion from Function Group

Former Member
0 Likes
853

Hi all,

I have created a function group. in that I have given variables in the TOP Include.

How can i access that include in my program.

i tried INCLUDE keyword, but it gives error "Report or Program already exists "

Is it not possible to do so or Is there any other ways???

Regards

Vipin

1 ACCEPTED SOLUTION
Read only

former_member184675
Active Participant
0 Likes
784

Hi,

It is kinda possible.

The error you get is because the TOP Include, contains the syntax FUNCTION-POOL Z... and your program contains the syntax REPORT Z....


"

Each ABAP program can contain only one "REPORT", "PROGRAM",

"FUNCTION-POOL" statement.

"


So ... look for a workaround . Maybe create a new include ZTEST_TOP in both your FGRP top include and your report.

-

Andrei

5 REPLIES 5
Read only

former_member202818
Active Contributor
0 Likes
784

Hi Vipin,

I think its not possible. Except top include u can use.

Why do u want to do so?

If u want to access any variable declared in FG to your program create two function modules..

One for set data and other for get data.

Regards

Sreekanth

Read only

former_member184675
Active Participant
0 Likes
785

Hi,

It is kinda possible.

The error you get is because the TOP Include, contains the syntax FUNCTION-POOL Z... and your program contains the syntax REPORT Z....


"

Each ABAP program can contain only one "REPORT", "PROGRAM",

"FUNCTION-POOL" statement.

"


So ... look for a workaround . Maybe create a new include ZTEST_TOP in both your FGRP top include and your report.

-

Andrei

Read only

0 Likes
784

Better use a new include named LZxxxxxxT01 (L + Function groupe name + T01) so it is considered as a subobject of the funtion group, and should not be forgotten in a future development.

Regards,

Raymond

Read only

Former Member
0 Likes
784

thanks all..... ❤️

Read only

0 Likes
784

Please also take into account what said:


 

Better use a new include named LZxxxxxxT01 (L + Function groupe name + T01) so it is considered as a subobject of the funtion group, and should not be forgotten in a future development.

He is absolutely right about the naming of the include. Use FGRP namespace.