2008 May 15 7:43 AM
1.Business Logic
In PO creation stage to purchase Asset, users should put A in Account Assignment Category field (EKPO - KNTTP) then system will prompt them to put Asset Number in Item Account Assignment filed (MEACCT1000 ANLN1). After completing all required data, users will do data checking/ENTER, or perform PO posting. In order to avoid duplication system must provide alert mechanism to remain users that the Asset Number keyed in has been purchased. Performing that procedure system should able to compare Asset Number (MEACCT1000 ANLN1) keyed in against Asset Master where already purchased (ANEK EBELN).
If Asset Number capitalized, system responses pop up warning with message Asset has been Purchased, Do you want to continue? Then Button Yes or Cancel should be provided.(function module popup-to-confirm).
I followed the logic in method as:
Method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ACCOUNT.
DATA:S_DATA TYPE MEPOACCOUNTING,
S_ITEM TYPE REF TO IF_PURCHASE_ORDER_ITEM_MM,
S_HDR TYPE REF TO IF_PURCHASE_ORDER_MM,
S_HDATA TYPE MEPOHEADER,
S_IDATA TYPE MEPOITEM.
s_data = im_account->get_data( ).
s_item = im_account->get_item( ).
s_idata = s_item->get_data( ).
s_hdr = s_item->get_header( ).
s_hdata = s_hdr->get_data( )
for futher can u please help in coding.
endmethod.
Thanks&Regards,
sree.
2008 May 15 8:02 AM
Hi,
Instead of using Process_account method beter use process_item method. it will trigger in all line item of PO.
U can check as given below exp code...
DATA:
ls_header TYPE mepoheader,
lv_pur_ord TYPE REF TO if_purchase_order_mm,
lv_gl_ac TYPE mepoitem,
lv_sakto TYPE sakto.
lv_pur_ord = im_item->get_header( ).
ls_header = lv_pur_ord->get_data( ).
lv_gl_ac = im_item->get_data( ). " Item data
IF lv_gl_ac-knttp NE 'Y'.
MESSAGE e002(zmm_msg).
ENDIF.
for duplicate asset check u have to follow bellow code.
select single ALNL1 from ANEk where ALNL1 = lv_gl_ac-alnl1 .
if sy-subrc = 0.
call function pop_pu_to_confirm FM.
if not FM return value is ' YES'
popup error message........
endif.
endif.
By
Gupta
1.Business Logic
In PO creation stage to purchase Asset, users should put A in Account Assignment Category field (EKPO - KNTTP) then system will prompt them to put Asset Number in Item Account Assignment filed (MEACCT1000 ANLN1). After completing all required data, users will do data checking/ENTER, or perform PO posting. In order to avoid duplication system must provide alert mechanism to remain users that the Asset Number keyed in has been purchased. Performing that procedure system should able to compare Asset Number (MEACCT1000 ANLN1) keyed in against Asset Master where already purchased (ANEK EBELN).
If Asset Number capitalized, system responses pop up warning with message Asset has been Purchased, Do you want to continue? Then Button Yes or Cancel should be provided.(function module popup-to-confirm).
I followed the logic in method as:
Method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ACCOUNT.
DATA:S_DATA TYPE MEPOACCOUNTING,
S_ITEM TYPE REF TO IF_PURCHASE_ORDER_ITEM_MM,
S_HDR TYPE REF TO IF_PURCHASE_ORDER_MM,
S_HDATA TYPE MEPOHEADER,
S_IDATA TYPE MEPOITEM.
s_data = im_account->get_data( ).
s_item = im_account->get_item( ).
s_idata = s_item->get_data( ).
s_hdr = s_item->get_header( ).
s_hdata = s_hdr->get_data( )
for futher can u please help in coding.
endmethod.
Thanks&Regards,
sree.
2008 May 15 8:02 AM
Hi,
Instead of using Process_account method beter use process_item method. it will trigger in all line item of PO.
U can check as given below exp code...
DATA:
ls_header TYPE mepoheader,
lv_pur_ord TYPE REF TO if_purchase_order_mm,
lv_gl_ac TYPE mepoitem,
lv_sakto TYPE sakto.
lv_pur_ord = im_item->get_header( ).
ls_header = lv_pur_ord->get_data( ).
lv_gl_ac = im_item->get_data( ). " Item data
IF lv_gl_ac-knttp NE 'Y'.
MESSAGE e002(zmm_msg).
ENDIF.
for duplicate asset check u have to follow bellow code.
select single ALNL1 from ANEk where ALNL1 = lv_gl_ac-alnl1 .
if sy-subrc = 0.
call function pop_pu_to_confirm FM.
if not FM return value is ' YES'
popup error message........
endif.
endif.
By
Gupta
2008 May 22 7:33 AM
2008 May 22 12:50 PM
Hi,
Your problem get solved please close this thread. reward.
By
Gupta