05-23-2006 1:29 PM
Hi Friends,
I have implemented PROCESS_ITEM method of above mentioned BADI.
<b>My Requirement</b>: Check if price value in Purchase requisition is 0 , Then set FREE(mepoitem-umson) field to X.Basically , i am creating PO's from Purchase req's from ME59N.
COde inside method:
*Data Declarations
DATA: ls_mepoitem TYPE mepoitem,
ls_mepoitemx type mepoitemx,
ls_customer TYPE mepo_badi_exampl,
ls_tbsg TYPE tbsg.
INCLUDE mm_messages_mac. "useful macros for message handling
*here we get item data
ls_mepoitem = im_item->get_data( ).
*work area for price value
data : begin of it_eban,
banfn type mepoitem-banfn,
bnfpo type mepoitem-BNFPO,
pries type mepoitem-NETPR,
end of it_eban.
*Get the Purchase requisition price from EBAN table
select single banfn bnfpo preis from eban into it_eban
where
banfn = ls_mepoitem-banfn
and bnfpo = ls_mepoitem-bnfpo.
*if entry is available.
if sy-subrc eq 0.
*check if price is zero
if it_eban-pries EQ 0.
*if zero, set FREE field of PO to 'X'.
ls_mepoitem-umson = 'X'.
ls_mepoitemx-umson = 'X'.
endif.
endif.
But, it is not setting FREE field in PO line item to 'X'.
Please lemme know, if anymore coding is necessary to set FREE field to 'X' in Respective PO.
Regards.
santosh.
05-23-2006 2:23 PM
You need to set both ls_mepoitem and ls_mepoitemx using the method SET_DATA.You can then verify if the values have been set by calling the method GET_DATA.
Please reward helpful answers
Cheers
Nishanth
05-23-2006 1:59 PM
Hi,
Just by changing data of ls_mepoitem will not reflect in the transaction because you have to call method SET_DATA to do that.
CODE:
CALL METHOD im_item->set_data
EXPORTING
im_data = ls_mepoitem.
05-23-2006 2:31 PM
Hi Sharath,
Luckily i solved the problem before seeing the response.
But, i have to sincerely agree that,i was able to solve the same by using most of your previous post on the same issue.
you seem to be fundoo on this, especially on this BADI.
thanks again.
santosh.
05-23-2006 2:23 PM
You need to set both ls_mepoitem and ls_mepoitemx using the method SET_DATA.You can then verify if the values have been set by calling the method GET_DATA.
Please reward helpful answers
Cheers
Nishanth
07-11-2006 8:27 AM
Hi, i need urgent help on this enhancement as mentioned below.
This enhancement will be triggered whenever a Material quantity or volume is changed or a Material is added or deleted on a STO, the system will validate that the weight or the volume of the Order is within a min/max range of weight /volume for STOs between the Ordering and Delivering facilities. Default values are defined for truck weight, volume and number of pallets. Before saving the STO, a BADI/User exit will verify if the weight of the STO has been changed from the previously saved version of the order.
If so, the allowed ranges for weight on the STO will be retrieved from the standards table and compared to the weight on the STO. If either weight or volume is above the limit, it fails further processing. If it is below the limit, an error message will be flashed prompting user to authorize the change and save. The user must resolve the issue with the weight of the order before saving.
In SAP ECC, the Stock Transport Orders are created using the Purchase Order transactions (ME21N, ME22N & ME23N). There is a kernel BADI (ME_PROCESS_PO_CUST) available in the ME2*N transactions that will be used to code this enhancement.
If any one has code for this please mail to this id: james_v9@yahoo.co.in