09-04-2009 2:45 PM
Hello there,
I hope someone can give a hint on implementing an enhancement for transactions me221 and/or me22n.
The requirement is that while creating a PO, when the user presses ENTER after entering a specific material code on a line, another line should automatically be created with another material code.
Hope I have been clear.
Thanks in advace,
BR,
Tabrez
09-04-2009 3:23 PM
Hi,
I think you can do this by using teh BADI> ME_PROCESS_PO_CUST if you go to se18 and open this one up and go to sample code so you have some code there which will demostrate how you can get the existing records for the PO now inorder to update with one more line you can add to the line to the data that you get and then use the below code to set it back
CALL METHOD im_item->set_data( ls_mepoitem ).
Regards,
Himanshu
09-04-2009 4:46 PM
But will this method create a new item line or will it only change it ?
Thanks,
BR
09-05-2009 9:09 AM
When you get the data there would be what has been entered and then in the BADI you can replicate the line in that table or add the line and then set it back to screen.
Regards,
Himanshu
09-07-2009 11:43 AM
Hi Himanshu,
I was able to add the line using the PROCESS_ITEM method.
Now, I have another problem: it is creating 9 items automatically.
Do you have any clue why this is happening?
Thanks,
Tabrez
09-07-2009 11:59 AM
Hi,
Well why dont you put a debug point and see for your self probably you need to limit the addition when the save button is clicked or on some toehr condition right now every time the control is going into te method one line is getting added as per your code.
Regards,
Himanshu
09-07-2009 12:18 PM
OK...
Thanks a lot for the tips Himanshu. It really helpded.
BR,
Tabrez