Skip to Content
author's profile photo Former Member
Former Member

Internal Types in Class Builder

Hi Guys,

In am trying to add an internal type to a standard class in <b>Class Builder</b>. I have created a type with Ctrl + F5, But am not sure what to do next. Could any one plz explain me what are all the steps involved?

Thanks in Advance.

Regards,

Rajesh.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 15, 2005 at 02:58 AM

    Here are some examples:

    * Internal table type.
    
    TYPES: ty_t_my_type type standard table of mara.
    
    * Structure type.
    
    TYPES: begin of ty_my_struc,
             field1(4) type c,
             field2    type i,
           end of ty_my_struc.

    Then you can use the types:

    DATA: it_my_table type ty_t_my_table,
          wa_my_struc type ty_my_struc.

    Is this what you needed?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Charles,

      Thanks for the reply.

      'Direct type entry' option was disabled when I tried to create a new type for a standard SAP class. But it was enabled after Switching off Modfication assistant and I have created a direct type entry :-).

      regards,

      Rajesh.

  • author's profile photo Former Member
    Former Member
    Posted on May 15, 2005 at 03:35 PM

    Hello Rahesh,

    I assume you try to add a new type definition. The possibilties there depend on the release of your system.

    In release 4.x - 6.20 you can only define types in the protected and private section. Any definition can be used within any method coding. The use of these types within member or method declaration is of course limitied to private or protected ones. You can refer to the types by their name (like to types defined in forms).

    With release 6.40 or higher you can also define types in interfaces and the public section of classes. So they are part of the API of the class and can be also used outside. This can be done by following syntax:

      data: test_Data type cl_My_Class=>ty_Char_40.
    

    So in effect you may use an interface definition as a new kind of type-pool.

    Best Regards

    Klaus

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.