Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FM ME_UPDATE_INFORECORD not updating my info record in ME12

Former Member
0 Kudos

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.





1 ACCEPTED SOLUTION

Former Member

Can anyone please help me out here? Any thoughts?

14 REPLIES 14

FredericGirod
Active Contributor
0 Kudos

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

0 Kudos

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.

0 Kudos

I think the calling program have Commit work statement all ready, keep it in mind, don't use commit work in the enhancement.

Former Member

Can anyone please help me out here? Any thoughts?

0 Kudos

Hi Anushka,

Did you try debugging the update function module?

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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?

0 Kudos

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

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.