05-26-2011 11:27 PM
Hi All,
How to declare Global variable in BADI, in one of the thread they mentioned following.
Goto SE19 -> enter your BADI name.
goto the interface name.
Double click on " Name of implementing class: ".
go to the attributes tab. Here you can add the variable.
But this is not working.
Thanks,
Narayan
05-27-2011 12:46 AM
What is not working? The attribute will be accessible from all methods. If you define it as public then you will be able to access it from outside if you can get reference to badi.
Cheers
05-27-2011 4:06 AM
HI Narayan,
1) In that class check all the declaration will be there 2) DATA IT_LFA1 TYPE LFA1. INCLUDE mm_messages_mac. 3) Are you working with standard badi or custom one . Please elaborate .
Regards,
Madhu.
05-27-2011 6:15 PM
You can not do that globally as in SAP provided BADIs you have no permission to change the interface attributes and all.
you may handle the attribute as a variable inside the program.
Regards,
Prasenjit
05-27-2011 6:50 PM
You can not do that globally as in SAP provided BADIs you have no permission to change the interface attributes and all.
No, it works just as the poster and Martin described. Perhaps you didn't read the question carefully enough. You certainly have permission because the implementing class is under your control...
05-27-2011 8:58 PM
Hi All,
All,
Thanks for the suggestions. We fixed by using Export and Import. Just a temporary fix. But still there may be different option. available. But not sure how to fix,
Here is my code outline.Hope this will help.
Main FM.
Loop internal table.(internal table has value A and B).
User exit.
BADI( i declared g_var in attribute)
Case A.
g_var = 'TEST'.
Case B
value = g_Var.( i expect 'TEST', but i am not getting anything just blank).
endloop.
Thanks,
Narayan