in order to make everything simple, it just contains order id and header text. This is the structure of purchase order header. This is the place define the event message structure. Use tcode WE81 to create the message type Itself doen’t contain any structure information. The message type is a virtune entity used by the framework. The event information will not be transfered via the parameter. There is no need add any parameters to the event. Class EventĬreate an event with name on_create. Method BI_PERSISTENT~LPOR METHOD bi_persistent~lpor.įor rest of methods, just activate them with empty source code. Result = NEW zcl_purchase_order( lv_order ).ĥ. Method BI_PERSISTENT~FIND_BY_LPOR METHOD bi_persistent~find_by_lpor.ĭATA(lv_order) = CONV ebeln( lpor-instid(10) ). SPLIT lv_class_name+1 AT '=' INTO TABLE DATA(lt_class_name).Ĥ.
#PURCHASE ORDERS SAP CODE#
With following source code inside METHOD constructor.ĭATA(lv_class_name) = cl_abap_classdescr=>get_class_name( me ). Once the interface has been added, there will few methods inherited from the interface. Since the class is for purchase order, the key should be with type EKKO-EBELN The class should inherit interface IT_WORKFLOWĪdd two attributes to the class as below.
If you are familar with the business workflow via ABAP OO, you can ignore this part. The implementation steps are exactly the same. The class should be compatible with SAP business workflow. Different from all of the relevant blog posts using BOR object, the ABAP OO object will be used to raise the event. In the example below, a purchase order create event is going to raised from S/4 hana. If above steps have not been done, please check the details steps in Fiona’s blog post Implement Steps
#PURCHASE ORDERS SAP HOW TO#
Please go through the rest of section for how to implement it via the framework. Whereas in most cases, the event message will be in deep structure rather than a flat structure. I have get lots of helps from Zhang, Fiona’s blog post on how to push Data Event from S4 into Event Mesh. In the document, the component “SAP Netweaver Addon for Event Enablement” will be used. SAP has provided two native components “Enterprise Event Enablement” and “SAP Netweaver Addon for Event Enablement”.