2011 Feb 11 5:37 AM
Hello friends,
I am working with Badi's and my requirement is i need to fetch the data from database in badi method and have to use that data in my abap program.
So, is there any way i can declare internal table as export parameter of badi method or else if I declare internal table in my abap program and export that while calling badi method then how to declare internal table as import parameter in badi method.
2011 Feb 11 1:26 PM
Some things are not clear here..
1 - You have a ABAP Program that trigger's a process that calls a BADI and then return to your ABAP Program
OR
2 - You have implemented a BADI in a process that runs separately from the ABAP Program, and you need to grab data from the BADI into your Program?
I`d suggest:
1 - Try to use a static method or a static class with a method that would "hold the data" from the badi into you memory. You could use methods like SET_INT_TABLE in BADI and then GET_INT_TABLE in your ABAP Prog.
2 - Not sure why you want to do this, but use a Z table.
Regards
Edited by: Mauricio Roberto Cruz on Feb 11, 2011 2:26 PM
2011 Feb 11 12:00 PM
Hi,
You can call a function module (Z_*) from the BADI and set in the interface the parameters that you need. In the function module you can work with internal tables.
I hope this helps you
Regards
Eduardo
2011 Feb 11 1:26 PM
Some things are not clear here..
1 - You have a ABAP Program that trigger's a process that calls a BADI and then return to your ABAP Program
OR
2 - You have implemented a BADI in a process that runs separately from the ABAP Program, and you need to grab data from the BADI into your Program?
I`d suggest:
1 - Try to use a static method or a static class with a method that would "hold the data" from the badi into you memory. You could use methods like SET_INT_TABLE in BADI and then GET_INT_TABLE in your ABAP Prog.
2 - Not sure why you want to do this, but use a Z table.
Regards
Edited by: Mauricio Roberto Cruz on Feb 11, 2011 2:26 PM
2011 Feb 15 1:46 PM
The methods which you had suggested 'set_int_table' and 'get_int_table' are SAP defined or I have to code them in my Badi and ABAP program.
2011 Feb 15 4:12 PM
You would have to create a new class in SE24, with 2 static methods that would maintain a attribute named INT_TABLE (where data you wanna hold will be stored).
Then you use SET_INT_TABLE inside the BADI, and you can grab data into your program using GET_INT_TABLE.
I already used something similar, and I found more useful and structured than just exporting things to memory (which i hate btw).
2011 Feb 16 9:06 AM