<?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: Function data clashing with BADI data in same LUW in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048285#M1611570</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adrian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not understand. Please post some code lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that parameters are passed by reference so maybe you better copy values to local fields before passing them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jul 2011 21:01:45 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2011-07-14T21:01:45Z</dc:date>
    <item>
      <title>Function data clashing with BADI data in same LUW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048283#M1611568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I implemented IF_BADI_HU_SAVE&lt;SUB&gt;SAVE and run BAPI_HU_GETLIST from it. But the strangest thing happens - the IT_HEADER and IT_ITEMS exist in IF_BADI_HU_SAVE&lt;/SUB&gt;SAVE parameter list as well as within BAPI_HU_GETLIST forms. The Function Module actually overwrites the BADI's tables with it's own.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We don't have the luxury of ECC environment, so shared memory is not an option. What I can do in the interim is to store the tables upon entry and populate them again at exit, but out of interest. How would one go about creating another LUW/instance that would not affect the current? I tried calling the Function Module from a static method or instance method, but the same happens. The only place where it did not interfere with the BADI parameters was when I call it from a program and SUBMIT AND RETURN. But the problem there is that it did not allow me to IMPORT parameters/tables from MEMORY IDs within the OO context. So a solution would be SHARED MEMORY in ECC environments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2011 14:19:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048283#M1611568</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-14T14:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Function data clashing with BADI data in same LUW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048284#M1611569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adrian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if I got ur problem right , but when the control is returned from BAPI , the calling program's (in this case its method SAVE) variables will re-gain its previous state unless we are passing it to importing or changing parameter of the FM. So I think it_header should have its original state when the control is returned from BAPI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pawan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2011 15:24:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048284#M1611569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-14T15:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Function data clashing with BADI data in same LUW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048285#M1611570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adrian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not understand. Please post some code lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that parameters are passed by reference so maybe you better copy values to local fields before passing them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2011 21:01:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048285#M1611570</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-07-14T21:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Function data clashing with BADI data in same LUW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048286#M1611571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The theory listed I'm aware of, thanks. You'll notice that the parameters of the BADI are not flagged as pass by value. Neither is it passed in the called BAPI as parameters. And if you programatically try and change IT_HEADER or IT_ITEMS, you'll get a compilation error. This is what is so strange about the whole thing. Nowhere am I changing the IT_HEADER or IT_ITEMS tables explicitly, and as mentioned - it is impossible to compile the program if you attempt this. But once you call the BAPI, these values are messed up. And when you drill down into the BAPI, you'll see that it has tables within the function group forms that have the same names as the ones in the BADI interface/parameters. So for some obscure reason, the values are changed at runtime by the BAPI/Function Group, and they do not "have their original state" as suggested/expected when returning. I've implemented probably 100s of BADIs, but never had this problem before. You can implement and test yourself to see what I mean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only way around this is to start another logical unit of work which will ensure that the "own data" on both sides do not get affected by one another - ensuring "encapsulation". This is possible with a submit statement, but then I cannot use IMPORT MEMORY ID in the BADI, because of OO context limitations. And as mentioned, SHARED MEMORY is not possible, because we're on 4.7c. And writing temporarely to Z tables is way to risky and ugly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 05:55:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048286#M1611571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-15T05:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Function data clashing with BADI data in same LUW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048287#M1611572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the BADI's interface/parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF_SYNCRON Importing Type XFELD Synchronous Update&lt;/P&gt;&lt;P&gt;IS_HEADER51 Importing Type HEADER51 General Header Data for Processing&lt;/P&gt;&lt;P&gt;IT_HEADER Importing Type HUM_HU_HEADER_T Handling Unit Headers&lt;/P&gt;&lt;P&gt;IT_ITEMS Importing Type HUM_HU_ITEM_T Handling Unit Items&lt;/P&gt;&lt;P&gt;IT_HISTORY Importing Type HUM_HISTORY_T Handling Unit History Records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, because all of them are IMPORTING parameters, in theory they should be unchangeable, but BAPI_HU_GETLIST changes their content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 06:23:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048287#M1611572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-15T06:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Function data clashing with BADI data in same LUW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048288#M1611573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Adrian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry to hear that you're on 4.6C!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway since Shared Memory is not an option, did you check if there is an option to move the data to cluster tables(e.g., INDX) via the IMPORT FROM / EXPORT TO DATABASE construct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;You'll notice that the parameters of the BADI are not flagged as pass by value&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's the problem with this BAdI + BAPI combo. If i understand correctly the BAPI changes the "actual" internal tables &amp;amp; hence the formal params get changed &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why don't you copy the contents of these tables to some local internal tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Please bear with me 'coz i don't have access to SAP &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Jul 15, 2011 11:59 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 06:28:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048288#M1611573</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-07-15T06:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Function data clashing with BADI data in same LUW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048289#M1611574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Suhas, not as sorry as I am on not having ECC!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll have to look into the IMPORT FROM / EXPORT TO DATABASE options. Haven't attempted that yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're 100% correct. The BAPI changes the actual internal table content. I did copy the contents to internal tables, but used that in my evaluation. The problem is that it is impossible to change it back at the end of the BADI, because the tables are Import parameters and when you attempt to change the content programatically, compilation fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll read up on your IMPORT FROM / EXPORT TO DATABASE option. The IMPORT/EXPORT to/from MEMORY IDs fails to compile in OO context, so I'm not too sure if the TO/FROM DATABASE option will be any different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Adrian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 06:53:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048289#M1611574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-15T06:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Function data clashing with BADI data in same LUW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048290#M1611575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adrian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it was my suggestion and also Suhas wrote&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Why don't you copy the contents of these tables to some local internal tables?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any reason &lt;STRONG&gt;not&lt;/STRONG&gt; to do so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Post some code lines, please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 09:34:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048290#M1611575</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-07-15T09:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Function data clashing with BADI data in same LUW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048291#M1611576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As mentioned, that's a pointless exercise,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because the badi parameter tables are erroneously overwritten in the background and can't be changed back. The Delivery can actually not be saved after a call to the BAPI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm closing the post now. Thanks for everyone attempts and suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 10:30:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-data-clashing-with-badi-data-in-same-luw/m-p/8048291#M1611576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-15T10:30:48Z</dc:date>
    </item>
  </channel>
</rss>

