2011 Jun 06 5:49 PM
Hello Experts,
I need to populate Meter reads for some orders.
I can see one exit: EDMMR001 for this? Can i use this? The component is : EXIT_SAPLEL01_010
If not can someone suggets me the relevant user exit/ BADI's for the same.
Please suggest.
Thanks
Ricky
2011 Jun 07 8:00 PM
Hi Avinash,
Thanks for the clarification. I got it now.
@ Ricky - Since you will be creating Meter reading order and upload the meter reading at the same time and you are going for enhancement, just as an alternative solution you can do the custom code to solve all these together.
You can create a custom screen similar like EL01 and pass the installation number, meter reading date, meter reading reason etc. and internally you can call the steps I mentioned in my earlier message.
It will do everything from creating the meter reading order to upload meter reading.
Please let me know if it helps.
Thanks.
Nirmalya
2011 Jun 06 6:08 PM
Hi Ricky,
Which orders are we considering - Service Order / Maintenance Order or Meter Reading Orders?
Request you to elaborate your requirements please.
Thanks.
Regards,
Avinash
2011 Jun 06 7:17 PM
Hi Avinash,
Its Meter Reading Orders.
I need to post the reads when the MR order is being generated,.
Thanks
Ricky
2011 Jun 06 7:40 PM
Hi Ricky,
Here are two alternatives:
Option 1:
The moment a meter reading order is generated, then workflow event - "MTRREADDOC-Created" is published. You can have a check function module when such event is published (I am assuming that you want to upload reads only in specific cases and not always). Develop one custom method to upload meter reading against meter reading order using method "MTRREADDOC-Upload" (function module - BAPI_MTRREADDOC_UPLOAD).
Option 2:
Since there will be many meter reading orders generated in system (periodic meter reading orders), you may face performance issues with standard event. So, create a custom workflow event and publish when your condition fulfills (This is logic you can code it in user exit EXIT_SAPLEL01_010 (Enhancement - EDMMR001). The moment your custom event is published, you can upload meter reading using method "MTRREADDOC-Upload" (function module - BAPI_MTRREADDOC_UPLOAD).
PS: You may also try to update EABL values in user exit - EXIT_SAPLEL01_010, but if we do not implement logic properly, meter readings may be inconsistent. If you use standard way of uploading reads, then we will have more control on the logic. (Also, I am not sure, if validations will trigger in this case).
Please let me know if you need any further details.
Regards,
Avinash
2011 Jun 07 12:27 AM
Avinash Reddy :
Let me say it again : I need a way to update MR results along with the "Execute Order Creation" ( along with running EL01) as can be seen in EL31.
Example : I need to see the Meter reads in field EABL-V_ZWSTAND, EABL-V_ZWSTNDAB..etc
I am using the BAPI_MTRREADDOC_UPLOAD with the document # (ABLBELNR). But its throwing an error saying that the doc# is not available.
I am using this BAPI in EXIT_SAPLEL01_010. But the table EABL is not upated physically with the new doc # ABLBELNR at this point.
I am trying with other badis :ISU_ZWIABRECH_EINZUG , ISU_MR_EABL_UPD..etc with no result.
Is there any other EXIT / BADI ..etc
Pls suggest
Thanks
Ricky
2011 Jun 07 5:50 AM
Hi Ricky,
Since user exit EXIT_SAPLEL01_010 is triggered before actual save (commit to database), you cannot use BAPI_MTRREADDOC_UPLOAD directly. This was one of the reason, why it was suggested to raise an event and then proceed with meter reading upload (after successful creation of meter reading order). Another reason was that we do not have post-save exit available for meter read order creation.
Alternatively, you can directly modify EABL table entries EXIT_SAPLEL01_010 (with status = 1, assign values to pre-decimal, post-decimal, relevant meter reading dates). However, you need to be very cautious about this approach.
Regards,
Avinash
2011 Jun 07 3:09 PM
Avinash,
You said " you can directly modify EABL table entries EXIT_SAPLEL01_010 ". You mean i can use Insert, update stmts directly to EABL inside this exit?
Pls suggest.
thanks
Ricky
2011 Jun 07 3:26 PM
Hi Ricky,
Why do you want to enhance EL01 to create orders & upload the reading.
SAP provides EL28 to do the same thing. Please let me know your exact requirement.
2011 Jun 07 3:58 PM
Hi vikrant guptarya
I need to update MR results along with the "Execute Order Creation" ( along with running EL01) as can be seen in EL31.
Example : I need to see the Meter reads in field EABL-V_ZWSTAND, EABL-V_ZWSTNDAB..etc in EABL.
Thanks
Ricky
2011 Jun 07 4:56 PM
Hi Ricky,
Please carry out the following steps:
1. Call FM 'ISU_S_METERREAD_CREATE' by passing appropriate installation number (X_ANLAGE), X_ADATSOLL , X_ZUORDDAT and X_ABLESGR (meter read reason) to create the Meter reading order.
2. Call 'BAPI_MTRREADDOC_GETLIST' passing installation number (INSTALLATION), MRDATEFROM, MRDATETO, MRREASON, and MRDOCUMENTTYPE as '1'. Now get meter document data into MRDOCUMENTDATA structure. Please use the same installation, meter reading date, meter reading reason which you have used in the earlier step to create meter reading order.
3. Call 'BAPI_MTRREADDOC_UPLOAD' to upload the Meter reading. You need to populate the structure METERREADINGRESULTS. From the earlier step you will get the MR Order from MRDOCUMENTDATA-MRIDNUMBER field. You also need to pupulate the meter read date and meter reading to populate METERREADINGRESULTS structure. You will get the return messages in RETURN structure.
4. Call FM 'BAPI_TRANSACTION_COMMIT' to update it in database.
Hope this will help to meet your requirement.
Thanks.
Nirmalya
Edited by: NirmalyaC on Jun 7, 2011 6:01 PM
2011 Jun 07 5:10 PM
Hi Nirmalya,
Ricky wants to update meter reading value during meter reading order creation using EL01. The logic suggested by you will create additional meter reading order.
Hi Ricky,
In function module EXIT_SAPLEL01_010, you have table parameters TXY_EABLG & TXY_EABL. You can update the meteter result value in TXY_EABL with status and relevant dates.
Please try this option. Else we may need to use workflow options.
Regards,
Avinash
2011 Jun 07 8:00 PM
Hi Avinash,
Thanks for the clarification. I got it now.
@ Ricky - Since you will be creating Meter reading order and upload the meter reading at the same time and you are going for enhancement, just as an alternative solution you can do the custom code to solve all these together.
You can create a custom screen similar like EL01 and pass the installation number, meter reading date, meter reading reason etc. and internally you can call the steps I mentioned in my earlier message.
It will do everything from creating the meter reading order to upload meter reading.
Please let me know if it helps.
Thanks.
Nirmalya
2011 Jun 10 3:17 PM
Another option is that you can use implicit enhancements at the end of the FM: isu_s_meterread_create . You can create a z version of the enhancemnt & trigger the BAPI_MTRREADDOC_UPLOAD.
thanks