Sunday, November 23, 2014
Functionality: This function module enables you to maintain master data for employees and applicants. You can transfer one data record. All validation checks take place that would take place in the individual maintenance screens in the dialog. If necessary, the module returns an error message. The error messages are the same as the error messages in the dialog, that is, the individual maintenance screen error messages are transferred rather than interpreted by this module.

Sample program 


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.

11 comments:

  1. Really this is very great information. Thanks lot.Examhelpline.in

    ReplyDelete
  2. Best Deals at buyonlinekart, an international prescription service provider, which contracts with International dispensaries and USA pharmacies, is a leader in referring orders for prescription and non-prescription medications on behalf of customers throughout the world
    buyonlinekart
    buy hydrocodone online
    buy oxycodone online
    buy oxycontin online
    buy percocet online
    buy vicodin online
    buy norco online
    buy adderall online
    buy xanax online

    ReplyDelete
  3. Get trained on data science course in hyderabad by real-time industry experts and excel your career with Data Science training by Technology for all. #1 online training institute for Data Science.

    ReplyDelete

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.