<?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>Question Re: Managed RAP application to create PurchaseOrder in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14499198#M4949829</link>
    <description>&lt;P&gt;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/2293967"&gt;@AlexandrePassarelli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting this error. My PurchaseOrderItem is getting failed. I am also sharing my code below.&lt;/P&gt;&lt;LI-CODE lang="json"&gt;{
  "error": {
    "code": "06/010",
    "message": "Document contains no items",
    "@SAP__common.ExceptionCategory": "Provider_Application_Error",
    "innererror": {
      "ErrorDetails": {
        "@SAP__common.Application": {
          "ComponentId": "BC-ESI-ESF-GW",
          "ServiceRepository": "SRVD",
          "ServiceId": "ZSD_PR_REQUEST",
          "ServiceVersion": "0001"
        },
        "@SAP__common.TransactionId": "C83CB3D2A1420010E006AC72303CC720",
        "@SAP__common.Timestamp": "20261008052329.186745",
        "@SAP__common.ErrorResolution": {
          "Analysis": "Use ADT feed reader \"SAP Gateway Error Log\" or run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details",
          "Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"
        }
      }
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Method CreatePOAuto&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;READ ENTITIES OF zi_po_request IN LOCAL MODE
        ENTITY POReq
            ALL FIELDS WITH CORRESPONDING #( keys )
        RESULT DATA(lt_request).
    LOOP AT lt_request ASSIGNING FIELD-SYMBOL(&amp;lt;fs_req&amp;gt;).

      IF &amp;lt;fs_req&amp;gt;-Purchaseorder IS NOT INITIAL.
        CONTINUE.   " Already processed
      ENDIF.
      DATA(lv_pr) = |{ &amp;lt;fs_req&amp;gt;-purchaserequisition ALPHA = OUT }|.
      SELECT SINGLE purchaserequisition, purchaserequisitionitem,
                     material, plant, requestedquantity, baseunitisocode
        FROM zpr_request
        WHERE purchaserequisition = @lv_pr
        INTO @DATA(ls_pr).
      IF sy-subrc &amp;lt;&amp;gt; 0.
        CONTINUE.
      ENDIF.

      DATA(lv_cid_hdr_po)  = |POHDR_{ sy-tabix }|.
      DATA(lv_cid_item_po) = |POITM_{ sy-tabix }|.
      MODIFY ENTITIES OF I_PurchaseOrderTP_2
          ENTITY PurchaseOrder
            CREATE
              FIELDS ( PurchaseOrderType CompanyCode PurchasingOrganization Supplier PurchasingGroup )
              WITH VALUE #(
                ( %cid                     = lv_cid_hdr_po
                  PurchaseOrderType        = 'NB'
                  CompanyCode              = '1710'
                  PurchasingOrganization   = '1710'
                  Supplier                 = '0017300002'
                  PurchasingGroup          = &amp;lt;fs_req&amp;gt;-Purchasinggroup ) )

            CREATE BY \_PurchaseOrderItem
              FIELDS ( PurchaseRequisition purchaserequisitionitem plant material
                       OrderQuantity PurchaseOrderQuantityUnit
                        )
              WITH VALUE #(
                ( %cid_ref = lv_cid_hdr_po
                  %target  = VALUE #(
                    ( %cid                       = lv_cid_item_po
                      PurchaseOrderItem          = '00002'
                      PurchaseRequisitionItem    = ls_pr-PurchaseRequisitionItem
                      OrderQuantity              = ls_pr-RequestedQuantity
                      PurchaseRequisition        = ls_pr-Purchaserequisition
                      PurchaseOrderQuantityUnit  = ls_pr-BaseUnitISOCode
                       ) ) ) )

          MAPPED   DATA(lt_po_mapped)
          FAILED   DATA(lt_po_failed)
          REPORTED DATA(lt_po_reported)&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 08 Oct 2026 05:27:41 GMT</pubDate>
    <dc:creator>RITZZ</dc:creator>
    <dc:date>2026-10-08T05:27:41Z</dc:date>
    <item>
      <title>Managed RAP application to create PurchaseOrder</title>
      <link>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaq-p/14497852</link>
      <description>&lt;P&gt;I have created one managed RAP application to create PurchaseRequisition and store it in a custom table along with messages.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to extend this application to create PurchaseOrder also and store it along with Vendor details in that same Z table. But I am facing some issue. is it possible to create PO using managed application with Unamanaged Save.&lt;/P&gt;&lt;P&gt;I am also attaching my code for the PR creation scenario.&lt;/P&gt;&lt;P&gt;Behavior Def&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;managed implementation in class zbp_i_pr_request unique;
strict ( 2 );

define behavior for ZI_PR_REQUEST alias PRReq
//persistent table zpr_request
lock master
authorization master ( instance )
//with additional save
//etag master &amp;lt;field_name&amp;gt;
with unmanaged save
{
create ( authorization : global );
update;
delete;
field ( readonly, numbering : managed ) ReqUuid;
field ( readonly ) Purchaserequisition, Message, Messagetype;

determination createPRAuto on save { create; }

mapping for zpr_request
{
ReqUuid                    = req_uuid;
Purreqdescription          = purreqdescription;
Purchaserequsitiontype     = purchaserequsitiontype;
Purchaserequisitionitem    = purchaserequisitionitem;
Purchaserequsitionitemtext = purchaserequsitionitemtext;
Plant                      = plant;
Material                   = material;
Deliverydate               = deliverydate;
Requestedquantity          = requestedquantity;
Baseunitisocode            = baseunitisocode;
Purchasinggroup            = purchasinggroup;
Purchaserequisition        = purchaserequisition;
Message                    = message;
Messagetype                = messagetype;
}
}&lt;/LI-CODE&gt;&lt;P&gt;Global Class&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;CLASS zbp_i_pr_request DEFINITION PUBLIC ABSTRACT FINAL FOR BEHAVIOR OF zi_pr_request.
public section.
TYPES: BEGIN OF ty_pr_details,
pid        TYPE abp_behv_pid,
cid        TYPE abp_behv_cid,
pur_req    TYPE zpr_request-purchaserequisition,
req_uuid TYPE zpr_request-req_uuid,
END OF ty_pr_details.
CLASS-DATA purchase_requisition_details TYPE TABLE OF ty_pr_details.
protected section.
private section.

ENDCLASS.

CLASS zbp_i_pr_request IMPLEMENTATION.
ENDCLASS.&lt;/LI-CODE&gt;&lt;P&gt;CreatePr method&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;METHOD createPRAuto.
    READ ENTITIES OF zi_pr_request  IN LOCAL MODE
        ENTITY PRReq
            ALL FIELDS WITH CORRESPONDING #( keys )
        RESULT DATA(lt_resquest).

    LOOP AT lt_resquest ASSIGNING FIELD-SYMBOL(&amp;lt;fs_req&amp;gt;).
      IF &amp;lt;fs_req&amp;gt;-Purchaserequisition IS NOT INITIAL.
        CONTINUE.
      ENDIF.

      DATA(lv_cid_hdr)  = |PRHDR_{ sy-tabix }|.
      DATA(lv_cid_item) = |PRITM_{ sy-tabix }|.

      MODIFY ENTITIES OF i_purchaserequisitiontp
          ENTITY PurchaseRequisition
            CREATE
              FIELDS ( purchaserequisitiontype PurReqnDescription )
              WITH VALUE #(
                ( %cid                     = lv_cid_hdr
                  PurchaseRequisitionType  = &amp;lt;fs_req&amp;gt;-Purchaserequsitiontype
                  PurReqnDescription       = &amp;lt;fs_req&amp;gt;-Purreqdescription ) )

            CREATE BY \_purchaserequisitionitem
              FIELDS ( purchaserequisitionitem plant material
                        purchasinggroup requestedquantity baseunit
                        deliverydate PurchaseRequisitionItemText )
              WITH VALUE #(
                ( %cid_ref = lv_cid_hdr
                  %target  = VALUE #(
                    ( %cid                      = lv_cid_item
                      PurchaseRequisitionItem    = &amp;lt;fs_req&amp;gt;-PurchaseRequisitionItem
                      Plant                      = &amp;lt;fs_req&amp;gt;-Plant
                      Material                   = &amp;lt;fs_req&amp;gt;-Material
                      PurchasingGroup            = &amp;lt;fs_req&amp;gt;-PurchasingGroup
                      RequestedQuantity          = &amp;lt;fs_req&amp;gt;-RequestedQuantity
                      BaseUnit                   = &amp;lt;fs_req&amp;gt;-BaseUnitISOCode
                      DeliveryDate               = &amp;lt;fs_req&amp;gt;-DeliveryDate
                      PurchaseRequisitionItemText = &amp;lt;fs_req&amp;gt;-Purchaserequsitionitemtext ) ) ) )

          MAPPED   DATA(lt_mapped)
          FAILED   DATA(lt_failed)
          REPORTED DATA(lt_reported).

      IF lt_failed IS INITIAL.

        READ TABLE lt_mapped-purchaserequisition
        INDEX 1
        INTO DATA(ls_mapped_pr).

        IF sy-subrc = 0.

          APPEND VALUE #(
          pid = ls_mapped_pr-%pid
          cid = ls_mapped_pr-%cid
          req_uuid = &amp;lt;fs_req&amp;gt;-ReqUuid
          ) TO zbp_i_pr_request=&amp;gt;purchase_requisition_details.

        ENDIF.

        &amp;lt;fs_req&amp;gt;-Messagetype = 'S'.
        &amp;lt;fs_req&amp;gt;-Message = 'PR creation initiated successfully'.
      ELSE.
        &amp;lt;fs_req&amp;gt;-Messagetype = 'E'.
        &amp;lt;fs_req&amp;gt;-Message = 'Error occured while creating PR'.
      ENDIF.

      MODIFY ENTITIES OF zi_pr_request IN LOCAL MODE
          ENTITY PRReq
              UPDATE FIELDS ( Message Messagetype )
              WITH VALUE #( ( %tky        = &amp;lt;fs_req&amp;gt;-%tky
                         Message     = &amp;lt;fs_req&amp;gt;-Message
                         MessageType = &amp;lt;fs_req&amp;gt;-Messagetype ) ).

    ENDLOOP.
  ENDMETHOD.&lt;/LI-CODE&gt;&lt;P&gt;Save_modfied method&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;DATA: lt_pr_request_as TYPE STANDARD TABLE OF zpr_request.

IF create-prreq IS NOT INITIAL.
  lt_pr_request_as = CORRESPONDING #( create-prreq MAPPING FROM ENTITY ).
  INSERT zpr_request FROM TABLE &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638"&gt;@LT&lt;/a&gt;_pr_request_as.

  LOOP AT zbp_i_pr_request=&amp;gt;purchase_requisition_details INTO DATA(purchase_reqn_via_eml) WHERE  pid IS NOT INITIAL .
    CONVERT KEY OF i_purchaserequisitiontp FROM purchase_reqn_via_eml-pid TO DATA(ls_pr_key1).
    DATA(lv_pr) = condense( |{ ls_pr_key1-PurchaseRequisition ALPHA = OUT }| ).
    DATA(lv_message) = |PR Number { lv_pr } created successfully|.
    UPDATE zpr_request SET purchaserequisition = &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1419942"&gt;@LV&lt;/a&gt;_pr,
                           message = &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1419942"&gt;@LV&lt;/a&gt;_message
                           WHERE req_uuid = &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1870787"&gt;@Purchase&lt;/a&gt;_reqn_via_eml-req_uuid.
  ENDLOOP.
ENDIF.&lt;/LI-CODE&gt;&lt;P&gt;Now how can I adjust the PO creation logic? is it possible so?&lt;BR /&gt;&lt;BR /&gt;&lt;LI-PRODUCT title="ABAP RESTful Application Programming Model" id="7e44126e-7b27-471d-a379-df205a12b1ff"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;LI-PRODUCT title="ABAP Development" id="833755570260738661924709785639136"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;LI-PRODUCT title="SAP S/4HANA Cloud ABAP Environment" id="60907aa9-99e9-4d5d-9103-8b970e9bc0a4"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;LI-PRODUCT title="ABAP Cloud" id="9ada5ac7-3f77-49de-b5c9-9019df1d1e09"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;LI-PRODUCT title="SAP S/4HANA Cloud Public Edition" id="08e2a51b-1ce5-4367-8b33-4ae7e8b702e0"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2026 07:50:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaq-p/14497852</guid>
      <dc:creator>RITZZ</dc:creator>
      <dc:date>2026-10-06T07:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Managed RAP application to create PurchaseOrder</title>
      <link>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14498223#M4949748</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yes, it is possible. Your PR pattern (EML call in a determination on save, keep the %pid, CONVERT KEY in save_modified) works the same way for purchase orders with the released BO &lt;STRONG&gt;I_PurchaseOrderTP_2&lt;/STRONG&gt;. I checked the BDEFs on an S/4HANA 2025 system (read-only). Please compare them on your release.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What matters in the BDEF&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I_PurchaseOrderTP_2 is an interface over &lt;STRONG&gt;R_PurchaseOrderTP&lt;/STRONG&gt;: unmanaged, &lt;CODE&gt;strict ( 2 )&lt;/CODE&gt;, &lt;STRONG&gt;late numbering&lt;/STRONG&gt; on the root and on every child entity, no draft. So, like the PR, inside your determination you only get a %pid. The PO number only comes out via CONVERT KEY in your save phase.&lt;/LI&gt;&lt;LI&gt;The item cannot be created directly (&lt;CODE&gt;use create&lt;/CODE&gt; is commented out on the item). It can only be created through the association: &lt;CODE&gt;CREATE BY \_PurchaseOrderItem&lt;/CODE&gt;.&lt;/LI&gt;&lt;LI&gt;Mandatory fields from R_PurchaseOrderTP: &lt;STRONG&gt;PurchaseOrderType&lt;/STRONG&gt; and &lt;STRONG&gt;Supplier&lt;/STRONG&gt; on the header, &lt;STRONG&gt;Plant&lt;/STRONG&gt; on the item.&lt;/LI&gt;&lt;LI&gt;The item exposes &lt;STRONG&gt;PurchaseRequisition&lt;/STRONG&gt; and &lt;STRONG&gt;PurchaseRequisitionItem&lt;/STRONG&gt;, so you can create the PO with a reference to the PR you already created in the same app.&lt;/LI&gt;&lt;LI&gt;It is C1-released for ABAP Cloud on 2025. On your system, check the API State tab in ADT.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Sketch for the determination&lt;/STRONG&gt; (built from the BDEF, not executed):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MODIFY ENTITIES OF i_purchaseordertp_2
  ENTITY PurchaseOrder
    CREATE FIELDS ( PurchaseOrderType CompanyCode PurchasingOrganization
                    PurchasingGroup Supplier )
    WITH VALUE #( ( %cid                   = lv_cid_po_hdr
                    PurchaseOrderType      = 'NB'
                    CompanyCode            = lv_bukrs
                    PurchasingOrganization = lv_ekorg
                    PurchasingGroup        = &amp;lt;fs_req&amp;gt;-Purchasinggroup
                    Supplier               = &amp;lt;fs_req&amp;gt;-Supplier ) )
    CREATE BY \_PurchaseOrderItem
    FIELDS ( Material Plant OrderQuantity PurchaseOrderQuantityUnit
             PurchaseRequisition PurchaseRequisitionItem )
    WITH VALUE #( ( %cid_ref = lv_cid_po_hdr
                    %target  = VALUE #( ( %cid                    = lv_cid_po_item
                                          Material                = &amp;lt;fs_req&amp;gt;-Material
                                          Plant                   = &amp;lt;fs_req&amp;gt;-Plant
                                          OrderQuantity           = &amp;lt;fs_req&amp;gt;-Requestedquantity
                                          PurchaseOrderQuantityUnit = lv_unit
                                          PurchaseRequisition     = &amp;lt;fs_req&amp;gt;-Purchaserequisition
                                          PurchaseRequisitionItem = &amp;lt;fs_req&amp;gt;-Purchaserequisitionitem ) ) ) )
  MAPPED DATA(lt_po_mapped)
  FAILED DATA(lt_po_failed)
  REPORTED DATA(lt_po_reported).

" keep the ROOT %pid, not the item %pid
IF lt_po_failed IS INITIAL.
  APPEND VALUE #( pid      = lt_po_mapped-purchaseorder[ 1 ]-%pid
                  cid      = lv_cid_po_hdr
                  req_uuid = &amp;lt;fs_req&amp;gt;-ReqUuid ) TO zbp_i_pr_request=&amp;gt;purchase_order_details.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And in save_modified, same as your PR loop:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT zbp_i_pr_request=&amp;gt;purchase_order_details INTO DATA(ls_po) WHERE pid IS NOT INITIAL.
  CONVERT KEY OF i_purchaseordertp_2 FROM ls_po-pid TO DATA(ls_po_key).
  " ls_po_key-PurchaseOrder -&amp;gt; update your Z table (PO number + Supplier)
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Where it usually breaks&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Because R_PurchaseOrderTP is &lt;CODE&gt;strict ( 2 )&lt;/CODE&gt;, a contract violation in the calling code becomes a BEHAVIOR_CONTRACT_VIOLATION dump instead of a message. The reasons that apply here (texts from SNAPT):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;MISSING_CID&lt;/STRONG&gt;: every create needs a unique %cid. Use separate prefixes for PO header and item, as you did with PRHDR_ / PRITM_.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;CONVERT_KEY_NOT_MAPPED&lt;/STRONG&gt;: CONVERT KEY got a %pid that was never mapped to a final number. Typical causes: passing the item %pid to &lt;CODE&gt;CONVERT KEY OF i_purchaseordertp_2&lt;/CODE&gt;, or converting after the PO save failed.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;EMPTY_UPDATE&lt;/STRONG&gt;: if you later update the PO, each update record needs at least one non-key field flagged in %control.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Two more things to check:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;A missing mandatory field (PurchaseOrderType, Supplier, Plant) can show up as runtime error BEHAVIOR_MANDATORY_FIELD.&lt;/LI&gt;&lt;LI&gt;Authorization: the PO checks M_BEST_BSA, M_BEST_EKG, M_BEST_EKO and, on the item, M_BEST_WRK. Note that the API documentation (KTD) names them M_BST_*, which do not exist in TOBJ.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If it still fails, could you share the exact error: the runtime error name and the reason line from ST22, or the content of FAILED / REPORTED after the MODIFY? Then we can narrow it down.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2026 18:36:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14498223#M4949748</guid>
      <dc:creator>AlexandrePassarelli</dc:creator>
      <dc:date>2026-10-06T18:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Managed RAP application to create PurchaseOrder</title>
      <link>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14498495#M4949764</link>
      <description>Thanks for your answer. I am getting one issue. { "error": { "code": "06/275", "message": "Purchase requisition , item 00010, does not exist", "@SAP__common.longtextUrl": "../../../../default/iwbep/common/0001/T100Longtexts(MessageClass='06',MessageNumber='275',Variable1='',Variable2='00010',Variable3='',Variable4='')/Documentation", "@SAP__common.ExceptionCategory": "Provider_Application_Error", "details": [ { "code": "MEPO/001", "message": "Purchase order item 00010 still contains faulty schedule lines", "@SAP__common.Severity": "error", "@SAP__common.numericSeverity": 4 } ], "innererror": { "ErrorDetails": { "@SAP__common.Application": { "ComponentId": "BC-ESI-ESF-GW", "ServiceRepository": "SRVD", "ServiceId": "ZSD_PR_REQUEST", "ServiceVersion": "0001" }, "@SAP__common.TransactionId": "C83CB3D2A1420060E006AC128DB7C532", "@SAP__common.Timestamp": "20261007055004.275678", "@SAP__common.ErrorResolution": { "Analysis": "Use ADT feed reader \"SAP Gateway Error Log\" or run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details", "Note": "See SAP Note 1797736 for error analysis (&lt;A href="https://service.sap.com/sap/support/notes/1797736" target="_blank"&gt;https://service.sap.com/sap/support/notes/1797736&lt;/A&gt;)" } } } } }</description>
      <pubDate>Wed, 07 Oct 2026 05:53:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14498495#M4949764</guid>
      <dc:creator>RITZZ</dc:creator>
      <dc:date>2026-10-07T05:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Managed RAP application to create PurchaseOrder</title>
      <link>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14499059#M4949816</link>
      <description>&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1455401"&gt;@RITZZ&lt;/a&gt; thanks for testing. This one is on my sketch: it passed fs_req-Purchaserequisition, which is still empty at that point, so 06/275 ("Purchase requisition &amp;amp;, item &amp;amp;, does not exist") came with Variable1 empty. MEPO/001 is only a summary message; the real cause is the message before it. I checked the source on S/4HANA 2025 (read-only): a PO that references a PR created in the same save cannot work. (1) The PR number is only assigned in the PR's adjust_numbers. (2) The PO checks the reference with MEREQS_EBAN_LOOKUP, which reads EBAN from the database, where the PR only exists after COMMIT. (3) That check runs in the PO's finalize, before any adjust_numbers. What works: save the PR first, as today, then create the PO in a later request, e.g. an action on ZI_PR_REQUEST that reads the real PR number from your Z table (MODIFY ENTITIES OF i_purchaseordertp_2 is allowed there, COMMIT ENTITIES is not). With the reference, the schedule line takes the delivery date from the PR; without it, send a schedule line with date and quantity. Note: a failed EBAN lookup stays cached until MEREQS_REFRESH, and I_PurchaseRequisitionTP is not C1-released on 2025, so the PR part will not compile in ABAP Cloud.</description>
      <pubDate>Wed, 07 Oct 2026 19:39:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14499059#M4949816</guid>
      <dc:creator>AlexandrePassarelli</dc:creator>
      <dc:date>2026-10-07T19:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Managed RAP application to create PurchaseOrder</title>
      <link>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14499198#M4949829</link>
      <description>&lt;P&gt;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/2293967"&gt;@AlexandrePassarelli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting this error. My PurchaseOrderItem is getting failed. I am also sharing my code below.&lt;/P&gt;&lt;LI-CODE lang="json"&gt;{
  "error": {
    "code": "06/010",
    "message": "Document contains no items",
    "@SAP__common.ExceptionCategory": "Provider_Application_Error",
    "innererror": {
      "ErrorDetails": {
        "@SAP__common.Application": {
          "ComponentId": "BC-ESI-ESF-GW",
          "ServiceRepository": "SRVD",
          "ServiceId": "ZSD_PR_REQUEST",
          "ServiceVersion": "0001"
        },
        "@SAP__common.TransactionId": "C83CB3D2A1420010E006AC72303CC720",
        "@SAP__common.Timestamp": "20261008052329.186745",
        "@SAP__common.ErrorResolution": {
          "Analysis": "Use ADT feed reader \"SAP Gateway Error Log\" or run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details",
          "Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"
        }
      }
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Method CreatePOAuto&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;READ ENTITIES OF zi_po_request IN LOCAL MODE
        ENTITY POReq
            ALL FIELDS WITH CORRESPONDING #( keys )
        RESULT DATA(lt_request).
    LOOP AT lt_request ASSIGNING FIELD-SYMBOL(&amp;lt;fs_req&amp;gt;).

      IF &amp;lt;fs_req&amp;gt;-Purchaseorder IS NOT INITIAL.
        CONTINUE.   " Already processed
      ENDIF.
      DATA(lv_pr) = |{ &amp;lt;fs_req&amp;gt;-purchaserequisition ALPHA = OUT }|.
      SELECT SINGLE purchaserequisition, purchaserequisitionitem,
                     material, plant, requestedquantity, baseunitisocode
        FROM zpr_request
        WHERE purchaserequisition = @lv_pr
        INTO @DATA(ls_pr).
      IF sy-subrc &amp;lt;&amp;gt; 0.
        CONTINUE.
      ENDIF.

      DATA(lv_cid_hdr_po)  = |POHDR_{ sy-tabix }|.
      DATA(lv_cid_item_po) = |POITM_{ sy-tabix }|.
      MODIFY ENTITIES OF I_PurchaseOrderTP_2
          ENTITY PurchaseOrder
            CREATE
              FIELDS ( PurchaseOrderType CompanyCode PurchasingOrganization Supplier PurchasingGroup )
              WITH VALUE #(
                ( %cid                     = lv_cid_hdr_po
                  PurchaseOrderType        = 'NB'
                  CompanyCode              = '1710'
                  PurchasingOrganization   = '1710'
                  Supplier                 = '0017300002'
                  PurchasingGroup          = &amp;lt;fs_req&amp;gt;-Purchasinggroup ) )

            CREATE BY \_PurchaseOrderItem
              FIELDS ( PurchaseRequisition purchaserequisitionitem plant material
                       OrderQuantity PurchaseOrderQuantityUnit
                        )
              WITH VALUE #(
                ( %cid_ref = lv_cid_hdr_po
                  %target  = VALUE #(
                    ( %cid                       = lv_cid_item_po
                      PurchaseOrderItem          = '00002'
                      PurchaseRequisitionItem    = ls_pr-PurchaseRequisitionItem
                      OrderQuantity              = ls_pr-RequestedQuantity
                      PurchaseRequisition        = ls_pr-Purchaserequisition
                      PurchaseOrderQuantityUnit  = ls_pr-BaseUnitISOCode
                       ) ) ) )

          MAPPED   DATA(lt_po_mapped)
          FAILED   DATA(lt_po_failed)
          REPORTED DATA(lt_po_reported)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 08 Oct 2026 05:27:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14499198#M4949829</guid>
      <dc:creator>RITZZ</dc:creator>
      <dc:date>2026-10-08T05:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Managed RAP application to create PurchaseOrder</title>
      <link>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14499265#M4949840</link>
      <description>Issue has been solved. Thanks</description>
      <pubDate>Thu, 08 Oct 2026 07:14:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/managed-rap-application-to-create-purchaseorder/qaa-p/14499265#M4949840</guid>
      <dc:creator>RITZZ</dc:creator>
      <dc:date>2026-10-08T07:14:53Z</dc:date>
    </item>
  </channel>
</rss>

