‎2011 Aug 02 7:36 AM
Hello experts,
I have a query related to enhancing a function module. I am doing phase confirmation of process orders using the BAPI 'BAPI_PROCORDCONF_CREATE_TT' in a module pool program(Z program). I have added few z fields to AFRU. Now i need to enhance the bapi 'BAPI_PROCORDCONF_CREATE_TT' so that the z fields are updated in AFRU. In this bapi i see a function module MAP2I_PI_TIMETICKET_TO_AFRUD in which the z fields can be moved to afrud using an implicit enhancement. But the problem is that the function module MAP2I_PI_TIMETICKET_TO_AFRUD is auto generated and there is a comment in the fm saying 'Dont Change it Manually!!'. Now i need to know how is this function module generated or is there any other way to do phase confirmation of process orders. Pls Help.
Regards,
Ramanan R.S.
‎2011 Aug 02 9:15 AM
Hello,
I think you can enhance this Function Module MAP2I_PI_TIMETICKET_TO_AFRUD by creating an implicit enhancement Implementation and add the Z-Fields of yours at the end which will not have any impact on the generated code.
Hope this helps.
Regards,
Venkata Phani Prasad K
‎2011 Aug 02 10:32 AM
Hi
I think you can enhance the function module , as implicit enhancement does not effect SAP standard . We are not changing the SAP standard, it falls into custom development.
Regards
Pawan
‎2011 Aug 02 10:35 AM
well you CAN enhance it.
But once done, save what you got, since when it get generated again, your work will be lost.
‎2011 Aug 02 1:08 PM
Hi Florian,
I thought the implicit enhancement were kept even when its hooked object is deleted (as they are independant, they are hooked only at runtime), so I did a test with BDBS to be sure, and it's still there (I use 7.0 sp 13)
BR
Sandra
‎2011 Aug 03 4:40 AM
Hi Sandra rossi,
Thanks for the helpful response. Can you give me some more explanation on how you checked it?
Thanks in advance.
Regards,
Ramanan R.S.
‎2011 Aug 03 9:04 AM
Hi Ramanan R.S.,
Function modules MAP2I* and MAP2E* are generated via BDBS transaction.
As your function module is named MAP2I_PI_TIMETICKET_TO_AFRUD, it means that there's a transfer from external to internal (because of MAP2I), and from PI_TIMETICKET structure to AFRUD structure.
But I don't recommend that you work with this one. Create your own MAP2I function module. From BAPIRET2 to BAPIRETURN for instance if you're lazy like me. Store it in your own Z function group, local package.
Before regenerating, you have to look at what was the initial mapping, as it is not stored in a database table, only in the source code. Moreover, it's possible that there were some manual changes before, so they have to be applied manually, so that means a modification of standard if you had worked on a standard one. Copying the MAP2I function module to a Z one before deleting is a very good idea!
- Create your implicit enhancement. Test it.
- In BDBS, you enter transfer from external to internal, plus these 2 names in BDBS, click Generate button.
- It says "already exists", so you have to click the Delete button
- There could be a popup "is still used", click Delete to confirm
- It proposes a default mapping between fields, that can be different from what was previously done.
- That will regenerate the function module (you can make sure by looking at its timestamp).
- Test it again, you'll see that your implicit enhancement is still there.
I admit it doesn't test the situation of a true upgrade, and I don't know any documentation that confirms that the deletion of generated repository object doesn't impact its implicit enhancement. Feedbacks welcome...
BR
Sandra