Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Function module problem

Hi Guy's,

Please help me presently i am working with this functionmodule : HR_RECOGNIZE_EMPLOYEE.

to get the p0002-tab results i wrote the code like this

REPORT ZEMPLOYEE_DATA.

tables : pa0002.

types : begin of ty_0002,

pernr type PERSNO,

NACHN type PAD_NACHN,

vorna type PAD_VORNA,

gbdat type GBDAT,

PERID type PERID,

end of ty_0002.

data : it_0002 type standard table of ty_0002,

wa_0002 type ty_0002.

data : it_result type standard table of p0002.

select-options : s_pernr for pa0002-pernr.

start-of-selection.

select pernr

nachn

vorna

gbdat

perid

from pa0002

into table it_0002

where pernr in s_pernr.

if sy-subrc = 0.

sort it_0002 by pernr.

endif.

loop at it_0002 into wa_0002.

CALL FUNCTION 'HR_RECOGNIZE_EMPLOYEE'

EXPORTING

vorna = wa_0002-vorna

nachn = wa_0002-nachn

gbdat = wa_0002-gbdat

perid = wa_0002-perid

  • GESCH =

EXCLUDE_PERNR = wa_0002-pernr

IMPORTING

P0002_TAB = it_result

EXCEPTIONS

NO_PERNR_FOUND = 1

LACK_OF_INPUT = 2

OTHERS = 3

.

*IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

*ENDIF.

endloop.

But every time it giving single record.

Kindly hlep me friends, based on the selection entries i nedd it_results.

Thanks and Regards,

Sai.

Former Member
Not what you were looking for? View more on this topic or Ask a question