Skip to Content

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

Urgent Issue regarding Performance

REPORT /dceur/z_ais_api_link

MESSAGE-ID /dceur/z_go_msg

LINE-SIZE 190

LINE-COUNT 65.

----


  • Start of processing

----


PERFORM prepare_and_call_action.

&----


*& Form prepare_and_call_action

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM prepare_and_call_action.

DATA:tb_apivehque TYPE /dceur/apivehque OCCURS 0 WITH HEADER LINE,

tb_vlcdiavehi TYPE vlcdiavehi OCCURS 0 WITH HEADER LINE,

wa_vlcactdata TYPE vlcactdata,

wa_apivehque LIKE LINE OF tb_apivehque.

DATA : BEGIN OF tb_vlcvehicle OCCURS 0,

zz_commnos LIKE vlcvehicle-zz_commnos,

vhcle LIKE tb_apivehque-vhcle,

vguid LIKE vlcvehicle-vguid,"pradhanv tkt 5592442

END OF tb_vlcvehicle. "SRIVASD

CONSTANTS: co_zfot(4) TYPE c VALUE 'ZFOT'.

  • Begin of insertion by PRADHANV tkt-5592442 DC1K947161 on 14.08.2007.

daTA: wf_vguid TYPE vlcvehicle-vguid.

  • End of insertion by PRADHANV tkt-5592442 DC1K947161 on 14.08.2007.

CLEAR: tb_apivehque,

tb_vlcdiavehi,

tb_vlcvehicle, "SRIVASD

wa_vlcactdata.

REFRESH: tb_apivehque,

tb_vlcdiavehi.

SELECT * FROM /dceur/apivehque INTO TABLE tb_apivehque.

  • begin of insertion for DC1K905147 by SRIVASD on 06.12.2005.

  • Fetch the vehicle data on internal no.

SELECT zz_commnos vhcle vguid "pradhanv tkt 5592442

FROM vlcvehicle

INTO TABLE tb_vlcvehicle

FOR ALL ENTRIES IN tb_apivehque

WHERE vhcle = tb_apivehque-vhcle.

LOOP AT tb_apivehque INTO wa_apivehque.

READ TABLE tb_vlcvehicle WITH KEY vhcle = wa_apivehque-vhcle.

IF tb_vlcvehicle-zz_commnos IS INITIAL.

wa_apivehque-z_commnos = ' '.

MODIFY tb_apivehque FROM wa_apivehque TRANSPORTING z_commnos.

ENDIF.

ENDLOOP.

LOOP AT tb_apivehque INTO wa_apivehque.

DELETE FROM /dceur/apivehque WHERE vhcle = wa_apivehque-vhcle.

  • Modifying database table from workarea.

MODIFY /dceur/apivehque FROM wa_apivehque.

IF sy-subrc = 0.

COMMIT WORK.

ENDIF.

ENDLOOP.

  • end of insertion for DC1K905147 by SRIVASD on 06.12.2005.

  • Deleting the entries in Q-table where commision no is blank.

DELETE tb_apivehque WHERE z_commnos EQ space.

SORT tb_apivehque BY z_timestamp DESCENDING.

LOOP AT tb_apivehque. "SRIVASD on 13.12.2005

*fetching vehicle data into tb_vlcdiavehi

  • Begin of Ins: DC1K939919 Rels 2.01 on 26-01-2007 by Tiramarb

  • CALL FUNCTION 'VELO03_GET_SINGLE_VEHICLE'

  • EXPORTING

  • selvhcle_iv = tb_apivehque-vhcle

  • TABLES

  • vlcdiavehi_et = tb_vlcdiavehi

  • EXCEPTIONS

  • vehicle_not_found = 1

  • OTHERS = 2.

  • Begin of insertion by PRADHANV tkt-5592442 DC1K947161 on 14.08.2007.

CLEAR: wf_vguid.

READ TABLE tb_vlcvehicle WITH KEY vhcle = tb_apivehque-vhcle.

wf_vguid = tb_vlcvehicle-vguid.

*--> Locking the vehicle as to not to change the vehicle data during

*--> the preparation of the data for the action.

CALL FUNCTION 'ENQUEUE_E_VLCVEHICLE'

EXPORTING

mode_vlcvehicle = 'E'

mandt = sy-mandt

vguid = wf_vguid

x_vguid = ' '

_scope = '2'

_wait = ' '

_collect = ' '

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc <> 0.

*--> Continue for further processing.

CONTINUE.

ENDIF.

  • End of insertion by PRADHANV tkt-5592442 DC1K947161 on 14.08.2007.

CALL FUNCTION '/DCEUR/Z_VDF_ACTION_PREP'

EXPORTING

wf_vhcle = tb_apivehque-vhcle

wf_action = co_zfot

TABLES

tb_list_of_vehicles = tb_vlcdiavehi

CHANGING

wa_vlcactdata = wa_vlcactdata

EXCEPTIONS

no_data_given = 1

no_vehicle_found = 2

action_not_defined = 3

interlinked_action_error = 4

OTHERS = 5.

IF sy-subrc <> 0.

MESSAGE i999 WITH 'Error getting vehicle rec.' sy-subrc.

CONTINUE.

ENDIF.

  • End of Ins: DC1K939919 Rels 2.01 on 26-01-2007 by Tiramarb

  • Begin of insertion by PRADHANV tkt-5592442 DC1K947161 on 14.08.2007.

CALL FUNCTION 'VELO09_VEHICLE_DEQUEUE'

TABLES

vlcdiavehi_it = tb_vlcdiavehi .

  • End of insertion by PRADHANV tkt-5592442 DC1K947161 on 14.08.2007.

CALL FUNCTION 'VELO09_SET_ACTION'

EXPORTING

incoming_action_iv = 'ZFOT'

commit_iv = 'S'

TABLES

vlcdiavehi_ct = tb_vlcdiavehi

CHANGING

vlcactdata_cs = wa_vlcactdata

EXCEPTIONS

action_not_defined = 1

no_authority = 2

interlinked_action_error = 3

crea_prepare_failed = 4

action_not_performed = 5

action_not_compl_performed = 6

OTHERS = 7.

IF sy-subrc <> 0.

MESSAGE i999 WITH 'Error while executing action: ' sy-subrc.

ENDIF.

ENDLOOP.

ENDFORM. " prepare_and_call_action

In the above code ,to execute it its taking a lot of time.I need to reduce its run time.I request you to suggest the changes to make so that it takes less time to execute that.Its very urgent.plzz post your valuable suggestions ASAP.

Thanks and Regards,

Jaya.

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