NO STANDARD PAGE HEADING LINE-SIZE 255.
INCLUDE bdcrecx1.
*define the internal table
DATA : BEGIN OF record OCCURS 0,
seark(12),
sobid(45),
END OF record.
START-OF-SELECTION.
*---upload the data into the internal table
PERFORM upload_file.
*---open a session
PERFORM open_group.
*---process and post the entries into the table
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-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'
'007'.
PERFORM bdc_field USING 'P1001-SCLAS'
'S'.
PERFORM bdc_field USING 'P1001-SOBID'
record-sobid.
PERFORM bdc_dynpro USING 'MP100100' '2000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P1001-BEGDA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P1001-BEGDA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
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 'PO03'.
ENDLOOP.
PERFORM close_group.
*&---------------------------------------------------------------------*
*& Form UPLOAD_FILE
*----------------------------------------------------------------------*
FORM upload_file .
*---upload the data into the internal table from 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:
- BDC To Upload The OM Relations Through T-code PO13.
- 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.
.....Back To Index On HR ABAP.
.....Back To MAIN INDEX.
No comments:
Post a Comment