Skip to Content
0
Former Member
Jan 11, 2006 at 08:45 AM

get PA0002-INITS by using Partner (ZI Introducing Employee)

57 Views

Hello everyone, need to write a routine as follows,

in oder to get the reimbursement for the person who related to this quotation. and the initials should be appears on the quotation sheet, using the ZI introducing employee I can fetch the personnel Nr, and then through HR table PA0002 to get the intials.

Document Nr table VBPA

field VBELN

table -


>field PARVW (ZI)

Personnel Nr. -


>field PERNR

HR table PA0002

field PERNR

field INITS

so far I am doing in this step, there might be some errors in this report.who can help me to finish this report?

Routine: GET_ZI_INITS USING VBELN (DOCNR) CHANGING INITS

DATA:

vbeln LIKE vbak-vbeln,

inits LIKE pa0002-inits,

  • read params

READ TABLE PARAMS WITH KEY 'VBELN'.

MOVE PARAMS-value TO VBELN.

  • VBELN (doc nr)

...

  • get pernr_zi (introducing employee number) from document header

SELECT-SINGLE PERNR FROM VBPA

WHERE

PARVW = ZI

...

IF SY-SUBRC NE 0. " ZI exists?

ENDIF.

  • get initials

SELECT-SINGLE INITS FROM PA0002

WHERE

PERNR EQ pernr_zi and " introducing employee number

ENDDA GE AUDAT and " document date

BEGDA LE AUDAT.

IF SY-SUBRC NE 0.

" what we can do if it is Not good,

I am think of to get the first alphabet of the first name and last name from HR

ENDIF.

  • return params

  • INITS (initials)

...

thank you very much for ur help!