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: 

help with badi

0 Kudos

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...

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

Commit the trasaction after calling the function module HR_INFOTYPE_OPERATION.

Regards,

Amit

uwe_schieferstein
Active Contributor
0 Kudos

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