‎2010 Jun 18 8:15 PM
Hi all,
use an implementation of BADI ME_PROCESS_REQ_CUST in the MM-Purchase-Requisition, method IF_EX_ME_PROCESS_REQ_CUST~POST while save.
based on the line items available(USER ENTERED) i have to add few more line items based on the account assignment category and quantity while save.
How to create new line items (copying the existing line item and change the quantity ) and save the requestion with the additional line items. I used this code. while calling the method CRETE_ITEM create based on the object REF_ITEM in the MY_STATE.
the REF_ITEM object is Initial . so while creation the empty object is created.
kindly help to give tips/details to handle.
-
Coding:
data: l_item_list TYPE MMPUR_REQUISITION_ITEMS,
l_item TYPE MMPUR_REQUISITION_ITEM,
l_item_akt TYPE mereq_item,
l_item_ref TYPE ref to IF_PURCHASE_REQUISITION_ITEM.
l_item_list = im_header->get_items().
loop at l_item_list into l_item.
l_item_akt = l_item-item->get_data( ).
IF l_item_akt-MENGE > 1 AND
l_item_akt -KNTTP = 'A'.
DO l_item_akt -MENGE TIMES.
l_item-item= IM_HEADER->CREATE_ITEM( IM_ITEM = l_item-item).
INSERT l_item INTO TABLE IT_ITEMS_list.
%%%%% here i checked useing get data method i am not getting any data other than relesing procedure data.
I used SET_DATA method to set the data. even I am not getting data.
endloop.
-
(Debugging the code, I manage by doubleclicking while create Item method the fieldcontent of l_item (e.g ) to show the content of the class-attribute my_state. This works only if the field Interface in the Debugger is empty because then I see the attributes of the class. If the field Interface is filled with IF_PURCHASE_REQUISITION_ITEM, there arent any attributes shown.)
Thanks in advance for your kind help!!
Nicole
‎2010 Jun 21 8:14 PM