‎2013 Sep 06 6:35 AM
Hello all,
I am new to HR abap coding and had to see a program written for dubai and now i have to make changes to india.
in the code it is as
START-OF-SELECTION.
REFRESH : it_zhr_tbl_006[].
SELECT * FROM zhr_tbl_006 INTO TABLE it_zhr_tbl_006.
IF NOT it_zhr_tbl_006[] IS INITIAL.
SELECT * FROM t512t INTO TABLE it_t512t
FOR ALL ENTRIES IN it_zhr_tbl_006[]
WHERE sprsl EQ sy-langu AND
molga EQ 40 AND
lgart EQ it_zhr_tbl_006-lgart.
ENDIF.
DATA : s_period TYPE char10.
SELECT * FROM zhr_tbl_002 INTO TABLE it_para.
GET pernr.
rp_provide_from_last p0008 space sy-datum sy-datum.
the program flow is coming till the select above get pernr and skipping all other and going to end of selection.
Can you tell me what changes i have to make??
I changes molga and and user group paramaters in user profiles as 40 also.
Please help.
Ujwal
‎2013 Sep 06 6:48 AM
hi Ujwal,
For GET, there is no syntax that matches - GET pernr.
In order to get the value that you want, we first create a node for the table and then access its fields as shown in the example below.
REPORT demo_get.
NODES: spfli, sflight, sbook.
DATA: weight TYPE p LENGTH 8 DECIMALS 4,
total_weight TYPE p LENGTH 8 DECIMALS 4.
INITIALIZATION.
carrid-sign = 'I'.
carrid-option = 'EQ'.
carrid-low = 'AA'.
carrid-high = 'LH'.
APPEND carrid TO carrid.
START-OF-SELECTION.
WRITE 'Luggage weight of flights'.
GET spfli FIELDS carrid connid cityfrom cityto.
SKIP.
ULINE.
WRITE: / 'Carrid:', spfli-carrid,
'Connid:', spfli-connid,
/ 'From: ', spfli-cityfrom,
'To: ', spfli-cityto.
Let me know if this helps.
Uk
‎2013 Sep 06 7:19 AM
Try writing this way:
REPORT zreport.
INFOTYPES: 0001.
TABLES: pernr.
START-OF-SELECTION.
GET PERNR.
PROVIDE * FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA.
WRITE:/ P0001-PERNR,
P0001-STELL,
P0001-BEGDA.
ENDPROVIDE.
‎2013 Sep 06 7:01 AM
Hi Ujwal,
do you want to enhance an existing program or do you write a new program?
GET penrnr needs a logical database like PNP in the programs attributes.
Please check the attributes of your program.
You can display the Logical Database in SE36.
Regards,
Klaus
‎2013 Sep 06 7:09 AM
hi klaus,
There is an existing program for molga 99(Dubai) and now in need to copy the program and change according to India Molga = 40.
Yes i have used PNP in the attributes. I know all those but dont know why the program flow is not going till get pernr and jumping directly to end of selection.
Ujwal.
‎2013 Sep 06 7:14 AM
Hi Ujwal,
this normally always will happen, if no data matching the Logical Database select options on your selection screen will be found.
Regards,
Klaus
‎2013 Sep 06 7:22 AM
Hi Ujwal,
I created a short test program with logical database PNP in the attributes:
REPORT ztestpnp.
NODES: pernr.
START-OF-SELECTION.
GET pernr.
BREAK-POINT.
END-OF-SELECTION.
It works fine without any input on the selection screen. Please check it in your system.
Regards,
Klaus
‎2013 Sep 06 7:25 AM
hi klaus.
\thanks for your reply.
Can you tell me how can i cross check this??
i am using following infotypes in my program. is it anything related to this.
INFOTYPES : 0000, 0001, 0002, 0008, 0041, 2006,0014,0009.
Ujwal
‎2013 Sep 06 7:26 AM
Hi Ujwal,
I think the issue might also be caused using macro rp_provide_from_last p0008.
Maybe this doesn't work okay for India. Try the macrö's code without using the macro, for macros can't be processed in debugging mode.
Regards,
Klaus
‎2013 Sep 06 7:46 AM
hi klaus,
the
rp_provide_from_last p0008. statement is after get pernr right? but the flow is not going till get pernr also.
and aslo i checked the data for infotype 0008 and its available.
Thanks
‎2013 Sep 06 7:55 AM
If you don't trigger the GET there may be no record you are allowed to see So logical database program SAPDBPNP does not execute any PUT pernr.
(no record or records you are not allowed, HR loves authorization-checks)
Some hints :
Regards,
Raymond
‎2013 Sep 06 8:19 AM
hi raymond,
i check su53 after running my program it says "The last authorization check was successful".
Ujwal
‎2013 Sep 06 8:31 AM
‎2013 Sep 06 8:39 AM
yes i am getting a record for the employee given.
hover i modified the pnp selection screen with Z report category.
My screen looks like below. its program for settlement form for resigned or terminated employees.
‎2013 Sep 06 9:15 AM
‎2013 Sep 06 11:07 AM
hi raymond,
i put break at the point you mentioned but its not triggering.
Ujwal
‎2013 Sep 06 11:20 AM
Hi,
you should give the user id executing this logic correct user parameters like molga.
Kind regards, Rob Dielemans
‎2013 Sep 06 11:49 AM
hi rob,
the molga value is given correctly as 40 in the user parameters
‎2013 Sep 06 12:33 PM
hi ujwal,
for every LDB program their is start-of-selection and End-of-selection in between GET PERNR is their right. your statements are below
GET pernr.
rp_provide_from_last p0008 space sy-datum sy-datum.
put a break point in macro above mentioned and check. put in macro don't forget OK.
Thanks and Regards
Sudhakar
‎2013 Sep 06 12:37 PM
‎2013 Sep 06 1:14 PM
Hi Raymond,
Oh sorry Raymond, you are correct.
put a break point in any executable statement not in a macro, but put the break point after Get pernr and before End-of-selection.
Thanks and Regards
Sudhakar
‎2013 Sep 06 5:22 PM
hi sudhakar,
yes ,put break point after get pernr statement on the macro and in end-of selection.
the break on marcro is not triggered but in end-of selection it does.
Ujwal
‎2013 Sep 09 6:00 AM
Hi Ujwal,
you can't debug a macro. Therefore use the ABAP command
BREAK-POINT.
after GET PERNR
to see if it can be reached.
Regards,
Klaus
‎2013 Sep 09 6:22 AM
Hi Ujwal,
This happens when no records have been selected in the logical database.
Make sure that personnel number and payroll area matches, that there are valid records for the input criteria given. If its still not working you could try the option below.
Use logical database PNPCE instead of PNP. In the attributes, change logical database from PNP to PNPCE.
Program will have few changes.
TABLES: pernr,
pa0008.
NODES: peras.
DATA : s_period TYPE char10.
START-OF-SELECTION.
REFRESH : it_zhr_tbl_006[].
SELECT * FROM zhr_tbl_006 INTO TABLE it_zhr_tbl_006.
IF NOT it_zhr_tbl_006[] IS INITIAL.
SELECT * FROM t512t INTO TABLE it_t512t
FOR ALL ENTRIES IN it_zhr_tbl_006[]
WHERE sprsl EQ sy-langu AND
molga EQ 40 AND
lgart EQ it_zhr_tbl_006-lgart.
ENDIF.
SELECT * FROM zhr_tbl_002 INTO TABLE it_para.
* Calling the PERAS event in the PNPCE LDB to retrieve specified infotype values
GET peras.
sort p0008 by begda . " You need to sort infotype before using the following macro.
rp_provide_from_last p0008 space sy-datum sy-datum.