Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

direct insert to pa0006

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

7 REPLIES 7

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

it was a mistake i ment pa0009

0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Ami,

Use BAPI_BANKDETAIL_CREATE for the same.

Regards,

Darshan Mulmule