Tuesday, December 28, 2010
This function module enables you to maintain master data for employees and applicants.


REPORT  ZTEST_NFOTYPE_OPERATION .
DATA:P0006  TYPE STANDARD TABLE OF P0006 WITH HEADER LINE.
DATA:RETURN LIKE  BAPIRETURN1.

P0006-PERNR = '00001234'.
P0006-SUBTY = '2'.
P0006-ENDDA = '99991231'.
P0006-BEGDA = SY-DATUM.
P0006-ANSSA = '2'.
P0006-NAME2 = 'xyz'.
P0006-STRAS = 'Street 64'.
P0006-ORT01 = 'US'.
P0006-PSTLZ = '560634'.
APPEND P0006.
CLEAR  P0006.

LOOP AT P0006.
  CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
    EXPORTING
      NUMBER = P0006-PERNR.
  "operations on individual infotype
  CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
      INFTY         = '0006'
      NUMBER        = P0006-PERNR
      SUBTYPE       = P0006-SUBTY
      VALIDITYEND   = P0006-ENDDA
      VALIDITYBEGIN = P0006-BEGDA
      RECORD        = P0006
      OPERATION     = 'INS'
      TCLAS         = 'A'
    IMPORTING
      RETURN        = RETURN.
  IF  RETURN IS INITIAL.
    WRITE 'Successfully records created'.
  ENDIF.
  CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
    EXPORTING
      NUMBER = P0006-PERNR.
ENDLOOP.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.