‎2009 Jan 03 6:53 AM
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???
‎2009 Jan 03 7:00 AM
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
‎2009 Jan 03 7:18 AM
Hi,
Can you explain me clearly if the internal table cannot be accessed in BADI, how can i access the data?
Thanks,
Madan
‎2009 Jan 03 8:10 AM
‎2009 Jan 03 9:05 AM
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
‎2009 Jan 03 9:14 AM
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.
‎2009 Jan 03 9:47 AM
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
‎2009 Jan 03 8:10 AM
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.