Create PO ME21N
Create PO ME21N
code ME21N
2. Enter Vendor
13. To check Net Price go to "condition" tab. Notice the relation of the price
Enhancement of ME21N/ME22n:
1. I have a requirement where I need to make the material PO text in ME21N / ME22N obligatory
for all items in some types of POs. Also, this text must not be changed after saving the PO.
2. how can we know in the method post of the BADI ME_PROCESS_PO_CUST if we are in creation
mode (me21n) or change mode (me22n), I need to do some coding only at the creation of the
PO but this method is call anytime we click save!
It would be possible to check the transaction. However, if the BAPI BAPI_PO_CREATE is used the BAdI is
also processed yet the transaction is most likely wrong.
METHOD if_ex_me_process_po_cust~open.
* define local data
DATA:
lo_po TYPE REF TO cl_po_header_handle_mm,
ls_header TYPE mepoheader.
I would add an instance attribute MD_TRTYP to the BAdI implementing class and save the transaction
type in method IF_EX_ME_PROCESS_PO_CUST~OPEN (see above). Now you can simply add the
following IF condition to your POST method:
METHOD if_ex_me_process_po_cust~open.
CASE me->md_trtyp.
WHEN 'H'. " add new purchase order
... " do required action for CREATE
WHEN ... .
WHEN others.
...
ENDCASE.
...
1. The possible transaction types can be found at: im_trtyp -> data element -> domain (fixed
values).
2. Since BAdI interface usually do not have that many methods I usually "browse" through all
methods and their parameters to get an idea about the function of the methods (because, sadly
enough, they are poorly documented).
3. face the same problem as I need to have some logic implemented in the close method if it is a
create PO action. When I try your coding in METHOD if_ex_me_process_po_cust~open.
me->md_trtyp = im_trtyp.
I get 'Field "MD_TRTYP" is unknown. It is neither in one of the specified tables nor defined by a
"DATA" statement. Besides, I would like to ask if I can declare a global variable to be shared
within the different methods in the BADI ME_PROCESS_PO_CUST.
4. I have defined MD_TRTYP (most like of TYPE trtyp) as private instance attribute of the class
implementing the BAdI interface. This way the transaction type is available in all methods of the
BAdI.