Skip to Content

Table with OCCURS in OO

Hi,

i need to call a function module in a method. This function module needs a table in the TABLES part of the interface declaration with a header line. In a method, it is no longer allowed to declarde tables with OCCURS, only with TABLE of or STANDARD TBALE OF. But when i di this, i'm getting a cought exception with id 00 und message number 786 which i cand interpret.

Calling the function module dircet in debugging mode with the same input values works fine. So how do i call such a funtion in a method? I really would like to avoid to write a wrapper.

Thx in advance

Rainer Hübenthal

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 16, 2005 at 01:32 PM

    Hi Rainer,

    You said "<i>This function module needs a table in the TABLES part of the interface declaration with a header line</i>". I'm not sure I understood what you're saying here. The Function Module doesn't require you to pass a table with a header line. Even if the table doesn't have a header line, there won't be any error. the function module will automatically create one, to be used inside it.

    regards,

    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 16, 2005 at 01:38 PM

    Hi Rainer

    In Object Oriented ABAP, internal tables with header lines are not supported.

    So, you need to correct your codes, use a seperate work area for your purpose.

    Regards

    Ashish Jain

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 16, 2005 at 02:19 PM

    Hi Rainer

    How are you declaring the internal table positions? Are you declaring it in Class 'Attributes' as -

    Attribute : positions

    Typing : TYPE

    Associated TYPE: HROBJECTS

    If yes, here is the solution to your problem-

    What is happening currently is, you are declaring 'positions' as a work area. For declaring it as an internal table -

    You have to create a type in 'Internal types' tab of the class (say - xyz).

    in internal types, in the private/protected section of xyz, declare the type as:

    Types: xyz type standard table of HROBJECTS.

    Now, in the 'attributes' tab, declare:

    Attribute : positions

    Typing : TYPE

    Associated TYPE: xyz

    Cheers

    Ashish Jain

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 16, 2005 at 02:43 PM

    Hi, I have created a class, and add the code into a method like your description, but haven't got the exception. The compile is successful, and call method is smooth.

    When do you get the exception, in compile class or runtime?

    Thanks a lot

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 16, 2005 at 02:49 PM

    Hi Rainer

    I'm clueless for what error you are getting. please go to ST22 and see dump analysis and see at which line of code error is coming.

    Regards

    Ashish Jain

    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.