02-18-2013 7:41 AM
Can anyone guide me how to use this FM please.
I am writing this code inside BAdi MB_DOCUMENT_BADI , method MB_DOCUMENT_UPDATE.
This is how i am populating.
select single * from eina into eina_o where matnr = '000000000000600464' and lifnr = '0000200126' .
if sy-subrc = 0 .
select single * from eine into eine_o where infnr = eina_o-infnr and werks = '3110' .
endif .
eina_i = eina_o .
eine_i = eine_o .
eine_o-netpr = 13 .
eine_o-effpr = 13 .
call function 'ME_UPDATE_INFORECORD' IN UPDATE TASK
exporting
xeina = eina_o
xeine = eine_o
yeina = eina_i
yeine = eine_i
reg_eina = eina_o
.
Can anyone see the problem here?
After running, i enter the relevant data in ME12 then get msg No purchasing organization data exists. Thus my requirement is unsuccessful.
02-20-2013 4:45 AM
02-18-2013 8:14 AM
Hi,
have you tried to add a comit work and wait ?
I have used this code (but not in update task)
PERFORM retail_reference_site_select(sapmm06i)
TABLES it_eine1
USING is_eina-infnr.
CALL FUNCTION 'ME_DIRECT_INPUT_INFORECORD'
EXPORTING
i_eina = is_eina
i_eine = is_eine2
i_no_suppose = 'X'
i_vorga = 'A'
IMPORTING
e_eina = is_eina2
EXCEPTIONS
OTHERS = 2.
CALL FUNCTION 'ME_POST_INFORECORD'
TABLES
t_eina_i = it_eina.
COMMIT WORK AND WAIT.
Fred
02-18-2013 8:29 AM
Hii,
Yes i used commit work but got this runtime error.
Calling a COMMIT WORK in an update process is not allowed
because the function modules triggered in a Logical Unit
of Work cannot then be processed correctly.
02-20-2013 9:53 AM
I think the calling program have Commit work statement all ready, keep it in mind, don't use commit work in the enhancement.
02-20-2013 4:45 AM
02-20-2013 5:08 AM
02-20-2013 6:23 AM
Hii Kumar,
well i had a look but didnt notice anything... what should i watch out for in debugging?
I just need to update the price in info record. Would appreciate your help.
02-20-2013 6:35 AM
Well, you should watch out for whether the tables ME_UPDATE_INFORECORD is supposed to update are getting updated or not. I guess that would be subroutines EINA_HINZUFUEGEN, EINA_AENDERN, EINE_HINZUFUEGEN and EINE_AENDERN.
02-20-2013 7:20 AM
Hiii Kumar,
The table EINE is updated with the new price for the relevant info record number.
However in ME12 i cannot view the price. I get the message 'No purchasing organization data exists'
I think maybe i need to do something else in addition to using this FM? But i have no idea what or how to.
Appreciate your feedback.
02-20-2013 7:44 AM
What is the data you are entering in ME12 initial screen? If you are entering a purchase organization, did you check if it actually exists in the system?
02-20-2013 9:12 AM
Hii Kumar,
Yes the purchase organization i enter exists. And it goes to the 2nd screen too. But the three tabs thats usually there on top, 'Purch Org Data 1' , 'Condition' and 'Texts' is not there
02-20-2013 10:05 AM
I think I found it. I think you are getting the error (and see the other buttons missing in the second screen) because the info record (in table EINE) does not have your purchase organization (field EKORG) maintained in it.
02-20-2013 11:03 AM
Hi Kumar,
sorry to dissapoint you but I checked and it is maintained... perhaps for certain materials it is like this? I dont understand. I updated for one which already displays the tabs and it works fine.
02-20-2013 1:56 PM
No problem, I am not disappointed yet. I tried to simulate a similar scenario in my system and in my case the error was coming due to the reason I mentioned in my last response. I would propose you do the same thing - debugging - to find out the reason for the error message. You can simply do a /h and set a dynamic breakpoint at MESSAGE statement and you should be good to go.
02-21-2013 6:16 AM
Thank you Kumar, I think its because some values though (Puch Org and other main values have been maintained) have not been maintained.
Very much appreciate the support.