Skip to Content
avatar image
Former Member

Re Badi.

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Apr 24, 2006 at 01:43 PM

    Hi,

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

    Hope this helps.

    Please mark helpful answers.

    Regards,

    Amit Mishra

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 24, 2006 at 01:54 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 24, 2006 at 01:55 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 24, 2006 at 01:56 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded