<?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: Problem using BAPI_MATERIAL_SAVEDATA as RFC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-material-savedata-as-rfc/m-p/12428224#M1997726</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the replies. I am able to update another field i.e. EKGRP (Purchasing Group) but not the MRP Profile (DISPR) field. Not sure why is that.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ashok&lt;/P&gt;</description>
    <pubDate>Thu, 23 Sep 2021 13:08:09 GMT</pubDate>
    <dc:creator>former_member218100</dc:creator>
    <dc:date>2021-09-23T13:08:09Z</dc:date>
    <item>
      <title>Problem using BAPI_MATERIAL_SAVEDATA as RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-material-savedata-as-rfc/m-p/12428221#M1997723</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;I am using the FM BAPI_MATERIAL_SAVEDATA as an RFC from a remote system to update the MRP Profile (MARC-DISPR). The issue is the return message gives me a success message of 'Material Successfully created or Extended' but when I go to the target system the value is not changed. &lt;/P&gt;
  &lt;P&gt;I went directly into the target system and executed the BAPI using the same values. This time the data was updated into the table. I am not sure why the data did not get get updated when I am using the BAPI as a RFC call from an external system.&lt;/P&gt;
  &lt;P&gt;I am using the following code. Please let me know what i am missing.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;   SELECT * FROM ztd_master_data
            INTO TABLE gt_material_tab
            WHERE (gt_where_clauses).
          IF sy-subrc = 0.
            SORT gt_material_tab BY matnr.
            DELETE ADJACENT DUPLICATES FROM gt_material_tab COMPARING matnr.
            LOOP AT gt_material_tab INTO DATA(la_material_tab).
              headdata-material = la_material_tab-matnr.
              headdata-mrp_view = 'X'.


              marcout-plant = la_material_tab-werks.
              marcoutx-plant = la_material_tab-werks.

           READ TABLE gt_result ASSIGNING FIELD-SYMBOL(&amp;lt;fs_result&amp;gt;) WITH KEY zvalue = &amp;lt;fs_cond&amp;gt;-zrule.
              IF sy-subrc = 0.
                marcout-mrpprofile = &amp;lt;fs_result&amp;gt;-zvalue.
                marcoutx-mrpprofile = 'X'.
              ENDIF.
             CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
                DESTINATION lv_rfcdest
                EXPORTING
                  headdata       = headdata
                  plantdata      = marcout
                  plantdatax     = marcoutx
                IMPORTING
                  return         = return
                TABLES
                  returnmessages = returnmes.

              READ TABLE returnmes INTO DATA(la_returnmes) WITH KEY type = 'E'.
              IF sy-subrc NE 0.
* Commit to release the locks
                CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                  DESTINATION lv_rfcdest
                  EXPORTING
                    wait = 'X'.
              ELSE.
                CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
                  DESTINATION lv_rfcdest.
              ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Sep 2021 16:17:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-material-savedata-as-rfc/m-p/12428221#M1997723</guid>
      <dc:creator>former_member218100</dc:creator>
      <dc:date>2021-09-22T16:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using BAPI_MATERIAL_SAVEDATA as RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-material-savedata-as-rfc/m-p/12428222#M1997724</link>
      <description>&lt;P&gt;It should work the same in the two systems. No visible problem with your code (anyway, as you said, it works if you run it in the server system without the remote calls).&lt;/P&gt;&lt;P&gt;The only possible difference is that your RFC destination uses a different user than the one you use to test directly in the other system.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 05:55:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-material-savedata-as-rfc/m-p/12428222#M1997724</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-09-23T05:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using BAPI_MATERIAL_SAVEDATA as RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-material-savedata-as-rfc/m-p/12428223#M1997725</link>
      <description>&lt;P&gt;Have you checked the authorizations in the target system, you need the same authorization as when you run directly on the system, but also an RFC authorization for the called function groups (authorization object S_RFC) - you could start an autjorization trace in target system&lt;/P&gt;&lt;P&gt;Did you also check with transaction SM21 in target system for some errors triggered in update task&lt;/P&gt;&lt;P&gt;In your code:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You use WAIT option, so you can get an error message returned in RETURN parameter of BAPI_TRANSACTION_COMMIT. (check it or remove the WAIT option)&lt;/LI&gt;&lt;LI&gt;You didn't check the exceptions raised by a synchronous RFC call&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE&gt;" Sample
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
  DESTINATION lv_rfcdest
  EXPORTING
    headdata              = headdata
    plantdata             = marcout
    plantdatax            = marcoutx
  IMPORTING
    return                = return
  TABLES
    returnmessages        = returnmes
  EXCEPTIONS
    system_failure        = 1 MESSAGE msg
    communication_failure = 2 MESSAGE msg.
" ...
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' 
  DESTINATION lv_rfcdest
  EXPORTING
    wait   = 'X'
  IMPORTING
    return                = return
  EXCEPTIONS
    system_failure        = 1 MESSAGE msg " here optional as it already work fine in first call
    communication_failure = 2 MESSAGE msg.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Sep 2021 11:49:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-material-savedata-as-rfc/m-p/12428223#M1997725</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2021-09-23T11:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using BAPI_MATERIAL_SAVEDATA as RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-material-savedata-as-rfc/m-p/12428224#M1997726</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the replies. I am able to update another field i.e. EKGRP (Purchasing Group) but not the MRP Profile (DISPR) field. Not sure why is that.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ashok&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 13:08:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-material-savedata-as-rfc/m-p/12428224#M1997726</guid>
      <dc:creator>former_member218100</dc:creator>
      <dc:date>2021-09-23T13:08:09Z</dc:date>
    </item>
  </channel>
</rss>

