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

Re Badi.

Former Member
0 Likes
640

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

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
Read only

Former Member
0 Likes
598

Hi,

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

Hope this helps.

Please mark helpful answers.

Regards,

Amit Mishra

Read only

Former Member
0 Likes
598

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.

Read only

Former Member
0 Likes
598

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

Read only

Former Member
0 Likes
598

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.