03-28-2007 6:38 AM
Hi,
I am not comfortable with OOPS ABAP. But i have one requirement that i have to update the terms of payment text while create PO accordingly there we already created paymenttext through one tcode. Is any method to update the potexts.
Please let me know which BADI is useful to do this.
rgds
p. krishna prasad
03-28-2007 6:44 AM
Hi,
Check the Badi's
ME_PROCESS_PO_CUST
MB_CHECK_LINE_BADI
links for BADI:
http://help.sap.com/saphelp_nw04/helpdata/en/eb/3e7cf7940e11d295df0000e82de14a/frameset.htm
and
http://help.sap.com/saphelp_nw04/helpdata/en/eb/3e7cf7940e11d295df0000e82de14a/frameset.htm
reward if useful
regards,
Anji
03-28-2007 7:13 AM
Hi,
I think we have to implement this interface ME_PROCESS_PO_CUST.
and write the code in the PROCESS_HEADER method. But while writing this
method, how can i get the purchase order no that we are processing. can anybody give code snippet .
rgs
p. krishna prasad
03-28-2007 7:24 AM
Hi,
See the sample code:
BAdI Name: ZCHECK_PO_LINE_ITEM (Implementation name) PO Account assignment
Definition Name: ME_PROCESS_PO_CUST
Interface Name : IF_EX_ME_PROCESS_PO_CUST
Implementing Class: ZCL_IM_BADIN_ACCOUNT_ASSGN
Method : PROCESS_HEADER
************************************************************************
METHOD if_ex_me_process_po_cust~process_header .
DATA : re_data TYPE mepoheader.
*get the item data
CALL METHOD im_header->get_data
RECEIVING
re_data = re_data.
re_header = re_data.
IF ( re_data-bsart NE 'ZOC' AND re_data-bsart NE 'ZPC' ).
IF ( re_data-bsart <> 'ZIC' AND re_data-bsart <> 'UB' ).
IF re_data-bukrs NE '1001'.
MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'Use only Sipchem Company'
'Code for External Procurement'.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.
************************************************************************
Method : PROCESS_ITEM
************************************************************************
METHOD if_ex_me_process_po_cust~process_item .
DATA: v_menge TYPE bamng, " PR Quantity
v_statu. " PR Status
DATA : re_data TYPE mepoitem,
re_data1 TYPE mepoaccounting,
re_accountings TYPE purchase_order_accountings ,
header TYPE purchase_order_accounting.
*get the item data
CALL METHOD im_item->get_data
RECEIVING
re_data = re_data.
IF ( re_header-bsart NE 'ZOC' AND re_header-bsart NE 'ZPC' ).
IF re_header-bsart EQ 'ZRL'.
IF re_data-konnr EQ space.
MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'You cant create a Release order'
'without a reference to Outline Agreeement'.
ENDIF.
ENDIF.
IF ( re_data-banfn EQ space AND re_data-anfnr EQ space ).
MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'You can create a Purchase order'
'only with reference to a PR or RFQ'.
ENDIF.
IF re_data-knttp NE 'K' AND re_data-pstyp NE '9' .
IF syst-cprog EQ 'RM_MEPO_GUI'.
IF re_data-uebto IS NOT INITIAL OR
re_data-uebtk IS NOT INITIAL OR
re_data-untto IS NOT INITIAL.
MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'You cant change delivery settings'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.
reward if useful
regards,
Anji
03-28-2007 7:24 AM
Hi,
In the Process_header method, code like this.
Data: ls_mepoheader type mepoheader.
ls_mepoheader = im_header->get_data().
Now u can access all the variable through ls_mepoheader.
Hope this will help u.
Regards,
U. Uma
03-28-2007 7:45 AM