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: 

PA30 Infotye 8 validation in HRPAD00INFTY BadI SAP ABAP?

former_member396057
Participant
0 Kudos

Hi,

My requirement is if user enters basic salary greater than 10,000 for wage type-1000 then i have to raise the error message.

For this I have written the logic in HRPAD00INFTY~AFTER_INPUT method.

I am facing the following issues-

1.If user enters the salary Ex: 12,000 then error message 'Salary range exceeded' will appear on the PA30 Infotype 8 screen and if user click the save button also the error message is triggering.But after user enters the salary Ex:7000 and presses enter then it is showing warning message 'This entry deletes the record' and again presses the enter then it is going back to PA30 Main screen and shows record created message.

2.My issue is after warning message if user presses enter the screen should be in Infotype 8 and should display message 'Save your entries'.But the sy-ucomm = 'UPD' is saving after error message is triggered which will causing directly saving the correct entered value.

Where I need to write the validation/control check for raising error message logic in BADI

HRPAD00INFTY~AFTER_INPUT method (OR) HRPAD00INFTY~IN_UPDATE method ?

Regards,

Shabbir

1 ACCEPTED SOLUTION

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Shabbir Ahmed,

Write the validations inside AFTER_INPUT. The HRPAD00INFTY~AFTER_INPUT method will trigger in both 'Enter' and 'SAVE' button is pressed.

 "My issue is after warning message if user presses enter the screen should be in Infotype 8 and should display message 'Save your entries'.

If the validation code is written inside HRPAD00INFTY~AFTER_INPUT method, after the amount is entered in basic pay(7000) in infotype 0008 once ENTER button, your custom warning message will be populated(which is written in your exit), on pressing enter one more message 'Save your entries' will be populated. It won't save unless user presses save button.

If directly SAVE button is pressed, again HRPAD00INFTY~AFTER_INPUT method will trigger and the warning message(which is written in your exit) will be populated in screenand once enter button is pressed, it will save the values directly. It won't stop like above, this is standard behavior.

Regards

Rajkumar Narasimman

3 REPLIES 3

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Shabbir Ahmed,

Write the validations inside AFTER_INPUT. The HRPAD00INFTY~AFTER_INPUT method will trigger in both 'Enter' and 'SAVE' button is pressed.

 "My issue is after warning message if user presses enter the screen should be in Infotype 8 and should display message 'Save your entries'.

If the validation code is written inside HRPAD00INFTY~AFTER_INPUT method, after the amount is entered in basic pay(7000) in infotype 0008 once ENTER button, your custom warning message will be populated(which is written in your exit), on pressing enter one more message 'Save your entries' will be populated. It won't save unless user presses save button.

If directly SAVE button is pressed, again HRPAD00INFTY~AFTER_INPUT method will trigger and the warning message(which is written in your exit) will be populated in screenand once enter button is pressed, it will save the values directly. It won't stop like above, this is standard behavior.

Regards

Rajkumar Narasimman

0 Kudos

Hi Raj,

Thanks for the reply.

The issue is resolved with your inputs.

Regards,

Shabbir

raymond_giuseppi
Active Contributor
0 Kudos

Did you raise the ERROR_WITH_MESSAGE exception in the BAdI implementation?

You could also play with this exception and using some MESSADE DISPLAY LIKE to fulfill your requirement. (e.g. Raising as an error displayed like a warning only once)