12-23-2008 11:15 AM
i want to update table pa0006 each time where zlsch is null
is what i wrote is ok ?
select *
into corresponding fields of table itab_pa0006.
from pa0006.
loop at itab_pa0006 into wa_pa0006 where zlsch in initial .
clear wa_pa0006 .
wa_pa0006-zlsch = 'M'.
modify pa0006 from wa_pa006.
endloop.
thanks.
12-23-2008 11:22 AM
hi,
where is your field ZLSCH is it in Info type 0006?...........
that field is there in IT0009 not in IT0006...
check it once again and place your question properly so that we can help you.
Regards,
Arjun.
12-23-2008 11:20 AM
If you want to update all such records then you can have different approach also.
You are clearing wa_pa0006 at a wrong place. Without the other fields it will not be able to Update the table.
UPDATE pa0006 SET zlsch = 'M' WHERE zlsch = ' '.
OR
select *
into corresponding fields of table itab_pa0006.
from pa0006
WHERE zlsch IS INITIAL.
loop at itab_pa0006 into wa_pa0006 .
wa_pa0006-zlsch = 'M'.
modify pa0006 from wa_pa006.
clear wa_pa0006 .
endloop.
12-23-2008 11:22 AM
hi,
where is your field ZLSCH is it in Info type 0006?...........
that field is there in IT0009 not in IT0006...
check it once again and place your question properly so that we can help you.
Regards,
Arjun.
12-23-2008 11:26 AM
12-23-2008 11:28 AM
Also, it isn't the wisest thing to update directly PA tables, you should use FM HR_INFOTYPE_OPERATION so that the changes go through the proper validations for the infotype.
12-23-2008 11:48 AM
you can update it but you need to falow some meaning full way.
like:
select * from PA0009 into table IT_PA0009 where ZLSCH = ''.
then you can get records where ZLSCH is null.
then
loop at it_pa0009 into wa_pa0009.
insert into PA0009 values wa_pa0009 where pernr = wa_pa0009-pernr.
endloop..
Regards,
Arjun.
12-23-2008 1:12 PM
The best way is to use FM HR_INFOTYPE_OPERATION to update HR-database tables as they have the proper lock and unlock check. the validation can be done before calling the FM.
Thanks,
Saipriya
12-23-2008 2:52 PM
Hi Ami,
Use BAPI_BANKDETAIL_CREATE for the same.
Regards,
Darshan Mulmule