09-03-2013 4:42 PM
I want to add PO approvers in custom tab of ME21N transaction. Number of approvers depend on company code and PO net amount. I have already added custom tab and approver list. I need the company code and PO net amount in the flow logic of custom tab. How would I get these values, these values can be dynamic.
Any help is greatly appreciated.
Thanks,
Vijay
09-03-2013 4:58 PM
Hi Vijay,
Did you try to use the standard PO realease strategy?, what you mention is possible to do through customizing.
Here are the steps in Ramachchanthiran's Document Multi Level Purchase Order Release Strategy
Best regards,
Alejandro López
09-03-2013 4:58 PM
Hi Vijay,
Did you try to use the standard PO realease strategy?, what you mention is possible to do through customizing.
Here are the steps in Ramachchanthiran's Document Multi Level Purchase Order Release Strategy
Best regards,
Alejandro López
09-03-2013 5:06 PM
You are right that's the better approach. This customer wants to add approvers when the PO is being created ( ME21N ). The number of approvers depends on the Company code and the net amount.
Thanks,
Vijay
09-03-2013 5:18 PM
Yes, You have at your disposal to make decisions (Strategy) all the fields of the structure CEEKKO (Communication Structure for External Purchasing documents)
09-03-2013 5:25 PM
You are saying the structure CEEKKO will have company code and net PO price and I should be able to read it in the PBO logic of the custom tab. Is this correct?
I will chekc it out.
Thanks,
Vijay
09-03-2013 5:44 PM
Hi Vijay,
The correct structure is CEKKO. When you make the customizing for PO release strategy, you have all the fields in the structure CEKKO to make decisions and choose a strategy. I refer CEKKO structure for customizing not for abap development.
For example, you can use the values of the fields Company Code, Order Type, Purchasing Group and Total net order value to create a strategy that requires the approval of one specfic person, if the value is greater than a specific value, the strategy requires two people for approval.
Best regards,
Alejandro López
09-03-2013 6:21 PM
You are talking about the release strategy and I am talking able a user(PO creator) should be able to pick approvers based on company code, amount or whoever he/she wants to pick. We both are tlaking different way of doing things. We do not want to use the release strategy.
Thanks,
Vijay
09-03-2013 6:46 PM
I understand you. I applied a similiar solution using the field Name of Requisitioner/Requester (AFNAM), then the user select a list of approvers (Example:HR position), fills the field with the selected one, and a release strategy is created when de Purchase order is saved.
The values for the field Requisioner are controled by the BADI ME_PROCESS_PO_CUST, method PROCESS_ITEM.
09-03-2013 7:05 PM
Do you have an example that you worked on? How I will be using BADI ME_PROCESS_PO_CUST in PBO?
Thanks,
Vijay
09-03-2013 10:16 PM
Hi Vijay,
This is an example, this validation is performed every time you change a position in PO:
METHOD if_ex_me_process_po_cust~process_item.
DATA: st_itemdata TYPE mepoitem,
st_headerdata TYPE mepoheader,
objheader TYPE REF TO if_purchase_order_mm. "Instace
* Get Header
CALL METHOD im_item->get_header
RECEIVING
re_header = objheader.
CALL METHOD objheader->get_data
RECEIVING
re_data = st_headerdata.
* Get Order type and cpmpare with Z table with order type order types allowed in the process
SELECT SINGLE bsart
INTO st_headerdata-bsart
FROM zmmt_0018
WHERE bsart = st_headerdata-bsart.
CHECK sy-subrc = 0.
* Get Item info
CALL METHOD im_item->get_data
RECEIVING
re_data = st_itemdata.
IF st_itemdata-afnam IS INITIAL.
*** Your custom code to validate
ENDIF.
ENDMETHOD.
Here is the declaration of the instance IM_ITEM
Hope this help you.
09-04-2013 4:57 AM
09-04-2013 1:21 PM
I never have invoked a Badi method from PBO. But i recommend you implement the BADI ME_PROCESS_PO_CUST in transaction SE19. You will see that method PROCESS_ITEM is executed for every change in Purchase order positions and is a similar behavior of PBO.
best regards,
Alejandro López.