Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

JDBC-RFC no errors at XI BOX still records were not update at Target system

hi

am doing jdbc to rfc scenario

.

tested rfc at target R/3 and its working fine,but records were not being updated in jdbc-rfc scenario.

i can see the audit log as success but no record is inserted at the target system

think problem is at FM.

please look at my FM code.

FUNCTION zscp_fm_inb_task_act_eff_updat .

*"----


""Local Interface:

*" TABLES

*" IT_TASK_DATA STRUCTURE ZSCP_S_TASK_EFFORT

*"----


DATA : v_taskguid TYPE bapi_ts_guid-task_guid,

is_task TYPE bapi_ts_task,

is_task_upd TYPE bapi_ts_task_upd,

is_return TYPE TABLE OF bapiret2 WITH HEADER LINE.

*DATA : BEGIN OF it_data OCCURS 0,

  • project TYPE zspr_project_id,

  • task_id TYPE cgpl_entity-external_id,

  • act_work TYPE dpr_tv_act_work,

  • guid TYPE dpr_task-guid,

  • END OF it_data.

DATA : BEGIN OF it_task_eff OCCURS 0,

project TYPE zspr_project_id,

guid TYPE dpr_task-guid,

act_work TYPE dpr_tv_act_work,

END OF it_task_eff.

DATA : BEGIN OF it_report OCCURS 0,

msgtype(1),

project TYPE zspr_project_id,

task_id(24),

msg(250),

END OF it_report.

DATA : l_taskguid TYPE dpr_task-guid.

DATA : v_begintmstamp(20) TYPE c,

v_endtmstamp(20) TYPE c.

*ranges : r_taskguid for l_taskguid.

DATA : v_tabix TYPE sy-tabix.

DATA : it_dpr_task TYPE STANDARD TABLE OF dpr_task,

wa_dpr_task TYPE dpr_task.

*data : l_taskguid type BAPI_TS_GUID-TASK_GUID.

DATA : flg_no_flg TYPE c.

DATA : l_task(24),

flg_error TYPE c.

DATA : l_taskdetail TYPE bapi_ts_task_detail,

l_retdetail TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.

DATA : v_count TYPE i.

DATA curr_date TYPE sy-datum.

DATA curr_time TYPE sy-uzeit.

CONCATENATE sy-datum sy-uzeit INTO v_begintmstamp.

  • DELETE it_data WHERE act_work < 0.

DELETE it_task_data WHERE act_work_effort < 0.

IF it_task_data IS NOT INITIAL.

  • LOOP AT it_task_data.

    • v_tabix = sy-tabix.

*

    • CALL FUNCTION 'CONVERSION_EXIT_DPRCE_INPUT'

    • EXPORTING

    • input = it_task_data-task_id

    • IMPORTING

    • output = it_task_eff-guid.

*

  • it_task_eff-guid = it_task_data-task_id.

  • it_task_eff-project = it_task_data-project_id.

  • it_task_eff-act_work = it_task_data-act_work_effort * 60 * 60.

    • MODIFY it_data INDEX v_tabix.

  • APPEND it_task_eff.

  • CLEAR: it_task_eff, it_task_data.

  • ENDLOOP.

LOOP AT it_task_data.

it_task_data-act_work_effort = it_task_data-act_work_effort * 60 * 60.

MODIFY it_task_data.

CLEAR it_task_data.

ENDLOOP.

SELECT *

FROM dpr_task

INTO TABLE it_dpr_task

FOR ALL ENTRIES IN it_task_data

WHERE guid = it_task_data-guid.

*Begin Commented by Aparna/25/01/2007 so that all the tasks are updated irrespective the planned efforts are filled or not.

  • and

  • work_effort > 0.

*End

  • IF sy-subrc <> 0.

  • MESSAGE e000 WITH 'No data selected to update'.

  • ENDIF.

IF sy-subrc = 0.

curr_date = sy-datum.

curr_time = sy-uzeit.

LOOP AT it_dpr_task INTO wa_dpr_task.

CLEAR it_task_eff.

READ TABLE it_task_data WITH KEY guid = wa_dpr_task-guid.

IF sy-subrc = 0.

wa_dpr_task-act_work_effort = it_task_data-act_work_effort.

wa_dpr_task-act_work_unit = 'S'.

wa_dpr_task-zzupdated_date = curr_date.

wa_dpr_task-zzupdated_time = curr_time.

CLEAR wa_dpr_task-flg_man_rem_work.

MODIFY it_dpr_task FROM wa_dpr_task TRANSPORTING act_work_effort act_work_unit flg_man_rem_work zzupdated_date zzupdated_time.

ENDIF.

CLEAR wa_dpr_task.

ENDLOOP.

DESCRIBE TABLE it_dpr_task LINES v_count.

ENDIF.

ENDIF.

IF it_dpr_task IS NOT INITIAL.

*{17Sep2007 Refresh all tasks before updating the efforts

UPDATE dpr_task SET act_work_effort = 0

WHERE version_number EQ space.

*}17Sep2007 Refresh all tasks before updating the efforts

UPDATE dpr_task FROM TABLE it_dpr_task.

ENDIF.

ENDFUNCTION.

Former Member
Not what you were looking for? View more on this topic or Ask a question