cancel
Showing results for 
Search instead for 
Did you mean: 

Error "Type conflict with Assign in program" on Action Validation - SubmitForApproval script

solene_roques
Participant

Hello all,

I would like to prevent the submit for Approval script on time sheet. To do so, I am using the Action Validation - SubmitForAppoval script on the EmployeeTime BO. However, I face the following error message "Type conflict with ASSIGN in program" each time I try to use a "return false" code line. To analyse the issue, I reduced the code at the minimum :

import ABSL;

return false;

For example :

I understood that this issue is generally due to a mismatch of type, however, there is no type on this script....

Can anyone help me please ?

Thanks,

Best regards

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member206060
Contributor

Hello Solène,

This interface method has importing parameter of type TIM_EMP_TIM_VAL_CHK which in turn consists of Employee Time ROOT UUID, Action Name and Recording View type code as input parameters. These parameters will be passed from the standard SAP code to the BADI implementation whenever any action will be called on the employee’s working time confirmations.

In the BADI implementation, if you need to check for the Action name that is existing on the ROOT node of the TIMX_EMPLOYEE_TIME BO (if the implemented code needs to be executed for some specific actions(in this case SUBMIT_FOR_APPROVAL) and then retrieve the ROOT and ITEM node data of TIMX_EMPLOYEE_TIME business object with the help of received Root Node UUID.

After data retrieval, the conditions need to be put to validate the entered/saved time durations. If the requirement is to raise an error message only from the ESS time sheet, then the recording view type code can be checked in the retrieved ITEM data of the BO. The error message which needs to be raised can be logged into the CHANGING parameter of the interface which in turn consists of some attributes with regards to the error message like BADI implementation name, error occurred (Yes/No), message severity, error message text etc.
The SAP standard code will take care of the error handling and the error message which is received from the BADI implementation will be shown onto the UI.

Will this information help you?

Thanks,

Dhanya

former_member206060
Contributor

Hello Solène Roques,

This error is occurring due to an auto-generated code from the Employee times BO and therefore a mismatch occurs in the action parameter being called in the backend. This triggers the dump to occur.

For this requirement, you can use "Enhancement Implementation" from SDK rather than SubmitForApproval Action Validation. SAP has provided a standard BADI definition which can be implemented by the partners for these types of validations.

The BADI name is TIM_EMP_TIME_VALIDATION_CHECK and the corresponding enhancement spot name is ES_TIM_REC_VAL_CHK_EXT. This BADI has an interface with only one method “VALIDATE” which needs to be implemented. In the VALIDATE.absl you can write the logic and raise the error messages as required.

Hope this answers your query.

Thanks,

Dhanya KV

solene_roques
Participant

Dear Dhanya, thanks for your quick and interesting answer. I will try to work with the BADI and keep this question updated.

Thanks,

solene_roques
Participant
0 Kudos

Dear dhanya.kv ,

The type of returns of this BADI is "TimeErrorMsg" : is this BADI only raising messages or does it enable preventing the release ? As far as I see, it is only to raise messages. Our requirment is to prevent the release of the EmployeeTime.

Thanks for your help