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

ranges in top include

Former Member
0 Likes
872

helllo all,

In my function mdoule i have a top inculde

where i need to declare ranges but it gives me a error

message when i declareranges

-->statement not accessible

Very strange problem....any clue??

helllo all,

In my function mdoule i have a top inculde

where i need to declare ranges but it gives me a error

message when i declareranges

-->statement not accessible

Very strange problem....any clue??

6 REPLIES 6
Read only

Former Member
0 Likes
844

Can you copy the declaration??? have you included the tables statement?

Ex:

tables: mara.

Ranges: r_matnr for mara-matnr.

Read only

0 Likes
844

TABLES:yvbfktorg.

DATA:r_yvbeln TYPE RANGE OF yvbfktorg-yvbeln,

wa_r_yvbeln LIKE LINE OF r_yvbeln.

wa_r_yvbeln-sign = 'I'.

wa_r_yvbeln-option = 'CP'.

wa_r_yvbeln-low = 'WEB*'.

APPEND wa_r_yvbeln TO r_yvbeln.

I GUESS THE ABOVE IS RITE

Read only

0 Likes
844

Hi Bhanu,

You cannot put anything other than data declearations or form routines in the TOP include.

The following code

wa_r_yvbeln-sign = 'I'.

wa_r_yvbeln-option = 'CP'.

wa_r_yvbeln-low = 'WEB*'.

APPEND wa_r_yvbeln TO r_yvbeln.

cannot be put directly in top include.

Put it in a subroutine and call subroutine from your function module.

Cheers,

Aditya

Read only

0 Likes
844

ok aditya i m gonna try tat nd i hvnt declare the include in my FM its in the FG only

thnkx

bhanu

Read only

0 Likes
844

Hi Bhanu,

First activate the FG, then after that activate that TOP include.

or At the time of activating the top include it will show u the all includes, so select all includes and activate it.

i hope it may work,

reward points if helpful,

regards,

ravi shankar reddy

Read only

Former Member
0 Likes
844

Hi Bhanu,

By saying "In my function mdoule i have a top inculde" do you mean you have added an INCLUDE statement inside the code of the function module? If so, that is not the way.

Instead, every function module is attached to a function group, and the every function group has a top include (which is accessible to all function modules under the function group).

Hence, e.g. say your function group is ZFGRP, then your function module's top include would be program LZFGRPTOP which is added as an INCLUDE in the function group main program.

Please declare your RANGE in the LZFGRPTOP program and everything should be fine.

Regards,

Aditya