2023 Jun 01 10:05 AM
While giving Inline declaration, There was an syntax error.
2023 Jun 01 11:14 AM
The topinclude of a function group is used for data declarations. The statement is not a declaration but an assignment of value. In topinclude the statement is not accessible.
N.B. The statement makes no sense, because gv_fiscal_year is initial.
2023 Jun 01 12:42 PM
Eagle eyes to see L...TOP inside the screenshot 😄
2023 Jun 01 1:04 PM
So we need to declare gv fiscal post not initial.
2023 Jun 01 2:00 PM
No Sir, this statement is not possible in a topinclude of a function group. You can use your statement in a function module of this function group, but not in the data declaration of the topinclude.
2023 Jun 01 2:27 PM
I love that in the same place you have defined gv_ variables, you've also defined lv_ variables! Which are they? Global or local?
2023 Jun 02 4:12 AM
The error "Statement not accessible" typically occurs when a statement is not allowed in the current context or scope.
In your case, it seems that you are trying to perform a computation and assignment operation (`gv_previous_fyear = gv_fiscal_year - 1`) directly in the top include section.
To resolve this issue, you need to move the computation and assignment statement into a proper executable section, such as a subroutine, function module, or within an executable block of code.
For example, you can place the computation and assignment statement inside a subroutine or a method:
METHODS calculate_previous_fyear.
START-OF-SELECTION.
PERFORM calculate_previous_fyear.
FORM calculate_previous_fyear.
DATA: gv_fiscal_year TYPE numc4.
DATA(gv_previous_fyear) = gv_fiscal_year - 1.
...
ENDFORM.
Alternatively, you can place it within an executable block like this:
DATA: gv_fiscal_year TYPE numc4.
DATA(gv_previous_fyear) TYPE numc4.
START-OF-SELECTION.
gv_previous_fyear = gv_fiscal_year - 1.
...
Remember to ensure that the executable code is placed within a valid context such as a subroutine, function module, or an executable block.
2023 Jun 03 4:28 AM
To resolve this issue,
you need to write this statment in execution area i.e after star of selection.