0% found this document useful (0 votes)
29 views2 pages

'Po - Changes' 'Po - Changes' 'Z - STP - E022' 'BUS2012 - IT'

This document describes a method in ABAP code that checks a purchase order. The method calls a switch framework to get any enhancements, then calls an enhancement method if one is found. If a message is returned it loops through events and removes any matching a certain item type and text.

Uploaded by

Souju Bonthu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

'Po - Changes' 'Po - Changes' 'Z - STP - E022' 'BUS2012 - IT'

This document describes a method in ABAP code that checks a purchase order. The method calls a switch framework to get any enhancements, then calls an enhancement method if one is found. If a message is returned it loops through events and removes any matching a certain item type and text.

Uploaded by

Souju Bonthu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

METHOD if_ex_me_process_po_cust~check.

*&---------------------------------------------------------------------*
*& Class Name : ZCL_IM_BD_STP_E022_PO_CUST
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* Method Name : IF_EX_ME_PROCESS_PO_CUST~CHECK
* Author : Anupam Kumar Thakur
* Date : 09/23/2023
* Transport # : DS4K912196
*----------------------------------------------------------------------*
* Description: : Method to active the pop up for message
* on clicking on CHECK
*----------------------------------------------------------------------*
* MODIFICATION HISTORY
*----------------------------------------------------------------------*
* Transport | Charm No | Author ID | Date | Description *
*
*----------------------------------------------------------------------*
CONSTANTS : lc_method_name(40) TYPE c VALUE 'PO_CHANGES',
lc_program_name(40) TYPE c VALUE 'PO_CHANGES',
lc_switch_name(30) TYPE c VALUE 'Z_STP_E022',
lc_item TYPE swo_objtyp VALUE 'BUS2012_IT'.
DATA: lo_message TYPE REF TO cl_message_mm.

"calling switch framework to get enhancement


zcl_util_switch_framework=>get_enhancements(
EXPORTING
iv_prog_name = lc_program_name
iv_switch_name = lc_switch_name
IMPORTING
et_enhancements = DATA(lt_enhancement) ).

"Reading the fetched active class & method from switch framework
DATA(ls_enhancement) = VALUE #( lt_enhancement[ method = lc_method_name ]
OPTIONAL ).
IF ls_enhancement IS NOT INITIAL.
CALL METHOD (ls_enhancement-classname)=>(ls_enhancement-method)
EXPORTING
io_header = im_header
IMPORTING
eo_message = lo_message.

IF lo_message IS BOUND.
DATA(lo_handler) = lo_message->get_handler( ).
lo_handler->getlist( IMPORTING ex_events = DATA(lt_events) ).
LOOP AT lt_events ASSIGNING FIELD-SYMBOL(<lfs_event>).
DATA(ls_descr) = <lfs_event>-business_obj->describe( ).
<lfs_event>-event_obj->to_string( IMPORTING ex_string =
DATA(lv_event) ).
IF ls_descr-objtyp = lc_item
AND find( val = lv_event sub = TEXT-001 ) <> -1.
DATA(lo_bo) = <lfs_event>-business_obj.
lo_handler->remove_by_bo( EXPORTING im_business_obj = lo_bo
im_context = <lfs_event>-
context ).
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDMETHOD.

You might also like