Google Search - Blog...........

HR ABAP - BDC Upload For The Org Unit Relationship Through T-Code PO10

REPORT ZHR_ORG_REL
NO STANDARD PAGE HEADING LINE-SIZE 255.

INCLUDE BDCRECX1.

*---Create internal tables

DATA : BEGIN OF RECORD OCCURS 0,
SEARK(12) TYPE C,
STEXT(45) TYPE C,
END OF RECORD.

START-OF-SELECTION.

*---upload data into internal table
PERFORM UPLOAD_FILE.

*--Create a session
PERFORM OPEN_GROUP.

*---process and post the records
LOOP AT RECORD.
PERFORM BDC_DYNPRO USING 'SAPMH5A0' '5100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'PM0D1-SEARK'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'PPHDR-PLVAR'
'01'.
PERFORM BDC_FIELD USING 'PM0D1-SEARK'
RECORD-SEARK.
PERFORM BDC_FIELD USING 'PM0D1-TIMR6'
'X'.
PERFORM BDC_FIELD USING 'PPHDR-BEGDA'
'01.08.2009'.
PERFORM BDC_FIELD USING 'PPHDR-ENDDA'
'31.12.9999'.
PERFORM BDC_DYNPRO USING 'SAPMH5A0' '5100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=INSE'.
PERFORM BDC_FIELD USING 'PPHDR-PLVAR'
'01'.
PERFORM BDC_FIELD USING 'PM0D1-SEARK'
RECORD-SEARK.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'TT_T777T-ITEXT(02)'.
PERFORM BDC_FIELD USING 'PM0D1-TIMR6'
'X'.
PERFORM BDC_FIELD USING 'PPHDR-BEGDA'
'01.08.2009'.
PERFORM BDC_FIELD USING 'PPHDR-ENDDA'
'31.12.9999'.
PERFORM BDC_FIELD USING 'MARKFELD(02)'
'X'.
PERFORM BDC_DYNPRO USING 'MP100100' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'P1001-RELAT'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'P1001-BEGDA'
'01.08.2009'.
PERFORM BDC_FIELD USING 'P1001-ENDDA'
'31.12.9999'.
PERFORM BDC_FIELD USING 'P1001-RSIGN'
'A'.
PERFORM BDC_FIELD USING 'P1001-RELAT'
'002'.
PERFORM BDC_DYNPRO USING 'MP100100' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'P1001-SOBID'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'P1001-BEGDA'
'01.08.2009'.
PERFORM BDC_FIELD USING 'P1001-ENDDA'
'31.12.9999'.
PERFORM BDC_FIELD USING 'P1001-RSIGN'
'A'.
PERFORM BDC_FIELD USING 'P1001-RELAT'
'002'.
PERFORM BDC_FIELD USING 'P1001-SCLAS'
'O'.
PERFORM BDC_FIELD USING 'P1001-SOBID'
RECORD-STEXT.
PERFORM BDC_DYNPRO USING 'MP100100' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'P1001-BEGDA'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=UPD'.
PERFORM BDC_FIELD USING 'P1001-BEGDA'
'01.08.2009'.
PERFORM BDC_FIELD USING 'P1001-ENDDA'
'31.12.9999'.
PERFORM BDC_FIELD USING 'P1001-RSIGN'
'A'.
PERFORM BDC_FIELD USING 'P1001-RELAT'
'002'.
PERFORM BDC_FIELD USING 'P1001-SCLAS'
'O'.
PERFORM BDC_FIELD USING 'P1001-SOBID'
RECORD-STEXT.
PERFORM BDC_DYNPRO USING 'SAPMH5A0' '5100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BACK'.
PERFORM BDC_FIELD USING 'PPHDR-PLVAR'
'01'.
PERFORM BDC_FIELD USING 'PM0D1-SEARK'
RECORD-SEARK.

PERFORM BDC_TRANSACTION USING 'PO10'.

ENDLOOP.
PERFORM CLOSE_GROUP.
*&---------------------------------------------------------------------*
*& Form UPLOAD_FILE
*----------------------------------------------------------------------*
FORM UPLOAD_FILE .

CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = 'C:\'
FILETYPE = 'DAT'
TABLES
DATA_TAB = RECORD
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7.


ENDFORM. " UPLOAD_FILE


ALSO READ:

- Function Modules To Read Benefits Data In HR ABAP.

- Sample Code For Do Varying In HR ABAP.

- Get Family Data In HR ABAP.

- Net Salary Report In HR ABAP.

- Cumulative Amount Report in HR ABAP.

- HR ABAP - BDC For The Action Transfer Of Location.

- HR ABAP - BDC For Uploading Absence Data Into PA30 Transaction.

- HR ABAP - BDC To Upload The OM Relations Through T-code PO13.

.....Back To Index On HR ABAP.

.....Back To MAIN INDEX.

No comments:

Post a Comment