<?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 Get services data in BADI ME_PROCESS_REQ_CUST when creating or modifying a PR via BAPI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-services-data-in-badi-me-process-req-cust-when-creating-or-modifying-a/m-p/12499843#M2003087</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;
  &lt;P&gt;We are using the method GET_SRV_DATA of interface IF_SERVICES_MM in order to get the services data in the method CHECK of BADI ME_PROCESS_REQ_CUST. This works correctly when the PR is being created or modified from transactions ME51N or ME52N. &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;DATA: lo_services TYPE REF TO if_services_mm.

* Get current item data
  CALL METHOD im_item-&amp;gt;get_data
    RECEIVING
      re_data = ls_item.

  TRY.
*     Casting
      lo_services ?= im_item.
    CATCH cx_sy_move_cast_error.
      RETURN.
  ENDTRY.

* Get data from Services and Limits tabs
  CALL METHOD lo_services-&amp;gt;get_srv_data
    EXPORTING
      im_packno = ls_item-packno
*     im_limit  = abap_true
    IMPORTING
      ex_esll   = lt_esll
      ex_esuh   = lt_esuh
      ex_esuc   = lt_esuc
      ex_eskl   = lt_eskl
    EXCEPTIONS
      failure   = 1
      OTHERS    = 2.
  

IF sy-subrc &amp;lt;&amp;gt; 0.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But the method GET_SRV_DATA does not return data when the PR is being created or modified via BAPI (BAPI_PR_CREATE or BAPI_PR_CHANGE). Is there an alternative way to obtain the service data in this case?&lt;/P&gt;
  &lt;P&gt;Thanks!&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Thu, 07 Oct 2021 08:15:00 GMT</pubDate>
    <dc:creator>ltirado</dc:creator>
    <dc:date>2021-10-07T08:15:00Z</dc:date>
    <item>
      <title>Get services data in BADI ME_PROCESS_REQ_CUST when creating or modifying a PR via BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-services-data-in-badi-me-process-req-cust-when-creating-or-modifying-a/m-p/12499843#M2003087</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
  &lt;P&gt;We are using the method GET_SRV_DATA of interface IF_SERVICES_MM in order to get the services data in the method CHECK of BADI ME_PROCESS_REQ_CUST. This works correctly when the PR is being created or modified from transactions ME51N or ME52N. &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;DATA: lo_services TYPE REF TO if_services_mm.

* Get current item data
  CALL METHOD im_item-&amp;gt;get_data
    RECEIVING
      re_data = ls_item.

  TRY.
*     Casting
      lo_services ?= im_item.
    CATCH cx_sy_move_cast_error.
      RETURN.
  ENDTRY.

* Get data from Services and Limits tabs
  CALL METHOD lo_services-&amp;gt;get_srv_data
    EXPORTING
      im_packno = ls_item-packno
*     im_limit  = abap_true
    IMPORTING
      ex_esll   = lt_esll
      ex_esuh   = lt_esuh
      ex_esuc   = lt_esuc
      ex_eskl   = lt_eskl
    EXCEPTIONS
      failure   = 1
      OTHERS    = 2.
  

IF sy-subrc &amp;lt;&amp;gt; 0.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But the method GET_SRV_DATA does not return data when the PR is being created or modified via BAPI (BAPI_PR_CREATE or BAPI_PR_CHANGE). Is there an alternative way to obtain the service data in this case?&lt;/P&gt;
  &lt;P&gt;Thanks!&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 08:15:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-services-data-in-badi-me-process-req-cust-when-creating-or-modifying-a/m-p/12499843#M2003087</guid>
      <dc:creator>ltirado</dc:creator>
      <dc:date>2021-10-07T08:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get services data in BADI ME_PROCESS_REQ_CUST when creating or modifying a PR via BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-services-data-in-badi-me-process-req-cust-when-creating-or-modifying-a/m-p/12499844#M2003088</link>
      <description>&lt;P&gt;Did you find any solution to this ?&lt;/P&gt;&lt;P&gt;I am facing the same problem in my project. &lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 16:12:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-services-data-in-badi-me-process-req-cust-when-creating-or-modifying-a/m-p/12499844#M2003088</guid>
      <dc:creator>bharatbajaj</dc:creator>
      <dc:date>2022-10-03T16:12:51Z</dc:date>
    </item>
  </channel>
</rss>

