Application Development 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: 

Problem in declaring variables in TOP include and accessing them

manoj_goyal2
Participant

Hi Guys,

I am implementing Enhancement MEREQ001 and facing problem in declaring the variables and accessing them in the other includes.

Function Pool: SAPLXM02

*******************************************************************
*   System-defined Include-files.                                 *
*******************************************************************
  INCLUDE LXM02TOP.                          " Global Data
  INCLUDE LXM02UXX.                          " Function Modules

*******************************************************************
  INCLUDE LXM02F00.                        " SAP-Formpool for Customer-Use
  INCLUDE ZXM02ZZZ.                        " Subprograms and Modules

Include: ZXM02TOP .

*----------------------------------------------------------------------*
***INCLUDE ZXM02TOP .
*----------------------------------------------------------------------*
DATA:  g_pramt LIKE eban-preis.
DATA:  g_poamt LIKE eban-preis.

Include: ZXM02O01

*----------------------------------------------------------------------*
***INCLUDE ZXM02O01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Module  STATUS_0111  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0111 OUTPUT.

IF g_poamt GT  2000.

Endif.	

ENDMODULE.                 " STATUS_0111  OUTPUT

When I syntex check (Ctrl+F2) the program, it gives me the following error (RED) message.

The field u201CG_POAMTu201D is unknown, but there is field with similar name G_PRAMT.

When I forward navigate by double clicking g_poamt, it takes me to ZXM02TOP.

But when I try to activate it, the include is activated without giving any error message or warning.

I donu2019t know why system is not seeing G_POAMT. But it is seeing G_PRAMT.

What should I do to rectify this problem.

Thanks in advance.

10 REPLIES 10

Sm1tje
Active Contributor
0 Kudos

I would try two things (random order):

1. Activate anyway despite of errors, and see at runtime if it works.

2. Update the navigation index via the menu (Utilities I believe).

Former Member
0 Kudos

Hi ,

Change to display made and active the main program . I guess you havn't activated the top include

Try this . Its just a try

Thanks

Venki

0 Kudos

I have already activated TOP include and update navigation INDEX, but same error. I am getting this error only in PAI and PBO includes only, when trying to implement screen exits.

Include ZXM02O01 is PBO include.

Thanks again.

former_member205763
Active Contributor
0 Kudos

well if top include is activated i dont think it shud give u trouble, u just try like this once

DATA: g_pramt LIKE eban-preis,

g_poamt LIKE eban-preis.

also try declaring g_poamt before g_pramt and see wht happens

0 Kudos

Hi Kartik,

I tried declaring g_poamt before g_pramt, but same error.

Thanks,

manoj_goyal2
Participant
0 Kudos

No answer found

0 Kudos

hi minisap,

Could you solve this issue? How?

Edited by: Estacio Stefanini on Oct 29, 2009 6:16 PM

alejandro_bindi
Active Contributor
0 Kudos

After all this time, did anyone find a solution? I had this problem in the past and thought it was specific to that user exit function group, but I'm having it now for a different one.

I suppose it's because of the way includes are structured, but there has to be a solution. As already exposed here, updating navigation index / restructuring object list does no good. It is annoying when syntax checking, because it hides the possible real errors that you only face when activating.

uday_1994
Explorer
0 Kudos

Is there a way to fix this issue? re-arranged the includes such that the include which contains all the declarations is placed at the top and udpated the navigation index. Yet the issue is not resolved.

matt
Active Contributor
0 Kudos

ctrl-f7 usually works for syntax checks of objects with many includes. I don't use ctrl-f2 in these cases.