2023 Sep 07 5:54 PM
Hi,
We have a global variable with name wa_pb_file_recxyab of type ty_pb_file_recxya.
data: wa_pb_file_recxyab TYPE ty_pb_file_recxya.
Inside one of my subroutines, when i try the below, nothing gets assigned to wa_pb_file_recxyab
wa_pb_file_recxyab+0(4) = 'test'.
But when i declare a local variable right before the line and try, it works
data: lwa_pb_file_recxyab type ty_pb_file_recxya.
lwa_pb_file_recxyab+0(4) = 'test'.
What am i missing. Please help.
Structure of TY_PB_FILE_REC03A is
TYPES : BEGIN OF ty_pb_file_recxya.
INCLUDE STRUCTURE zst_ab_charges.
TYPES: item_data(21) TYPE c.
INCLUDE STRUCTURE zst_ab_charges_b.
TYPES: premise TYPE eanl-vstelle,
ext_ui TYPE euitrans-ext_ui,
END OF ty_pb_file_rec03a.<br>
Thanks,
Joshua.
2023 Sep 08 5:02 AM
I guess that "it works" means that debug after the line doesn't show the change.
Sometimes, we developers don't see obvious errors. Just ask a fellow developer of yours to have a second look at it.
2023 Sep 08 5:02 AM
I guess that "it works" means that debug after the line doesn't show the change.
Sometimes, we developers don't see obvious errors. Just ask a fellow developer of yours to have a second look at it.
2023 Sep 08 9:24 AM
Thanks Sandra.
Your point 3 is the reason.
I discovered that the programmer has added a loop further down the line, within same subroutine, with a dynamic data field with same name!
Once i corrected it, it worked.
loop at itab....into data(wa_pb_file_recxyab)...
......
Thanks,
Joshua.
2023 Sep 09 3:32 PM
2023 Sep 08 8:57 AM
Activate the code that contains the "global variable" (whether it's a class attribute, a top include, or anything else).
Try again to generate your program/class (or double-click on the field name in the method/role source, if it is indeed a global variable, its definition should be displayed).