Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BADI Implementation

Former Member
0 Likes
912

Hi All,

I am customizing a standard program.There i will do some manipulations on the data and i will get data into an internal table.When i press save button it triggers a method in a 'BADI' which is already implemented.Now i need to change the implementation with the data from my program or int.table.How can i access my program data in the BADI implementation??

Can anyone pls help me???

7 REPLIES 7
Read only

Former Member
0 Likes
892

Hi Madan,

First of all you need to find the scope of th internal table. Check whether the Internal table can access from the BADI.

If no then you need to access the Stack to get the intenal table data.

Thanks,

Chidanand

Read only

0 Likes
892

Hi,

Can you explain me clearly if the internal table cannot be accessed in BADI, how can i access the data?

Thanks,

Madan

Read only

0 Likes
892

Could you please let us know what is the name of the BADI?

Read only

0 Likes
892

Hi Madan,

If the internal table is not accessible in BAdI Then you need to use the Stack

lets say suppose: Your internal table is in program 'ZZZZZZ'. Then you need to access the Stack and insert it into the field symbols.

Syntax :


FIELD-SYMBOLS: <FS> TYPE ANY.
ASSIGN ('(ZZZZZZZZ)ITAB') TO <FS>

You need to do some research in the Stack to find the program name where your internal table reside. for this I will tell you how to do.

First put a break point in the BADI

and execute the transaction and when the control stops into your break point then

Now switch the Debugger into Classic Debugger.

There is one button in the debugger names 'CALLS'. this stores the Stack information.

Now copy program one by one and try to do some hit and trial to find the actual program name which holds your internal table information.

I suppose this way you can solve your problem.

Thanks,

Chidanand

Read only

0 Likes
892

Hi,

What Chidanad has told is just fine to address the issue you are facing...but technically, i feel there is a small thing missing in there.

Chidanand Code :

FIELD-SYMBOLS: <FS> TYPE ANY.
ASSIGN ('(ZZZZZZZZ)ITAB') TO <FS>

My Suggestion:

FIELD-SYMBOLS: <FS> TYPE ANY TABLE.
ASSIGN ('(ZZZZZZZZ)ITAB[]') TO <FS>.

Doing the otherway round you may end up getting only header line of the program ZZZZZ as ONLY BADI is OO and not the program ZZZZZ necessarily.

@Chidanand: Please look into my suggestion and let me know if it is fine.

Thanks.

Read only

0 Likes
892

Hi Narayanan,

Thanks for correcting the code. I just missed [ ] in the code.

if you dont mention the squere bracket then you will get only header information and if you put braket then you will get the whole internal table information.

Thanks,

Chidanand

Read only

Former Member
0 Likes
892

HI,

Call the Program using the SUBMIT statement in the BADI implimentation. Using the EXPORT and IMPORT statement export/Import the internal table data to memory. This way you can access the data from badi and report program.