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

passing an internal table to a badi

Helo All,

I have declared a variable outside the badi say

data: phead like STRUCTURE_head occurs 0 with HEADER LINE.

suppose this phead contains say 4 rows .

  • calling the method of the badi .

.

CALL METHOD user_exit->method1

CHANGING

thead = phead .

Here the parameter thead is of the type structure , so only the header line is passed . How do i pass all the four rows to the badi ?

Thanks in advance

regards,

swetha

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 10, 2008 at 08:09 AM

    Use square brackets to indicate you are passing the contents of the table, i.e. itab[] instead of just itab.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 10, 2008 at 08:17 AM

    Hi Shwetha,

    As you are trying to pass in internal table to a structure in changing parameters, it would end up in error.

    If the BADI that you are using has CHANGING parameter of TYPE STRUCTURE, you cannot pass an internal table to the same.

    You can loop in the internal table and call the BADI inside the loop, passing the WORK AREA.

    Best Regards,

    Ram.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 10, 2008 at 08:24 AM

    Hi Swetha,

    call that method in a loop... endloop, and pass parameters.. like changing parameters with your structure and outside badi update it.

    Regards,

    Dhanunjaya Reddy.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Swetha,

      Let say, we have an internal table phead.

      You will be declaring a work area, lets say whead.

      now,

      LOOP AT phead into whead.

      BADI CALL.

      changing

      thead = whead.

      ENDLOOP.

      So, whead wil be passed as changing parameter to the badi...

      to be precise, you will be passing the structure to the badi.

      Best Regards,

      Ram.

  • Posted on Oct 10, 2008 at 08:44 AM

    Hi,

    We can not pass internal table to a structure type parameter. If you wish to pass 4 rows of data, you may need to use loop at the intenal table and call the BADI for 4 times.

    Hope this helps,

    Pragya

    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.