Skip to Content
avatar image
Former Member

Internal table

hi,

i want to use an internal for USR02.

In type definition, i wrote :

types: begin of s_usr02,

bname type usr02-bname,

end of s_usr02.

In OnInitialisation, i wrote :

data : tb_usr02 type table of s_usr02.

All is ok but in the layout, i cannot access it. It says :

"tb_usr02 is neither specified under tables nor defined as an internal table"

What can i do ?

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 16, 2004 at 03:43 PM

    Hi Cédric,

    The answer is in the question. :-o

    You declared tb_usr02 under OnInitialization, so You declared tb_usr02 locally for OnInitialization event

    only

    .

    If you want to see your internal table from each event (and you don't want to create a structure and a table type under DDIC), you need to declare a table type under types:

    TYPES:
      ty_t_usr02
        type standard table of s_usr02
        with default key
    .
    

    and declare tb_usr02 under page attributes:

    tb_usr02 type ty_t_usr02
    

    Enjoy yourself.

    Dany 😊

    Add comment
    10|10000 characters needed characters exceeded

    • hallo Cédric,

      First when you write "data:" you are declaring local variables in on method. Each onX event is one method in generated class. At the end of that method local data (which was on the stack) is gone! This is way you table did not work.

      The advice you received before should have been enough for you to crack this problem. I would seriously recommend reading a good ABAP book.

      On the

      Types

      tab, do the following:
      types: t_bname type standard table of usr02-bname.

      On the

      Attributes

      tab, do:

      bnames TYPE T_BNAME

      ++bcm