BDC on Infotype 1 , 2 and 8
Hi
Im new to ABAP HR and im required to do BDC on Infotype 1,2,8. Can anyone send me samples that i can proceed ?
Thanks and Regards
Swarna Arunachalam
It is not recommeneded to perform a BDC on infotypes as dynamic screen sequences are involved in it. If the data is not too huge one can use the function module <b>HR_INFOTYPE_OPERATION</b> for uploading data into infotypes, please search the forum for the function module specified, u can find lots of posts on the same.
Similar Messages
-
HR ABAP How to Write BDC For Infotype 0586
Hi Experts
Can Any One tell me how to write BDC for Infotype 0586 and also 585.
If we enter into the maintaining Screen, the lines in the Screen will dynamically changing depending on the values.
When I am doing recording , If I press page down after entering values in top lines, the lines are changing and the records are not updating Correctly.
I need to write BDC to Create Change.
Can any one please help me in this regard?
Thanks in Advance.
Regards
Avinash.http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
http://www.google.co.in/search?hl=en&q=SAPBDCtable+control&meta=
http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
http://www.sap-img.com/abap/question-about-bdc-program.htm -
HR BDC updates Infty 40 and 15 in Quality but only Infty 40 in production.
Hi SDNers,
I am facing a peculiar problem . I have a program which updates infotype 0040 and thereafter Infotype 0015 with the remaining amount value for a employee card when the employee is doing his settlement post-resignation . This program works absolutely fine in Quality and Test system and updates both infotypes bbut in production , it updates infotype 0040 only .Here is the program given below.
I have debugged and analyzed various scenarios in dev. and quality where it works fine
- Running BDC after resignation action
- Locking the payroll area for which the employee belongs .I had a hunch that BAPI_EMPLOYEE_ENQUEUE would be giving a non-zero return message since the payroll area of the employee is locked and therefore ; the program might not be going to the Infotype 0015 update loop . However, I got no error in quality and dev. for the same.
Please let me know the solution . Points are assured for helpful as well as correct solution.
*& Report ZRHRBDC *
REPORT ZRHRBDC
NO STANDARD PAGE HEADING LINE-SIZE 255.
**************Includes And Types****************
INCLUDE <icon>.
TABLES: t100.
*include bdcrecx1.
TYPE-POOLS: slis.
TABLES: zhr_loan_obj,zhr_loan_stat.
**************Data Declaration***************
DATA: itab_alv_fieldcat TYPE slis_t_fieldcat_alv,
itab_alv_layout TYPE slis_layout_alv,
itab_lt_sort TYPE slis_t_sortinfo_alv,
itab_ls_sort TYPE slis_sortinfo_alv,
v_stru_disvar TYPE disvariant,
v_header TYPE slis_listheader,
v_t_header TYPE slis_t_listheader,
v_ld_lines TYPE i,
v_t_line LIKE v_header-info,
v_ld_linesc(10) TYPE c.
DATA: v_tcode LIKE sy-tcode.
DATA: v_lin(6).
DATA: v_lin1(6).
DATA: v_lin2(6).
DATA: v_path(3) TYPE c VALUE 'C:\'.
DATA: v_mask(6) TYPE c VALUE ',.,.'.
DATA: v_mode(1) TYPE c VALUE 'O'.
****************Internal Table************
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
messages of call transaction
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: itab_msgtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: itab_up_data LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
DATA: fieldtab TYPE slis_t_fieldcat_alv.
DATA: BEGIN OF itab_rec_data OCCURS 0,
pernr(8),
lobnr(20),
zz_reason(20),
zz_status(20),
zz_remain(10),
stat(1),
mstring(480),
END OF itab_rec_data.
DATA: BEGIN OF st_display,
pernr LIKE p0001-pernr,
lobnr LIKE p0040-lobnr,
zz_reason LIKE zhr_loan_obj-description,
zz_status LIKE zhr_loan_stat-description,
zz_remain LIKE p0040-zz_depositamt,
stat(4),
etype TYPE bdcmsgcoll-msgtyp,
mstring(480),
END OF st_display.
DATA: itab_display LIKE st_display OCCURS 0 WITH HEADER LINE,
itab_display_suc LIKE st_display OCCURS 0 WITH HEADER LINE,
itab_display_err LIKE st_display OCCURS 0 WITH HEADER LINE.
DATA: v_ucomm LIKE sy-ucomm.
***********Selection Screen****************
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: filename LIKE rlgrap-filename.
PARAMETERS ctumode LIKE ctu_params-dismode DEFAULT 'N'.
PARAMETERS: cupdate LIKE ctu_params-updmode DEFAULT 'S' NO-DISPLAY.
"S: synchronously
"A: asynchronously
"L: local
PARAMETERS: nodata DEFAULT '/' LOWER CASE NO-DISPLAY.
SELECTION-SCREEN: END OF BLOCK b1.
PARAMETERS: p_test AS CHECKBOX DEFAULT 'X'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
PERFORM getfile_f4help.
INITIALIZATION.
ctu = 'X'.
v_tcode = 'PA30'.
*****************Start of Selection***********
START-OF-SELECTION.
PERFORM status_indicator.
PERFORM upload_data."To upload data
IF p_test IS INITIAL.
PERFORM bdc_update. "To perform bdc
ENDIF.
END-OF-SELECTION.
PERFORM process_display.
PERFORM fieldcat_init.
PERFORM display_report.
*& Form upload_data
FORM upload_data .
****To Upload the data
DATA : wrk_pcfile TYPE string.
IF sy-batch = 'X'.
MESSAGE e000(ztibs) WITH text-007.
ENDIF.
MOVE filename TO wrk_pcfile.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = wrk_pcfile
filetype = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = itab_rec_data
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE e000(zhr) WITH text-005.
ENDIF.
IF itab_rec_data[] IS INITIAL.
MESSAGE e000(zhr) WITH text-006 .
ENDIF.
ENDFORM. " upload_data
*& Form bdc_update
text
--> p1 text
<-- p2 text
FORM bdc_update .
DATA: p0040 LIKE p0040 OCCURS 0 WITH HEADER LINE,
p0015 LIKE p0015 OCCURS 0 WITH HEADER LINE,
l_return LIKE bapireturn1,
l_pernr LIKE p0040-pernr,
l_begda(10),
l_endda(10).
DATA: options TYPE ctu_params.
CLEAR options .
options-dismode = ctumode.
options-updmode = cupdate.
options-cattmode = ' '.
options-defsize = 'X'.
options-racommit = 'X'.
options-nobinpt = ' '.
options-nobiend = ' '.
LOOP AT itab_rec_data.
REFRESH: bdcdata, itab_msgtab.
IF itab_rec_data-zz_status = '01' " Issued
OR itab_rec_data-zz_status = '03' " Worn Out
OR itab_rec_data-zz_status = '05'. " Employee left
REFRESH: p0040.
MOVE itab_rec_data-pernr TO l_pernr.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = l_pernr
infty = '0040'
TABLES
infty_tab = p0040
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF p0040[] IS INITIAL.
MOVE: 'E' TO itab_rec_data-stat.
text-e02 TO itab_rec_data-mstring.
MOVE: itab_rec_data-pernr TO itab_display_err-pernr,
itab_rec_data-lobnr TO itab_display_err-lobnr,
itab_rec_data-zz_reason TO itab_display-zz_reason,
itab_rec_data-zz_status TO itab_display-zz_status,
itab_rec_data-zz_remain TO itab_display_err-zz_remain,
text-e03 TO itab_display_err-mstring.
itab_display_err-etype = 'E'.
APPEND itab_display_err.
CLEAR: itab_display_err.
MODIFY itab_rec_data TRANSPORTING stat. " mstring.
ENDIF.
DELETE p0040 WHERE ( subty NE '9021' AND subty NE '9023' ).
IF p0040[] IS INITIAL.
MOVE: 'E' TO itab_rec_data-stat.
text-e02 TO itab_rec_data-mstring.
MOVE: itab_rec_data-pernr TO itab_display_err-pernr,
itab_rec_data-lobnr TO itab_display_err-lobnr,
itab_rec_data-zz_reason TO itab_display-zz_reason,
itab_rec_data-zz_status TO itab_display-zz_status,
itab_rec_data-zz_remain TO itab_display_err-zz_remain,
text-e04 TO itab_display_err-mstring.
itab_display_err-etype = 'E'.
APPEND itab_display_err.
CLEAR: itab_display_err.
MODIFY itab_rec_data TRANSPORTING stat. " mstring.
ENDIF.
LOOP AT p0040 WHERE lobnr = itab_rec_data-lobnr.
CONCATENATE p0040-begda6(2) '.' p0040-begda4(2) '.'
p0040-begda(4) INTO l_begda.
CONCATENATE p0040-endda6(2) '.' p0040-endda4(2) '.'
p0040-endda(4) INTO l_endda.
SELECT SINGLE * FROM zhr_loan_obj
WHERE reasoncode = itab_rec_data-zz_reason.
SELECT SINGLE * FROM zhr_loan_stat
WHERE statuscode = itab_rec_data-zz_status.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'RP50G-PERNR'
p0040-pernr.
PERFORM bdc_field USING 'RP50G-BEGDA'
l_begda.
PERFORM bdc_field USING 'RP50G-ENDDA'
l_endda.
PERFORM bdc_field USING 'RP50G-CHOIC'
'0040'.
PERFORM bdc_field USING 'RP50G-SUBTY'
p0040-subty.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MOD'.
PERFORM bdc_dynpro USING 'MP004000' '2000'.
PERFORM bdc_field USING 'P0040-ZZ_REASON'
zhr_loan_obj-description.
PERFORM bdc_field USING 'P0040-ZZ_STATUS'
zhr_loan_stat-description.
PERFORM bdc_field USING 'P0040-ZZ_REMAIN'
itab_rec_data-zz_remain.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'MP004000' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
CALL TRANSACTION v_tcode USING bdcdata
OPTIONS FROM options
MODE ctumode
UPDATE cupdate
MESSAGES INTO itab_msgtab.
IF sy-subrc = 0. "Success
MOVE: 'S' TO itab_rec_data-stat.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = l_pernr
IMPORTING
return = l_return.
IF sy-subrc NE 0.
MOVE: 'E' TO itab_rec_data-stat.
PERFORM process_list USING itab_rec_data-stat.
ELSE.
p0015-pernr = l_pernr.
p0015-subty = '6004'.
p0015-infty = '0015'.
p0015-begda = sy-datum.
p0015-endda = sy-datum.
p0015-betrg = itab_rec_data-zz_remain.
p0015-aedtm = sy-datum.
p0015-uname = sy-uname.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0015'
number = l_pernr
subtype = '6004'
validityend = sy-datum
validitybegin = sy-datum
record = p0015
operation = 'INS'
tclas = 'A'
dialog_mode = '1'
nocommit = 'X' "nocommit
IMPORTING
return = l_return
EXCEPTIONS
OTHERS = 0.
IF sy-subrc = 0.
COMMIT WORK.
MOVE: 'S' TO itab_rec_data-stat.
PERFORM process_list USING itab_rec_data-stat.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = l_pernr
IMPORTING
return = l_return.
ENDIF.
ELSE. "Error
MOVE: 'E' TO itab_rec_data-stat.
PERFORM process_list USING itab_rec_data-stat.
ENDIF.
PERFORM move_msgdata CHANGING itab_rec_data-stat
itab_rec_data-mstring.
IF itab_rec_data-stat = 'S'. " no errors found.
create infotype 0015
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = l_pernr
IMPORTING
return = l_return.
IF l_return-type = 'E'.
MOVE l_return-message TO itab_rec_data-mstring.
ELSE.
p0015-pernr = l_pernr.
p0015-subty = '6004'.
p0015-infty = '0015'.
p0015-begda = sy-datum.
p0015-endda = sy-datum.
p0015-betrg = itab_rec_data-zz_remain.
p0015-aedtm = sy-datum.
p0015-uname = sy-uname.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0015'
number = l_pernr
subtype = '6004'
validityend = sy-datum
validitybegin = sy-datum
record = p0015
operation = 'INS'
tclas = 'A'
dialog_mode = '1'
nocommit = 'X' "nocommit
IMPORTING
return = l_return
EXCEPTIONS
OTHERS = 0.
IF sy-subrc = 0.
COMMIT WORK.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = l_pernr
IMPORTING
return = l_return.
ENDIF.
ENDIF.
MODIFY itab_rec_data TRANSPORTING stat. " mstring.
CLEAR: l_begda, l_endda.
ENDLOOP.
IF sy-subrc <> 0.
MOVE: 'E' TO itab_rec_data-stat.
text-e02 TO itab_rec_data-mstring.
MOVE: itab_rec_data-pernr TO itab_display_err-pernr,
itab_rec_data-lobnr TO itab_display_err-lobnr,
itab_rec_data-zz_reason TO itab_display-zz_reason,
itab_rec_data-zz_status TO itab_display-zz_status,
itab_rec_data-zz_remain TO itab_display_err-zz_remain,
text-e02 TO itab_display_err-mstring.
itab_display_err-etype = 'E'.
APPEND itab_display_err.
CLEAR: itab_display_err.
MODIFY itab_rec_data TRANSPORTING stat. " mstring.
ENDIF.
ELSE.
MOVE: 'E' TO itab_rec_data-stat,
text-e01 TO itab_rec_data-mstring.
MODIFY itab_rec_data TRANSPORTING stat mstring.
ENDIF.
CLEAR: itab_rec_data.
ENDLOOP.
ENDFORM. " bdc_update
*& Form getfile_f4help
text
--> p1 text
<-- p2 text
FORM getfile_f4help .
****for upload file path.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = v_path
mask = v_mask
mode = v_mode
IMPORTING
filename = filename
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
ENDFORM. " getfile_f4help
*& Form fieldcat_init
text
--> p1 text
<-- p2 text
FORM fieldcat_init .
REFRESH itab_alv_fieldcat.
IF sy-ucomm NE '&REJECT' AND sy-ucomm NE '&SUCCESS'.
PERFORM fieldcat_write USING 'STAT' 'Status' space space 'X'.
ENDIF.
PERFORM fieldcat_write USING 'PERNR' 'Personnel No.' space
space space.
PERFORM fieldcat_write USING 'LOBNR' 'CSC ID' space space space.
PERFORM fieldcat_write USING 'ZZ_REASON' 'Reason' space space space.
PERFORM fieldcat_write USING 'ZZ_STATUS' 'Status' space space space.
PERFORM fieldcat_write USING 'ZZ_REMAIN' 'RV confirmed by TL'
space space space.
IF sy-ucomm = '&REJECT'.
PERFORM fieldcat_write USING 'ETYPE' 'Error Type' space space space.
PERFORM fieldcat_write USING 'MSTRING' 'Error Message' space space
space.
ENDIF.
ENDFORM. " fieldcat_init
*& Form fieldcat_write
text
-->field text
-->label text
-->key text
FORM fieldcat_write USING field
label
key
sum
icon.
DATA: l_alv_fieldcat TYPE slis_fieldcat_alv.
l_alv_fieldcat-fieldname = field.
l_alv_fieldcat-seltext_l = label.
l_alv_fieldcat-key = key.
l_alv_fieldcat-do_sum = sum.
l_alv_fieldcat-icon = icon.
APPEND l_alv_fieldcat TO itab_alv_fieldcat.
ENDFORM. " fieldcat_write
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
IF fval <> nodata.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
*& Form display_report
text
--> p1 text
<-- p2 text
FORM display_report .
itab_alv_layout-colwidth_optimize = 'X'.
itab_alv_layout-zebra = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'ALV_HEADER'
is_layout = itab_alv_layout
it_fieldcat = itab_alv_fieldcat
it_sort = itab_lt_sort
is_variant = v_stru_disvar
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = itab_display
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " display_report
*& Form alv_header
text
--> p1 text
<-- p2 text
FORM alv_header .
CLEAR: v_t_header.
MOVE sy-ucomm TO v_ucomm.
IF sy-ucomm = '&SUCCESS'.
v_header-typ = 'H'.
v_header-info = text-015.
APPEND v_header TO v_t_header.
CLEAR v_header.
v_header-typ = 'S'.
v_header-key = 'Success List'.
v_header-info = sy-repid.
APPEND v_header TO v_t_header.
CLEAR: v_header.
ELSEIF sy-ucomm = '&REJECT'.
v_header-typ = 'H'.
v_header-info = text-017.
APPEND v_header TO v_t_header.
CLEAR v_header.
v_header-typ = 'S'.
v_header-key = 'Error List'.
v_header-info = sy-repid.
APPEND v_header TO v_t_header.
CLEAR: v_header.
ELSE.
v_header-typ = 'H'.
v_header-info = text-016.
APPEND v_header TO v_t_header.
CLEAR v_header.
ENDIF.
Title
v_header-typ = 'H'.
v_header-info = 'Upload Program To Update Infotype 0040'.
APPEND v_header TO v_t_header.
CLEAR v_header.
Date
v_header-typ = 'S'.
v_header-key = 'Date / Time'.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) ' / '
sy-uzeit(2) ':'
sy-uzeit+2(2) ':'
sy-uzeit+4(2) INTO v_header-info. "todays
APPEND v_header TO v_t_header.
CLEAR: v_header.
*Program Name
v_header-typ = 'S'.
v_header-key = 'Program:'.
v_header-info = sy-repid.
APPEND v_header TO v_t_header.
CLEAR: v_header.
Run by
v_header-typ = 'S'.
v_header-key = 'Run by:'.
v_header-info = sy-uname.
APPEND v_header TO v_t_header.
CLEAR: v_header.
CASE v_ucomm.
WHEN '&ALLREC'.
v_header-typ = 'S'.
v_header-key = 'Records:'.
v_header-info = 'All'.
APPEND v_header TO v_t_header.
CLEAR: v_header.
DESCRIBE TABLE itab_display LINES v_ld_lines.
v_ld_linesc = v_ld_lines.
CONCATENATE 'Total No. of Records: ' v_ld_linesc
INTO v_t_line SEPARATED BY space.
v_header-typ = 'A'.
v_header-info = v_t_line.
APPEND v_header TO v_t_header.
CLEAR: v_header, v_t_line.
WHEN '&SUCCESS'.
v_header-typ = 'S'.
v_header-key = 'Records:'.
v_header-info = 'Successful'.
APPEND v_header TO v_t_header.
CLEAR: v_header.
DESCRIBE TABLE itab_display_suc LINES v_ld_lines.
v_ld_linesc = v_ld_lines.
CONCATENATE 'Total No. of Successful Records: ' v_ld_linesc
INTO v_t_line SEPARATED BY space.
v_header-typ = 'A'.
v_header-info = v_t_line.
APPEND v_header TO v_t_header.
CLEAR: v_header, v_t_line.
WHEN '&REJECT'.
v_header-typ = 'S'.
v_header-key = 'Records:'.
v_header-info = 'Rejected'.
APPEND v_header TO v_t_header.
CLEAR: v_header.
DESCRIBE TABLE itab_display_err LINES v_ld_lines.
v_ld_linesc = v_ld_lines.
CONCATENATE 'Total No. of Rejected Records: ' v_ld_linesc
INTO v_t_line SEPARATED BY space.
v_header-typ = 'A'.
v_header-info = v_t_line.
APPEND v_header TO v_t_header.
CLEAR: v_header, v_t_line.
WHEN OTHERS.
v_header-typ = 'S'.
v_header-key = 'Records:'.
v_header-info = 'All'.
APPEND v_header TO v_t_header.
CLEAR: v_header.
DESCRIBE TABLE itab_display LINES v_ld_lines.
v_ld_linesc = v_ld_lines.
CONCATENATE 'Total No. of Records: ' v_ld_linesc
INTO v_t_line SEPARATED BY space.
v_header-typ = 'A'.
v_header-info = v_t_line.
APPEND v_header TO v_t_header.
CLEAR: v_header, v_t_line.
ENDCASE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = v_t_header.
ENDFORM. " alv_header
*& Form SET_PF_STATUS
text
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STATUS' EXCLUDING rt_extab.
REFRESH: rt_extab.
IF p_test = 'X'.
APPEND '&ALLREC' TO rt_extab.
APPEND '&SUCCESS' TO rt_extab.
APPEND '&REJECT' TO rt_extab.
ENDIF.
SET PF-STATUS 'STATUS' EXCLUDING rt_extab.
ENDFORM. "SET_PF_STATUS
*& Form SET_PF_STATUS
text
FORM set_pf_status_s USING rt_extab TYPE slis_t_extab.
REFRESH: rt_extab.
IF p_test = 'X'.
APPEND '&ALLREC' TO rt_extab.
APPEND '&SUCCESS' TO rt_extab.
APPEND '&REJECT' TO rt_extab.
ENDIF.
SET PF-STATUS 'STATUS_SUCC' EXCLUDING rt_extab.
ENDFORM. "SET_PF_STATUS
*& Form SET_PF_STATUS
text
FORM set_pf_status_e USING rt_extab TYPE slis_t_extab.
REFRESH: rt_extab.
IF p_test = 'X'.
APPEND '&ALLREC' TO rt_extab.
APPEND '&SUCCESS' TO rt_extab.
APPEND '&REJECT' TO rt_extab.
ENDIF.
SET PF-STATUS 'STATUS_ERROR' EXCLUDING rt_extab.
ENDFORM. "SET_PF_STATUS
*& Form user_command
text
-->R_UCOMM text
-->RS_SELFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
itab_alv_layout-colwidth_optimize = 'X'.
itab_alv_layout-zebra = 'X'.
v_ucomm = r_ucomm.
CASE r_ucomm.
WHEN '&ALLREC'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'ALV_HEADER'
is_layout = itab_alv_layout
it_fieldcat = itab_alv_fieldcat
it_sort = itab_lt_sort
is_variant = v_stru_disvar
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = itab_display
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
WHEN '&SUCCESS'.
REFRESH itab_display_suc.
itab_display_suc[] = itab_display[].
DELETE itab_display_suc WHERE stat <> icon_green_light.
PERFORM fieldcat_init.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS_S'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'ALV_HEADER'
is_layout = itab_alv_layout
it_fieldcat = itab_alv_fieldcat
it_sort = itab_lt_sort
is_variant = v_stru_disvar
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = itab_display_suc
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
WHEN '&REJECT'.
REFRESH itab_display_err.
itab_display_err[] = itab_display[].
DELETE itab_display_err WHERE stat <> icon_red_light.
PERFORM fieldcat_init.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS_E'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'ALV_HEADER'
is_layout = itab_alv_layout
it_fieldcat = itab_alv_fieldcat
it_sort = itab_lt_sort
is_variant = v_stru_disvar
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = itab_display_err
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDCASE.
ENDFORM. "user_command
text
--> p1 text
<-- p2 text
FORM move_msgdata CHANGING p_stat p_mstring.
DATA: l_mstring(255).
CLEAR: p_stat, p_mstring.
LOOP AT itab_msgtab WHERE msgtyp = 'E'.
SELECT SINGLE * FROM t100 WHERE sprsl = itab_msgtab-msgspra
AND arbgb = itab_msgtab-msgid
AND msgnr = itab_msgtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH itab_msgtab-msgv1 INTO p_mstring.
REPLACE '&2' WITH itab_msgtab-msgv2 INTO p_mstring.
REPLACE '&3' WITH itab_msgtab-msgv3 INTO p_mstring.
REPLACE '&4' WITH itab_msgtab-msgv4 INTO p_mstring.
ELSE.
REPLACE '&' WITH itab_msgtab-msgv1 INTO p_mstring.
REPLACE '&' WITH itab_msgtab-msgv2 INTO p_mstring.
REPLACE '&' WITH itab_msgtab-msgv3 INTO p_mstring.
REPLACE '&' WITH itab_msgtab-msgv4 INTO p_mstring.
ENDIF.
CONDENSE l_mstring.
CONCATENATE p_mstring l_mstring INTO p_mstring SEPARATED BY space.
ENDIF.
CLEAR: itab_msgtab, l_mstring.
ENDLOOP.
IF sy-subrc = 0.
CONDENSE p_mstring.
p_stat = 'E'.
ELSE.
p_stat = 'S'.
ENDIF.
ENDFORM. " move_msgdata
*& Form process_display
text
--> p1 text
<-- p2 text
FORM process_display .
LOOP AT itab_rec_data.
MOVE: itab_rec_data-pernr TO itab_display-pernr,
itab_rec_data-lobnr TO itab_display-lobnr,
itab_rec_data-zz_reason TO itab_display-zz_reason,
itab_rec_data-zz_status TO itab_display-zz_status,
itab_rec_data-zz_remain TO itab_display-zz_remain,
itab_rec_data-mstring TO itab_display-mstring.
CASE itab_rec_data-stat.
WHEN 'S'.
MOVE icon_green_light TO itab_display-stat.
WHEN 'E'.
MOVE icon_red_light TO itab_display-stat.
WHEN OTHERS.
MOVE icon_yellow_light TO itab_display-stat.
ENDCASE.
APPEND itab_display.
CLEAR: itab_rec_data, itab_display.
ENDLOOP.
ENDFORM. " process_display
*& Form status_indicator
text
--> p1 text
<-- p2 text
FORM status_indicator .
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = 50
text = text-s11.
ENDFORM. " status_indicator
*& Form process_list
text
-->P_STAT text
FORM process_list USING p_stat.
DATA: v_info LIKE einfo.
DATA: st_return LIKE bapireturn.
CASE p_stat.
WHEN 'S'.
MOVE: itab_rec_data-pernr TO itab_display_suc-pernr,
itab_rec_data-lobnr TO itab_display_suc-lobnr,
itab_rec_data-zz_reason TO itab_display-zz_reason,
itab_rec_data-zz_status TO itab_display-zz_status,
itab_rec_data-zz_remain TO itab_display_suc-zz_remain,
itab_rec_data-mstring TO itab_display_suc-mstring.
APPEND itab_display_suc.
CLEAR itab_display_suc.
WHEN 'E'.
LOOP AT itab_msgtab.
MOVE: itab_rec_data-pernr TO itab_display_err-pernr,
itab_rec_data-lobnr TO itab_display_err-lobnr,
itab_rec_data-zz_reason TO itab_display-zz_reason,
itab_rec_data-zz_status TO itab_display-zz_status,
itab_rec_data-zz_remain TO itab_display_err-zz_remain.
CLEAR v_info.
v_info-msgid = itab_msgtab-msgid.
v_info-msgty = itab_msgtab-msgtyp.
itab_display_err-etype = itab_msgtab-msgtyp.
v_info-msgno = itab_msgtab-msgnr.
v_info-msgv1 = itab_msgtab-msgv1.
v_info-msgv2 = itab_msgtab-msgv2.
v_info-msgv3 = itab_msgtab-msgv3.
v_info-msgv4 = itab_msgtab-msgv4.
CALL FUNCTION 'MESSAGE_GET_TEXT'
EXPORTING
ieinfo = v_info
ilangu = 'E'
IMPORTING
etext = st_return-message
EXCEPTIONS
no_t100_found = 1
OTHERS = 2.
itab_display_err-mstring = st_return-message.
APPEND itab_display_err.
CLEAR: itab_display_err.
ENDLOOP.
ENDCASE.
ENDFORM. "process_listHi,
R U working without the functional, see once you lock the payroll area then you cant update Payroll Infotypes...as you have in production it is locked hence you cant update infotype 15. I guess the payroll area is not locked in Dev and Quality therefor it allows you to update infotype 15.
Do one thing create a function module in update task to update infotype 40 and 15.. hence it will take care of updating both the infotype together.. or else not.
Regards,
Bhawanidutt. -
hi
I have to do bdc for infotype 581. The manual senario for this is after entering data in 581 and if i click save button it will save the data and it will go to infotype 8 screen. There it will populate the hra and value in wagetype and amount automatically. i will save that too.
but when i did this in bdc, after entering the data in 581 and clicking the save button it is not going to infotype 8 screen.
how can i store that hra in infotype 8 for that particular PERNR.
pls send the solutions for this
thanks in advance to all who will helpHi,
When you are using BDC it will skip infotype 8. You should again upload infotype 8 for HRA.
Regards,
Ramu N. -
BDC for infotype 591??
HI
Can any1 send me BDC for infotype 591..had trouble with table control!!
Points will b suitably rewarded!!
Regards
GunjanHi Gunajn,
I am not connected to SAP now .. but this program should be fairly simple.. Use the function module GUI_UPLOAD or the other available OO methods to get your EXECL file into an internal table. loop at this table fill the p0591 record structure first say
p0591-pernr = itab-pernr.
p0591-infty = '0591'.
p0591-begda = itab-begda.
p0591-endda = itab-endda.
and so on fill up whatvevr fields you want, and then update infotype 0591 using std function module
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0591'
number = itab-pernr
record = p0591
validityend = p0591-endda
validitybegin = p0591-begda
operation = 'INS'
tclas = 'A'
importing
return = rec_return.
the structure rec_return will help you trap errors if any. Start on these lines and paste your code if you still have issues. Your issue will sure be resolved on this forum.
Regards,
Suresh Datti.
Message was edited by: Suresh Datti -
HR ABAP Query - Simulated infotypes 2501 and 2502
Dear all,
I am developing a report based on Simulated infotypes 2502 (Quota Statuses) and 2501 (Employee Time and Labor).
Since my report provides an overview of all the reporting quota types and reporting time type to the end-user, I need to extract data from both the infotypes ( 2501 & 2502 ) simultaneously.
I created a report with (Logical Data Base) LDB PNP and the HR report category is also set as required. In other words the attributes is set as same as in standard report (RPTBAL00).
In the declaration part of the program I mentioned the source code as.
INFOTYPES:
*-----Infotypen
INFOTYPES:
0001, "Org. Zuordnung
2001, "Absence type.
2002, "Attendance
2500, "Personal Work Schedule (Simulated Infotype 2500)
2501, "Employee Time and Labor (Simulated Infotype 2501)
2502. "Quota Statuses (Simulated Infotype 2502)
In the START-OF-SELECTION.
GET PERNR *
GET pernr. (break point set at statement)
Here my problem is when I execute the report for multiple employees data from simulated Infotype 2501 is deriving wrongly. The data for the first employee will always correct. From the second employee onwards date fields BEGDA and ENDDA will be 00000000. After a detailed debugging (setting break point at GET PERNR statement) I found that the problem is occurring only with Infotype 2501 values and not with Infotype data 2502.
I also note that this will happen only when I use both 2501 and 2502 at same time in the declaration part
INFOTYPES:
2501, "Employee Time and Labor (Simulated Infotype 2501),
2502. "Quota Statuses (Simulated Infotype 2502)
Question is How to correct this date field values obtained through GET PERNR for Infotype 2501 when using both infotypes 2501 and 2502 simultaneously.
Per requests for testing this is:
I. Your system should be configured for reporting time types.
II. Time evaluation should be run for at least one time to transfer data to simulated infotypes.
III. Persons with less understanding of SAP HCM may have to take help of a functional consultant.
Please help me in with your valuable suggestions:Thanks a lot for all your suggestions,
I have tested with this still the same problem persists.
From the second employee onwards the value of P2501-begda and P2501-endda is 00000000.
Step 1: create a new program zhr_test.
Step 2: Assign PNP as the logical data base in the report attributes.
Step 3: Use XXXX2001 as report category.
Code for TEST 1: normal test case
REPORT zhr_test.
TABLES :pernr.
INFOTYPES:
2501, "Employee Time and Labor (Simulated Infotype 2501),
2502. "Quota Statuses (Simulated Infotype 2502)
START-OF-SELECTION.
GET pernr.
BREAK-POINT.
Code for TEST 2: suggeated by Venkat.O
REPORT zhr_test.
TABLES :pernr.
INFOTYPES:
2501 MODE n, "Employee Time and Labor (Simulated Infotype 2501),
2502 MODE n. "Quota Statuses (Simulated Infotype 2502)
START-OF-SELECTION.
GET pernr.
rp_read_all_time_ity pn-begda pn-endda.
BREAK-POINT.
In Both the cases, infotype 2501 records begda and endda values will be 00000000 from second employee.
You can test only if you have simulated infotypes configured in your system, atleast one time the time evaluation would have been run.
Thanks
Cibin -
Dear all,
I am new in SAP HR. I apologize if the question is oversimplified.
I am trying to upload master data for infotype 0 and 1 using LSMW. I have successful foreground and background uploads, however the uploaded information could not be shown in PA30 when I crosschecked my uploads.
At first I thought there was problem with my recording. But I could not find any errors on that. Could anyone kindly help me with this matter?
Many thanks in advance.
Foong MingI used external number range for the ease of upload.
I tried both foreground and background upload with 3 employees. Both uploaded successfully, but I cant find the number range in PA30.
Then I checked saving records, and redo for 3 times new recording with upload trials. All successfully uploaded, but no record found in PA30. Upload log recorded successful upload.
I wonder if there is other method to check the log report besides SM35, and why the uploads are successful yet no records in the system.
Thanks
Foong Ming
Edited by: Foongming on Mar 16, 2010 2:33 AM -
ABAP-HR Name of the BADI which updates merit salary in infotype 759 and 15.
Hi Friends,
I want the name of BADI which updates merit lump sum in infotype 15 .
Example 1.
Employees base pay = 34,000
Merit increase amount = 1,500
Employees Salary Range = 25,000 35,000.(This is taken from T710)
IT0759 STXX Pick-up subtypes related to the following plans (MSST, ,MSWH, MSPA, MSAN) = 1,000
IT0015 ST E408 Merit Lump Sum = 500.
In the above example out of 15000(Merit increase amount). 1000 will get updated
in infotype 759. and 500 wll be updated in Infotype 0015.
Question. Which enhancement does this operation. there is BADI called HRPAD00INFTY but this can update only one infotype at one point of time
because new_innnn-infty is a structure which holds only one Infotype at run time.
I would be greateful for this information.Hi,
Try HRECM00_GDEGP
other way
Implement this BAdI HRECM00_CONSISTENCY in SE19 & put your validations in the method CHECK_CONSISTENCY .. You will have to use the function module HR_ECM_ADD_MESSAGE to fill your messages & show it on the front end
<b>Reward points</b>
Regards -
Dear All,
is there any possibility to charge the travel expenses of the employee to a cost center that doesnu2019t belong to the company code where the employee is engaged? This is the case of an employee that is engaged in one country (e.g. Italy) and work for another company (cross border, e.g Germany).
Using the infotypes 0017 and 0027 Iu2019m able to assign a CC related to a different company code (and controlling area), but as expecting Iu2019m facing issue when I run the FI accounting programu2026
Could you provide more details about those infotypesUsing the infotype 0017 Iu2019m facing a blocking error related to Tax code.
Seems that this error is generated due to a check that the system is performing between company code identified to be posted the expenses (coming from infotype 17, in the example Italy) and the company code where the employee is engaged. In fact the tax code is created only for Italy while the company code to be posted is Germany.
So if there is a way to allow to the system to propose to Italian employee the Germany trip variant, I will skip the error since the Germany expenses will have the correct Tax code. -
Cost Distribution - Infotype 0027 and 1018 cost distri in OM
Hi All,
Whats the difference in functionality between assigning cost center in
"Cost Distribution - Infotype 0027 and 1018 cost distri in OM"
One in employee leven and 2nd in position level, but the concept is same i think,
Also if we assign cost center in department wise, can we identify the cost in individual employee level?
help
RxHi Rx,
There is no difference.
The system reads cost data by following path:
1. read IT 0027
2. if not found in IT 0027, read IT 1018
3. if not fount in IT 1018, read IT 0001
So, yes it is possible to overwrite IT 1018 via IT 0027.
Cheers! -
Infotype 105 and 0006 not transferred through ALE
Hi all,
I am sending organisation data (infotype 1000, 1001, 1002, 1003, 1008) & personal data (infotype 0000, 0001, 0002, 0006, 0105) from one SAP system ( ECC 5 ) to another ( ECC 6 ). using ALE and i used message type HRMD_A and idoc type is HRMD_A06 , in that process all my infotype data in moving properly except infotype 0006 and 0105. i am getting IDOC status 52 ( Application document not fully posted) in receiving system. both the infotype (0006,0105) has subtype & i have included respective subtype in distributed model.
can any one tell what could be reason. pleasae help
Thanks,
Madhusolved by own.
-
Can we create a single bdc for raw materials , and for some other transacti
hi
can we create a single bdc for raw materials , and for some other transaction? how?Hi Jyothsna
For one transaction you will have to build your bdc table according to the recording for that transaction and then call that transaction using the bdc table. For another transaction , you will again have to build the bdc table with the details of that transaction.
You cannot call all at one shot.
Cheers
shivika -
I hav to upload bdc for vk11 trans and table konv.
hi experts,
i m new in BDC... i hav to upload bdc for vk11 trans and table konv.
frst doubt is
i hv to run shdb transc?? or just i hv to write program??
nd cn any1 send me teps as hw to create upload..
Condition Type Sales Organisation Distribution channel Material Price Unit Valid from Valid to
KSCHL VKORG VTWEG MATNR_01 KBETR_01 KPEIN_01 DATAB_01 DATBI_01
now plz tel me hw to do this...whether to run shdb or jus to write program in se38..
or i hv to do both...bt plz tel me step by stepPlease don't ignore the warnings. Read the rules of engagement.
Thread locked, again.
Thomas
wrking on ABAP OOPS, oput is coming but 1 field name wd customer name is nt -
Infotypes 0016 and 0019 stand for?
Hello HCMers,
What are infotypes 0016 and 0019 stand for?
Also What is significance of fields P0016-ENDDA and P0019-TERMN,P0019-TMART in Views P0016 & P0019 respectively?
Could some body please elobarate where its usedIT 0016 is for contract types. It defines what kind of contract the employee has with the company for ex Regular, Contractor etc
IT 0019 is Monitoring of tasks. Suppose you want to define the probation period. You create a subtype here for Probation and also specify when the probation ends P0019-TERMN.
hope this helps
Ajay -
LSMW : INFOTYPE 0066 and 0067
Hi All,
I am working on LSMW for following Infotype
0066 - Garnishments/Cession Order and
0067 - Garnishment Debt.
In PA30 when i update the infotype 0066 it automatically goes to Infotype 0067 (i.e to next screen) , but while recording in LSMW after updating infotype 0066 it dosent go to infotype 0067. As per PA30 process it should go to next screen i.e infotype 0067. but in case of recording it directly comes out of recording of infotype 0066 and save it and doesn't go to infotype 0067.
can anyone answer this?
Regards,
Archana.Hi Archana,
Some times it occurs thorugh LSMW.
I think it not a issue. First you can upload the data 0066.
Then again second recording you can upload the data 0067.
Thanks and Regards,
Revathi.
Maybe you are looking for
-
Can I know the name, type, total number of column in Record Group?
I created a record group with query dynamically. And then populated it. I don't know the column' count, type, name befause I get the query from user at runtime. Can I know the name, type, total number of column in Record Group?
-
URGENT- problem in detecting audio device using JMF in WIndows7 - 64 bit
Hi, I am trying to detect the audio device in windows 7 -64 bit OS, using JMF API with JRE 1.6.18.But it showing zero device found.below i have mentioned the source code that i have used.please suggest how to solve this , thanks in advance. import ja
-
Am I going crazy or is the "MacBook Pro" name/logo which is located under the display, a sticker. Just today I was wiping some dust off the screen, and the 'c' in 'Mac' came halfway off. I managed to stick it back on, but now I afraid that the rest o
-
I was changing my Home page's Master Page, so I went to the advanced mode via SharePoint designer and changed the Master Page line, then that happened! I tried to export and Import the Home.aspx but same?!
-
After installing the lightroom CC update, PS and Bridge reported they had updates. When trying to update I get the error U43M1D204 and it fails. Retried for two days now and still cannot get it to work. Tried removing PS and Bridge but there is no