09-10-2008 7:41 AM
HI all,
I am using PNP DB to get the HR data...
I m giving the data range in the std selection screen ...
but it is not filtering the data on the basis of data range....
it is giving all the data which are present in the DB...
plz help me in trobleshooting the problemm....
thnx
Rohit
09-17-2008 1:19 PM
Can you post your code? So we can look and suggest you something .. hmmmm
Example
In your prog attr : PNP
REPORT Ypnp.
tables:pernr.
infotypes:0001,
0002.
START-OF-SELECTION.
*reading logical database PNP with pernr node
GET PERNR .
* Reading pa0001 using macro
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1. " if found = 1, otheriwse '0'
YOURTAB-FIELD = P0001-PERSK.
ENDIF.
RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1. " if found = 1, otheriwse '0'
YOURTAB-FIELD1 = P0002-NACHN.
ENDIF.
APPEND YOURTAB .
END-OF-SELECTION.
Perform write_output.
^ Saquib
.
09-10-2008 11:23 AM
09-10-2008 11:30 AM
Hi,
Make sure that, Master Data field is empty or not in Attributes.
goto attributes, click on 'HR Report category'
now make sure that, 'Master Data (Infotype)' is empty or not.
If its value is : ______03, some data retrieval is not done.
hopefull, it will be helpfull to you.
Regards
Sai
09-11-2008 11:29 AM
09-17-2008 11:46 AM
09-17-2008 1:19 PM
Can you post your code? So we can look and suggest you something .. hmmmm
Example
In your prog attr : PNP
REPORT Ypnp.
tables:pernr.
infotypes:0001,
0002.
START-OF-SELECTION.
*reading logical database PNP with pernr node
GET PERNR .
* Reading pa0001 using macro
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1. " if found = 1, otheriwse '0'
YOURTAB-FIELD = P0001-PERSK.
ENDIF.
RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1. " if found = 1, otheriwse '0'
YOURTAB-FIELD1 = P0002-NACHN.
ENDIF.
APPEND YOURTAB .
END-OF-SELECTION.
Perform write_output.
^ Saquib
.
09-17-2008 1:55 PM
Thnx for replying SK....
my code is like this...
INFOTYPES: 0000, "Action
0001,
0002, "Personal Data
0006, "Address
0008,
1001,
0105, "Communication
0041. "Date Specification
9000.
*----
TABLES
*----
TABLES: "pernr, "Standard Selections for HR Master Dat
t510,
pa0000,
hrp1001.
TYPE-POOLS: slis.
-
-
......
..........
START-OF-SELECTION .
*Fetch Data from LDAP / Active Directory Server for reconcilation
PERFORM get_ldap_data.
*Get SAP HR data
rp_set_data_interval 'P0002' PN-BEGDA PN-endda.
rp-set-name-format.
GET pernr.
PERFORM get_sap_data.
rp_provide_from_last p0002 space PN-BEGDA pn-endda.
IF PNP-SW-FOUND = 1.
get last name
MOVE p0002-nachn TO g_nachn.
*get first name
MOVE p0002-vorna TO g_vorna.
endif.
....do the selection screen makes any differance....
i m using std one.....
plz suggest...
and amit Gupta ---i am passing the values as shown above....as it is...
Edited by: Rohit Kumar on Sep 17, 2008 6:26 PM
09-17-2008 2:18 PM
Comment the following and try ..
*Get SAP HR data
rp_set_data_interval 'P0002' PN-BEGDA PN-endda.
Iu2019ve seen wired behavior with above macro in past .
Also Iu2019m assuming that you are selecting all of the data after Get pernr event.
Good luck !
^ Saquib
09-18-2008 5:38 AM
>
> Thnx for replying SK....
> my code is like this...
>
> INFOTYPES: 0000, "Action
> 0001,
> 0002, "Personal Data
> 0006, "Address
> 0008,
> 1001,
> 0105, "Communication
> 0041. "Date Specification
> * 9000.
> *----
> * TABLES
> *----
> TABLES: "pernr, "Standard Selections for HR Master Dat
> t510,
> pa0000,
> hrp1001.
>
> TYPE-POOLS: slis.
> -
> -
......
> ..........
>
> START-OF-SELECTION .
> *Fetch Data from LDAP / Active Directory Server for reconcilation
> PERFORM get_ldap_data.
>
> *Get SAP HR data
> rp_set_data_interval 'P0002' PN-BEGDA PN-endda.
> rp-set-name-format.
>
> GET pernr.
> PERFORM get_sap_data.
>
> rp_provide_from_last p0002 space PN-BEGDA pn-endda.
> IF PNP-SW-FOUND = 1.
> * get last name
> MOVE p0002-nachn TO g_nachn.
> *get first name
> MOVE p0002-vorna TO g_vorna.
> endif.
>
> ....do the selection screen makes any differance....
>
> i m using std one.....
>
> plz suggest...
>
>
> and amit Gupta ---i am passing the values as shown above....as it is...
>
> Edited by: Rohit Kumar on Sep 17, 2008 6:26 PM
Hi Rohit
The code is working fine for me, could you please post the values of pn-begda and pn-endda and the data(key fields) returned by LDB into the internal table P0002 and let us know as why you think LDB is not restricting the data. Here is the code that i've tested
REPORT zytest.
INFOTYPES: 0000, " Actions
0001, " Org Assignment
0002, " Personal Data
0006, " Address
0008, " Basic Pay
1001, " Relationships
0070, " Court orders
0105, " Communication
0041. " Date Specification
*9000.
*---------------------------------------------------------------------
*TABLES
*---------------------------------------------------------------------
TABLES: pernr, "Standard Selections for HR Master Dat
t510,
pa0000,
hrp1001.
TYPE-POOLS: slis.
START-OF-SELECTION .
*Fetch Data from LDAP / Active Directory Server for reconcilation
*PERFORM get_ldap_data.
*Get SAP HR data
rp_set_data_interval 'P0002' pn-begda pn-endda.
rp-set-name-format.
GET pernr.
*PERFORM get_sap_data.
rp_provide_from_last p0002 space pn-begda pn-endda.
IF pnp-sw-found = 1.
*get last name
*MOVE p0002-nachn TO g_nachn.
**get first name
*MOVE p0002-vorna TO g_vorna.
ENDIF.REPORT zytest.
INFOTYPES: 0000, " Actions
0001, " Org Assignment
0002, " Personal Data
0006, " Address
0008, " Basic Pay
1001, " Relationships
0070, " Court orders
0105, " Communication
0041. " Date Specification
*9000.
*---------------------------------------------------------------------
*TABLES
*---------------------------------------------------------------------
TABLES: pernr, "Standard Selections for HR Master Dat
t510,
pa0000,
hrp1001.
TYPE-POOLS: slis.
START-OF-SELECTION .
*Fetch Data from LDAP / Active Directory Server for reconcilation
*PERFORM get_ldap_data.
*Get SAP HR data
rp_set_data_interval 'P0002' pn-begda pn-endda.
rp-set-name-format.
GET pernr.
*PERFORM get_sap_data.
rp_provide_from_last p0002 space pn-begda pn-endda.
IF pnp-sw-found = 1.
*get last name
*MOVE p0002-nachn TO g_nachn.
**get first name
*MOVE p0002-vorna TO g_vorna.
ENDIF.
09-19-2008 6:36 AM
Hi Rajesh,,
the value in PN-BEGDA & PN-ENDDA...is the same which is i m entering in the selection screen...
09-19-2008 6:37 AM
09-19-2008 10:15 AM
>
> Hi Rajesh,,
>
> the value in PN-BEGDA & PN-ENDDA...is the same which is i m entering in the selection screen...
Hi Rohit,
Could you please post the values of pn-begda, pn-endda and the values of the key fields in the records returned by the LDB into the internal table P0002
09-19-2008 11:02 AM
as shown while debugging...
the value which i have entered in selection screen :
PN-BEGDA 20080901
PN-endda 20080919
and in p0002:
PERNR INFTY SUBTY OBJPS SPRPS ENDDA BEGDA SEQNR AEDTM
00000010|0002 | | | |99991231|19670522| 000 |
00000010|0002 | | | |99991231|19670522| 000 | 20030
there is problem it is taking begda from begining....
plz suggest ....
09-19-2008 11:10 AM
hi Rohit,
Retrieving the Data by 'Get Pernr' will not restrict the data.
The whole data for a pernr will be retrieved at the Get pernr event no matter of ur pn-begda and pn-endda.
if u want to filter the data u have to use the macro's.
09-19-2008 11:56 AM
Iu2019d say perform the following checks.
~ Take employee # and run it for other period option
~ Look at employee data (all ITs you are accessing in your program one by one closely with open eyes, pay attention to dates u201C.
~ Run report and debug it and look data for every IT and make sure it is picking up all the records as period specified in report . Compare them with PA20/PA30 .
~ At last , see what you are getting in internal table .
~ If problem still exist , Comment any code before START-OF-SELECTION event .
~ Just use "Get Pernr" and write statement . Comment ALL ITs and just run it for one IT at a time .
Iu2019m sure , youu2019ll find what is really going wrong .
Good Luck !
^Saquib
09-21-2008 10:56 AM
>
> as shown while debugging...
>
> the value which i have entered in selection screen :
> PN-BEGDA 20080901
> PN-endda 20080919
>
>
>
> and in p0002:
>
>
> PERNR INFTY SUBTY OBJPS SPRPS ENDDA BEGDA SEQNR AEDTM
>
> 00000010|0002 | | | |99991231|19670522| 000 |
> 00000010|0002 | | | |99991231|19670522| 000 | 20030
>
>
> there is problem it is taking begda from begining....
>
> plz suggest ....
Hi Rohit
The records returned by the LDB are absolutely fine, i don't see any issue with them, since the 2 records are valid in the date range given in the selection screen(pn-begda, pn-endda) the LDB returned those 2 records this is the expected behaviour of the system and the macro
rp_set_data_interval is working as it should be.
If you want to analyze the macro(rp_set_data_interval), delimit any of the 2 records returned by the LDB such that the enddate of the record is before pn-begda(20080901), now the LDB will not return the delimited record as the enddate of the record does not fall in the interval pn-begda, pn-endda.
@Krishna Kishore : I totally agree with you, here in the example provided by Rohit as we are using the macro rp_set_data_interval we expect that the LDB should limit the records returned to the date range given in the selection screen(pn-begda, pn-endda) instead of returning all the records of the pernr.
One more option to totally restrict the records returned by the LDB is to add "MODE N" in the Infotypes declaration
itself. Please, check the link below
http://help.sap.com/saphelp_47x200/helpdata/en/4f/d527fb575e11d189270000e8322f96/content.htm
Regards
Rajesh.
09-17-2008 1:25 PM
pass ur selection screen data like p_begda, p_endda to PN-BEGDA, PN-ENDDA before get pernr event.
It will restrict get pernr event from fetching all the data.
09-17-2008 3:11 PM
THIS CODE CAN BE USED TO RESTRICT GET PERNR EVENT TO LOOP ONLY FOR PERNR MENTIONED IN SELECT OPTIONS
TABLES: PERNR.
SELECT-OPTIONS: R_PERNR FOR PERNR-PERNR.
START-OF-SELECTION.
PNPPERNR = R_PERNR.
GET PERNR.
WRITE: / PERNR-PERNR.
END-OF-SELECTION.
09-19-2008 6:41 AM
Hi Amit,
i tried that also...
i jst copied ur code and tried alone ....bt still there is problem...
i think ther must be some problem with sonfig...
plz suggest me...