Skip to Content
0
Sep 07, 2023 at 04:54 PM

Global Variable assignment operation not working (Works with local variable)

82 Views Last edit Sep 07, 2023 at 04:55 PM 3 rev

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.