Application Development 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: 

Re Badi.

Former Member
0 Kudos

How to declare a global variable in badi.

Say I have to get value from a variable DELIVERY_FINAL_CHECK.

The value from this variable shud be used in another method SAVE_DOCUMENT_PREPARE.

Thanks and regards,

Sujatha

4 REPLIES 4

former_member927251
Active Contributor
0 Kudos

Hi,

You can define it as an attribute in the class interface.

Hope this helps.

Please mark helpful answers.

Regards,

Amit Mishra

Former Member
0 Kudos

Hi Tharun,

You can define the variable in the atribute of the interface. Make that attribute public.

Make it static attribute if wanna access it using only the class n not instantiate the object.

Regards,

Tanveer.

Please mark helpful answers.

Former Member
0 Kudos

HI

YES WE CAN DECLARE THE GLOBAL VARIABLE IN BADI

YOU CAN USE THE STATIC KEYWORD TO DECLARE A GLOBAL VARIABLE IN BADI.

GO THROUGH THIS LINKS

http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm

http://www.firstlogic.com/partners/SAP/faq.asp

THANKS

MRUTYUN

Former Member
0 Kudos

hi tarun,

declare a varible, say var1, in the <b>attribute</b> of the class implementing the BADi. The type of the variable must be of the same type as the variable whose value you want to get from the method DELIVERY_FINAL_CHECK.

Then you can use var1 in the method SAVE_DOCUMENT_PREPARE.

Regards,

Kunal.