Hello Naresh,
If that is the requirement, only to use custom fields and then use the value of custom fields to load employee using LDB. Then do in following way.
1) PNP LDB has its own field from Personnel Area. The field name is PNPWERKS. So you need to transfer the value from custom field to PNPWERKS just before GET PERNR is triggered.
2) I have provided the code snippet. Let's say custom field werks is S_WERKS. You enter all values in S-WERKS. Then use event "at selection-screenon s_werks" to move the value from S_WERKS to PNPWERKS. Similar way pernr can be moved to PNPPERNR.
Report ztest1.
Tables: pernr,
pa0001.
infotypes: 0000,
0001.
select-options: s_werks for pa0001-werks.
at selection-screenon s_werks. "move the value from Custom field to PNPWERKS.
loopat s_werks.
pnpwerks-sign = s_werks-sign.
pnpwerks-option = s_werks-option.
pnpwerks-low = s_werks-low.
pnpwerks-high = s_werks-high.
append pnpwerks.
endloop.
start-of-selection.
get pernr.
loopat p0001.
write:/ pernr-pernr,
p0001-werks.
endloop.
end-of-selection.
Please reward points if it is helpful :-)