Advertising:
Create and cancel operation for goods receipt purchase order with Behavior Definition/Implementation I MATERIALDOCUMENTTP: Difference between revisions
From SAP Knowledge Base
(Created page with "=== Create goods receipt for purchase order === * CRUD_operations_to_create_goods_receipt_for_purchase_order_with_Behavior_Definition/Implementation_R_MATERIALDOCUMENTTP#Create_goods_receipt_for_purchase_order === Cancel for goods receipt for purchase order === <syntaxhighlight line copy> MODIFY ENTITIES OF I_MaterialDocumentTP ENTITY MaterialDocumentItem EXECUTE Cancel FROM VALUE #( ( MaterialDocument = keys[ 1 ]-PurchasingHi...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Behavior_Definitions_and_Implementations]] | |||
After reading this wiki entry, you should able to do operations Create and Cancel for purchase order goods receipt.<br /> | |||
<br />This is done by Entity Manipulation Language (EML) | |||
* https://learning.sap.com/learning-journeys/acquire-core-abap-skills/using-the-entity-manipulation-language_b378f225-0471-45bf-8b7a-f48d00e1bccb | |||
=== Create goods receipt for purchase order === | === Create goods receipt for purchase order === | ||
* [[ | * [[Create_and_cancel_operation_for_goods_receipt_purchase_order_with_Behavior_Definition/Implementation_R_MATERIALDOCUMENTTP#Create_goods_receipt_for_purchase_order]] | ||
=== Cancel for goods receipt for purchase order === | === Cancel for goods receipt for purchase order === | ||
<syntaxhighlight line copy> | <syntaxhighlight line copy> |
Latest revision as of 13:56, 3 June 2025
After reading this wiki entry, you should able to do operations Create and Cancel for purchase order goods receipt.
This is done by Entity Manipulation Language (EML)
Create goods receipt for purchase order
Cancel for goods receipt for purchase order
MODIFY ENTITIES OF I_MaterialDocumentTP
ENTITY MaterialDocumentItem
EXECUTE Cancel
FROM VALUE #( ( MaterialDocument = keys[ 1 ]-PurchasingHistoryDocument
MaterialDocumentItem = keys[ 1 ]-PurchasingHistoryDocumentItem
MaterialDocumentYear = keys[ 1 ]-PurchasingHistoryDocumentYear ) )
REPORTED DATA(reported)
FAILED DATA(failed).
IF failed IS INITIAL.
APPEND VALUE #( %msg = new_message( id = ycl_p2p_prmonitor_constants=>cv_message_class
number = '092'
severity = if_abap_behv_message=>severity-success
v1 = '' ) )
TO reported-stohistory.
ELSE.
IF reported-MaterialDocument IS NOT INITIAL.
APPEND VALUE #( %msg = new_message_with_text(
severity = reported-MaterialDocument[ 1 ]-%msg->m_severity
text = reported-MaterialDocument[ 1 ]-%msg->if_message~get_text( ) ) )
TO reported-poitemhistory.
ENDIF.
IF reported-MaterialDocumentItem IS NOT INITIAL.
APPEND VALUE #( %msg = new_message_with_text(
severity = reported-MaterialDocumentItem[ 1 ]-%msg->m_severity
text = reported-MaterialDocumentItem[ 1 ]-%msg->if_message~get_text( ) ) )
TO reported-poitemhistory.
ENDIF.
IF reported-materialdocumentitemserialno IS NOT INITIAL.
APPEND VALUE #(
%msg = new_message_with_text(
severity = ls_reported-materialdocumentitemserialno[ 1 ]-%msg->m_severity
text = ls_reported-materialdocumentitemserialno[ 1 ]-%msg->if_message~get_text( ) ) )
TO reported-poitemhistory.
ENDIF.
APPEND VALUE #( PurchaseOrder = keys[ 1 ]-PurchaseOrder
PurchaseOrderItem = keys[ 1 ]-PurchaseOrder
PurchasingHistoryDocument = keys[ 1 ]-PurchasingHistoryDocument
PurchasingHistoryDocumentItem = keys[ 1 ]-PurchasingHistoryDocumentItem
PurchasingHistoryDocumentYear = keys[ 1 ]-PurchasingHistoryDocumentYear )
TO failed-poitemhistory.
ENDIF.