11-24-2007 7:14 AM
Is it a good idea to use function modules in badi custom code
i am trying to modify one of the infotype records (0004) using badi but the field is not getting updated , im using func mod HR_INFOTYPE_OPERATION.
Can u suggest any alternatives?? Help will be much appreciated...
11-24-2007 8:07 PM
Hello Vinay
Unfortunately you did not reveal the most important detail for answering your question:
Which BAdI are you using?
Assuming that you perhaps use BAdI <b>HRPAD00INFTY</b> (<i>Update / Infotype maintenance</i>) then you can see from the signature of the interface methods (IF_EX_HRPAD00INFTY; on ECC 5.0) that none of them is intended for changing current data of the transaction. On the contrary, all method parameters are IMPORTING parameters and are called BY VALUE. Thus, no changes of the parameters within the interface methods will be transmitted to the caller.
Method IF_EX_HRPAD00INFTY~AFTER_INPUT is the only method having an exception which implies that this method can be used to perform checks (compare PBO vs. PAI data) and reject changes by raising the exception.
Final remark:
It is complete nonsense to commit work <b>within </b>a BAdI because the BAdI is called within a transaction which should be properly committed at the end of the transaction.
Regards
Uwe
11-24-2007 10:21 AM
Commit the trasaction after calling the function module HR_INFOTYPE_OPERATION.
Regards,
Amit
11-24-2007 8:07 PM
Hello Vinay
Unfortunately you did not reveal the most important detail for answering your question:
Which BAdI are you using?
Assuming that you perhaps use BAdI <b>HRPAD00INFTY</b> (<i>Update / Infotype maintenance</i>) then you can see from the signature of the interface methods (IF_EX_HRPAD00INFTY; on ECC 5.0) that none of them is intended for changing current data of the transaction. On the contrary, all method parameters are IMPORTING parameters and are called BY VALUE. Thus, no changes of the parameters within the interface methods will be transmitted to the caller.
Method IF_EX_HRPAD00INFTY~AFTER_INPUT is the only method having an exception which implies that this method can be used to perform checks (compare PBO vs. PAI data) and reject changes by raising the exception.
Final remark:
It is complete nonsense to commit work <b>within </b>a BAdI because the BAdI is called within a transaction which should be properly committed at the end of the transaction.
Regards
Uwe