2020 Dec 27 9:29 AM
Hi,
after copying ABAP Program /1PYXXFO/SAP_PAYSLIP_KSA_PRNT for doing some modifications the Payroll area field and Period disappeared from screen layout.
Please advise
2020 Dec 27 3:36 PM
Hey, google finds this - it should find it in the Kingdom as well, I suspect 🙂
Looks fine to me, after copying in HRFORMS:


If you are still having problems after working in HRFORMS, what's the Release and SP level of, I guess, EA-HR software component, please?
cheers,
Janis
2020 Dec 27 1:30 PM
Do not copy standard programs ... have a look into the original program and navigate to the report. Then you can debug to find out why these do not appear. MAybe it's just the name of the report which is responsible...
But without a system it isn't easy to guide.. but it must be something small..
ahh, and did I mention it,
do not copy standard reports 😉
2020 Dec 27 1:56 PM
What Florian said of course! But if you want to find out what the cause of the issue is: get the screen-number your field is on (it may be a sub-screen). Check the fieldname and screen groups that correspond to your field and then check the process before output section of that screen. In one of the modules there probably is a LOOP AT SCREEN statement that triggers the visibility of your field (by using either the fieldname or one of the screen-groups).
At that point, you just have to figure out what triggers the )not) displaying of your field.
But, better to keep the core clean and don’t copy standard objects.
2020 Dec 27 1:57 PM
Basically, it's a very bad idea to copy standard programs, because of maintainability: you don't benefit of SAP patches, upgrades, etc. Instead use BAdI, Enhancement Framework, and if not possible you should then modify the standard. Copying a standard program is permitted only for simple code to help you create the custom program faster, as long as you master what is inside (i.e. you would have created the custom program from scratch the same way as the standard program).
2020 Dec 27 3:36 PM
Hey, google finds this - it should find it in the Kingdom as well, I suspect 🙂
Looks fine to me, after copying in HRFORMS:


If you are still having problems after working in HRFORMS, what's the Release and SP level of, I guess, EA-HR software component, please?
cheers,
Janis
2020 Dec 28 8:18 AM
Hi Jānis B
am facing the issue with the program not with the HRFORMS.
i can see that you have copied the HRFORMS only.
Regards
2020 Dec 28 1:47 PM
Hi @ yasin.n
Err, it does copy the 'whole deal' including the program...:

To get the selection screen back on your "Z" copy, set the HR Report Category under program attributes - it's probably empty:

Now that you mentioned the actual requirement, not being HR programmer, I'm also suspecting it's a "terrible" way to go about the requirement - to copy and try to "fiddle around" in the "form driver" program (even if you were expressly asked to...).
You may be better off tagging HR for this question..., not just ABAP Development.
Is there more to say about the requirement, please? 🙂 Get the pdf of the darn thing and attach it to E-mail? In what form, and in what context should the functionality be deployed (as a separate program, where user enters Period, Area, Personnel No, etc..?)?
Cheers,
Janis
2020 Dec 30 9:32 AM
Hi, Jānis B
Yes now it is working fine after following your tips:
- Copy from HRFORMS
- set the HR Report Category under program attributes
I still have one more question about sending the payslip via email, The requirement is to run the program and enter employee(s) Numbers or range, base on selection (i will add option to email payslip instead of generating output for printing )
i will fetch the emails from IT0105 / Mail also i have checked with Basis guy the email config is working fine.
what is the best way to achieve this.
Note: i will mark as answer later
many Thanks.
2020 Dec 30 1:29 PM
Hi yasin.n
Do you have Program HINU_HRFORMS_MAIL in your system? And what is the SAP Basis Release and Service Pack level in the system you are working on, please?
That program is part of the solution for this (or very similar requirement) SAP India has implemented for India Payroll... The solution is described in SAP Note 2004408 - HR-IN: HRForms Payslip via e-mail (I have stored a zip with the Note text and Pdf document describing the solution here), if you can't access OSS).
It's practically impossible for me to judge what would be the best way to go about this requirement (0 HR experience) and I don't like SAP's solution for various general technical reasons, but... not knowing better, I'd have to assume that they had at least some good reasons to implement it this way.
If you have this program and corresponding BADI HRFORM_HRF02 implementation SAP_PAYSLIP_MAIL_IN, you could copy their approach and even code... (which is, it can not be emphasized enough, usually not a good idea...).
But copying HINU_HRFORMS_MAIL would be less of a "sin" in my book, because much less copied code than if "Print Program" is copied... and, in the 6 or so years since the program was written, it has not been corrected even once... (code is stable).
And, in your BADI implementation you could even instantiate CL_IM_SAP_PAYSLIP_MAIL_IN and just call "Indian BADI" methods (less copied code), I think 🙂 Hopefully that does not raise some kind of licensing issues...
Generally their approach involves:
1) setting GETPDF in Form Processing Output Parameters, before printing:

2) getting the PDF from Form Output parameters after printing

They use EXPORT/IMPORT parameters to get the Selection Screen flag, if the output should be mailed from HINU_HRFORMS_MAIL to the BADI Implementation.
That's about it, I think.
cheers,
Jānis
2020 Dec 27 3:42 PM
Hi,
instead try through capturing required selection field and use Submit program name with selection parameters it will help to get required results instead of coping standard program
2020 Dec 28 8:15 AM
Hi Abinath,
the result is PDF (payslip). my requirement is instead of generating PDF as output for save or print i want to send the PDF(s) by email. no issue with sending emails but do you have any idea if the
Submit program will work with this scenario?
Thanks