<?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 Why does MRRL create incorrect G/L account? Profitability segment's fault? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-does-mrrl-create-incorrect-g-l-account-profitability-segment-s-fault/m-p/12805012#M2025219</link>
    <description>&lt;P&gt;Hello, &lt;BR /&gt;&lt;BR /&gt;I have a custom program that first creates a purchase order (that can be seen in ME21N) and then a material document (that can be seen in MIGO).&lt;BR /&gt;&lt;BR /&gt;In both of these cases the G/L account has a correct value. So there's nothing wrong here. &lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;BUT when MRRL is then used to create an invoice (based on the material document), then suddenly G/L account assumes a weird random value.&lt;/STRONG&gt; It is difficult for me to properly debug my way through MRRL as it is a standard SAP transaction. All I know is up until the point of using it - everything is fine. It was suggested to me that the problem occures due to the "Profitability segment". &lt;BR /&gt;&lt;BR /&gt;I am using it at the stage of creating a purchase order (for ME21N) - by providing the BAPI_PO_CREATE1 function module with the POACCOUNTPROFITSEGMENT structure which is populated as follows ("result_object" is what I called my implementation of POACCOUNTPROFITSEGMENT)&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;gwa_result_object-po_item   = gwa_poitem-po_item. &lt;BR /&gt;gwa_result_object-serial_no = 'S'. &lt;BR /&gt;gwa_result_object-fieldname = 'RKAUFNR'. &lt;BR /&gt;gwa_result_object-value     = gwa_tab_imp-order_id. &lt;BR /&gt;APPEND gwa_result_object TO gt_result_object.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;In ME21N at first the order's value was only "outside" the Profitability Segment (within the "Account Assignment" tab). Later on I was asked that the order be present both "outside" and inside the Profitability Segment. &lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I THINK that the problem started occuring after that - after I made it that the ORDER is both inside and outside the Profitability Segment.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Is that enough to determine what could be the problem? Why would the G/L account be wrong after the invoice is created in MRRL if it's fine at the purchase order stage (ME21N) and material document stage (MIGO)?&lt;BR /&gt;&lt;BR /&gt;The wrong value of G/L account can be seen in MIR7, not sure if that's relevant.&lt;BR /&gt;&lt;BR /&gt;Kind Regards,&lt;BR /&gt;Bartosz&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jul 2023 22:17:11 GMT</pubDate>
    <dc:creator>bmierzwi</dc:creator>
    <dc:date>2023-07-04T22:17:11Z</dc:date>
    <item>
      <title>Why does MRRL create incorrect G/L account? Profitability segment's fault?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-does-mrrl-create-incorrect-g-l-account-profitability-segment-s-fault/m-p/12805012#M2025219</link>
      <description>&lt;P&gt;Hello, &lt;BR /&gt;&lt;BR /&gt;I have a custom program that first creates a purchase order (that can be seen in ME21N) and then a material document (that can be seen in MIGO).&lt;BR /&gt;&lt;BR /&gt;In both of these cases the G/L account has a correct value. So there's nothing wrong here. &lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;BUT when MRRL is then used to create an invoice (based on the material document), then suddenly G/L account assumes a weird random value.&lt;/STRONG&gt; It is difficult for me to properly debug my way through MRRL as it is a standard SAP transaction. All I know is up until the point of using it - everything is fine. It was suggested to me that the problem occures due to the "Profitability segment". &lt;BR /&gt;&lt;BR /&gt;I am using it at the stage of creating a purchase order (for ME21N) - by providing the BAPI_PO_CREATE1 function module with the POACCOUNTPROFITSEGMENT structure which is populated as follows ("result_object" is what I called my implementation of POACCOUNTPROFITSEGMENT)&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;gwa_result_object-po_item   = gwa_poitem-po_item. &lt;BR /&gt;gwa_result_object-serial_no = 'S'. &lt;BR /&gt;gwa_result_object-fieldname = 'RKAUFNR'. &lt;BR /&gt;gwa_result_object-value     = gwa_tab_imp-order_id. &lt;BR /&gt;APPEND gwa_result_object TO gt_result_object.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;In ME21N at first the order's value was only "outside" the Profitability Segment (within the "Account Assignment" tab). Later on I was asked that the order be present both "outside" and inside the Profitability Segment. &lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I THINK that the problem started occuring after that - after I made it that the ORDER is both inside and outside the Profitability Segment.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Is that enough to determine what could be the problem? Why would the G/L account be wrong after the invoice is created in MRRL if it's fine at the purchase order stage (ME21N) and material document stage (MIGO)?&lt;BR /&gt;&lt;BR /&gt;The wrong value of G/L account can be seen in MIR7, not sure if that's relevant.&lt;BR /&gt;&lt;BR /&gt;Kind Regards,&lt;BR /&gt;Bartosz&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 22:17:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-does-mrrl-create-incorrect-g-l-account-profitability-segment-s-fault/m-p/12805012#M2025219</guid>
      <dc:creator>bmierzwi</dc:creator>
      <dc:date>2023-07-04T22:17:11Z</dc:date>
    </item>
  </channel>
</rss>

