<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pass a variable value between methods in BADI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233548#M1984700</link>
    <description>&lt;P&gt;I need to set the status of purchase req based on a field. &lt;/P&gt;&lt;P&gt;One method is to modify PR before inbound - This has the field value based on which the status should be set.&lt;/P&gt;&lt;P&gt; Another method modify PR during inbound - This has the EBAN details where i need to set the status value based on the value of a variable i get from above method.&lt;/P&gt;&lt;P&gt;For doing this, I've tried creating an instance &amp;amp; static attributes in the implementing class. Its not working. Need your suggestions in achieving this efficiently.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2020 14:28:27 GMT</pubDate>
    <dc:creator>ishwarya_doss</dc:creator>
    <dc:date>2020-10-27T14:28:27Z</dc:date>
    <item>
      <title>Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233542#M1984694</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I've implemented a BADI which has 2 methods. Inside the loop for every record, I need the parameter of method1 in order to set the logic in method2. &lt;/P&gt;
  &lt;P&gt;What is the best possible way to achieve that?&lt;/P&gt;
  &lt;P&gt;1. Tried creating Instance attribute to implementation class and populated it in method 1. But it's getting cleared when it comes out of method1.&lt;/P&gt;
  &lt;P&gt;2. Tried Static Attribute and it's not clearing the variable for every record in the loop.&lt;/P&gt;
  &lt;P&gt;3. Import/Export, Set/Get - What are the possible consequences of using memory ID. For example, if 2 users use the same transaction at the same time?&lt;/P&gt;
  &lt;P&gt;Kindly share your suggestions. &lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 12:12:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233542#M1984694</guid>
      <dc:creator>ishwarya_doss</dc:creator>
      <dc:date>2020-10-27T12:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233543#M1984695</link>
      <description>&lt;P&gt; @&lt;SPAN class="mention-scrubbed"&gt;matthew.billingham&lt;/SPAN&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 12:14:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233543#M1984695</guid>
      <dc:creator>ishwarya_doss</dc:creator>
      <dc:date>2020-10-27T12:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233544#M1984696</link>
      <description>&lt;P&gt;You need to use the Design Patern SingleTon &lt;/P&gt;&lt;P&gt;Here an example :&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/questions/12988109/how-do-we-use-singleton-in-oo-abap-can-someone-ple.html" target="test_blank"&gt;https://answers.sap.com/questions/12988109/how-do-we-use-singleton-in-oo-abap-can-someone-ple.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 12:28:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233544#M1984696</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2020-10-27T12:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233545#M1984697</link>
      <description>&lt;P&gt;BAdI use the "instance pattern", one instance per implementation/filter (maybe I simplify a little bit...), why using "singleton"? (to transfer values between BAdI implementations?)&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 13:34:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233545#M1984697</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-10-27T13:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233546#M1984698</link>
      <description>&lt;P&gt;I think it would help us if you explain the real case. I don't understand what mean 1, 2 and 3...&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 13:35:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233546#M1984698</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-10-27T13:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233547#M1984699</link>
      <description>&lt;P&gt;Yes! you are right!  if it is the same Class for the badi, you don't need SingleTon, the badi should already be a singleton ...&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 13:38:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233547#M1984699</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2020-10-27T13:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233548#M1984700</link>
      <description>&lt;P&gt;I need to set the status of purchase req based on a field. &lt;/P&gt;&lt;P&gt;One method is to modify PR before inbound - This has the field value based on which the status should be set.&lt;/P&gt;&lt;P&gt; Another method modify PR during inbound - This has the EBAN details where i need to set the status value based on the value of a variable i get from above method.&lt;/P&gt;&lt;P&gt;For doing this, I've tried creating an instance &amp;amp; static attributes in the implementing class. Its not working. Need your suggestions in achieving this efficiently.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 14:28:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233548#M1984700</guid>
      <dc:creator>ishwarya_doss</dc:creator>
      <dc:date>2020-10-27T14:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233549#M1984701</link>
      <description>&lt;P&gt;"Not working" isn't a recognised error description!&lt;/P&gt;&lt;P&gt;When you tried keeping the result from the first method in an instance attribute, exactly what did you do? What was your code? And when you debugged, what happened to the value in the attribute?&lt;/P&gt;&lt;P&gt;Instance attribute would be the approach I'd use.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 15:02:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233549#M1984701</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2020-10-27T15:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233550#M1984702</link>
      <description>&lt;P&gt;Instance attribute - Z_DEPLOY Instance Attribute Public&lt;/P&gt;&lt;P&gt;First method - &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;z_deploy = is_ibp_order_output-deployment.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Second method&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF z_deploy = 'X'.
      cs_eban-statu = 'D'.
    ENDIF.

Z_deploy was set to X in first method but got cleared when it came out of the method.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Oct 2020 15:30:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233550#M1984702</guid>
      <dc:creator>ishwarya_doss</dc:creator>
      <dc:date>2020-10-27T15:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233551#M1984703</link>
      <description>&lt;P&gt;Are you sure you are in the same instance of the badi ?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 15:54:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233551#M1984703</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2020-10-27T15:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233552#M1984704</link>
      <description>&lt;P&gt;So, the standard program has a global object . But multiple get badi and call badi statements which means its not in the same instance and hence the variable is getting cleared, Am i right? So , will export import be a good solution?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 18:08:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233552#M1984704</guid>
      <dc:creator>ishwarya_doss</dc:creator>
      <dc:date>2020-10-27T18:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233553#M1984705</link>
      <description>&lt;P&gt;Is it BAdI ME_PROCESS_PO_CUST?&lt;/P&gt;&lt;P&gt;What are the 2 methods you use?&lt;/P&gt;&lt;P&gt;Or is it a secret?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 19:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233553#M1984705</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-10-27T19:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233554#M1984706</link>
      <description>&lt;P&gt;Sure. To update purchase requisition data sent back from IBP to an SAP ERP system using the BAdI /IBP/ECC_MODIFY_PREQ. -modify preq and modify preq before in methods&lt;/P&gt;&lt;P&gt;Using this option as SAP note 2803585 cannot be implemented for the version we use.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 01:12:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233554#M1984706</guid>
      <dc:creator>ishwarya_doss</dc:creator>
      <dc:date>2020-10-28T01:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233555#M1984707</link>
      <description>&lt;P&gt;In debug you check the instance of the Badi is not the same ? &lt;/P&gt;&lt;P&gt;Because my_badi-&amp;gt;modify_preq and my_badi-&amp;gt;modify_preq_before should used the same instance&lt;/P&gt;&lt;P&gt;So &lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If it is the same instance, you don't need anything, just used a global (private) variable&lt;/LI&gt;&lt;LI&gt;if it is not the same instance, but the same LUW: you could use Design Pattern SingleTon&lt;/LI&gt;&lt;LI&gt;If it is not the same instance, not the same LUW, but the same transaction: you could used SHMA &lt;/LI&gt;&lt;LI&gt;If it is not the same instance, same LUW, same transaction: there is no simple and strong solution&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Wed, 28 Oct 2020 06:24:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233555#M1984707</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2020-10-28T06:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233556#M1984708</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;I don't have SCM but I guess that the method MODIFY_PREQ runs in the "main session" and MODIFY_PREQ_BEFORE_SAVE runs in the &lt;STRONG&gt;update task&lt;/STRONG&gt; (it's another User Session), so they cannot communicate except by passing parameters via CALL FUNCTION ... IN UPDATE TASK, because all these calls are executed in the same update task (same User Session/same memory).&lt;/P&gt;&lt;P&gt;You may create your own Z update function module, do an Implicit Enhancement of the standard to run before the first update function module is called, from which you call your Z update function module and pass the parameter(s) you want. In the Z function group, you may define a global variable (or, if you prefer, create a Z class pool, an instance attribute and work with it through a singleton), that you use to store the parameter, and read it later from the method MODIFY_PREQ_BEFORE_SAVE.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 06:24:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233556#M1984708</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-10-28T06:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Pass a variable value between methods in BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233557#M1984709</link>
      <description>&lt;P&gt;Thanks everyone for your suggestions!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 11:04:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-a-variable-value-between-methods-in-badi/m-p/12233557#M1984709</guid>
      <dc:creator>ishwarya_doss</dc:creator>
      <dc:date>2020-11-02T11:04:00Z</dc:date>
    </item>
  </channel>
</rss>

