2011 May 27 9:03 AM
HI Experts,
I have a simple problem.
There are few blank PERNRs are in infotypes PA0001 and PA0002 in Production.I have to remove them.
These blank PERNRs records are populated there because of some mistake.
This can not be done in production.
I have checked many FMs ,but couldnt find the correct one.
Now I want to use a simple query to delete the records.Please tell me the query to delete the records.
First i used to read these empty records but failed to do so by the following query.
select * from PA0001 into table it_pa0001
where PERNR = ' ' .
This query is not reading any record.
I used PERNR is NULL then also it is not working.I used other key fields but it is fetching other records then blank PERNRs.
Kindly suggest.
~Sachin
2011 May 27 9:10 AM
PERNR is key field in all infotypes, while for all FMs which work with infotypes this field is obligatory . Such entry should never come to production. If this happened, this should be removed by some backdoor operation. Direct table record deletion I guess is here the only (though not necessary safely) way of handling that.
Correct query would be
select * from PA0001 into table it_pa0001
where PERNR = '00000000' .
PERNR is of type NUMC 8, so default value is not space but 8 zeros.
Regards
Marcin
2011 May 27 9:17 AM
Hey Marcin
...Thanks for the reply....yes you are right ,it should have not been populated in the Infotype.
I have checked this query also...but it is not working.
Thanks
Sachin
2011 May 27 9:28 AM
Sachin,
For me all three variants are working
"1
tables pa0001.
select single * from pa0001 where pernr = '00000000'.
"2
select single * from pa0001 where pernr = space.
"3
select single * from pa0001 where pernr = ''.
Please ensure the client you are executing the query is correct. Also direct SE16N check with conditon PERNR = empty should confirm that.
Regards
Marcin
2011 May 27 12:19 PM
Hi,
There is no need to run a select query if you want to delete the records for which pernr is not assigned..
Run the standard report RPUDELPN and it will delete all the data in prod server
Regards
Abhinav
2011 May 27 12:54 PM
Hi,
delete pa0001 where pernr = '00000000'.
it will be useful.
Ram.
2011 May 27 1:36 PM