2
7/21/2019 ZLGP003 Start Event http://slidepdf.com/reader/full/zlgp003-start-event 1/2 ************************************************************************ * Finding the user-exits of a SAP transaction code * * * * Enter the transaction code in which you are looking for the user-exit* * and it will list you the list of user-exits in the transaction code. * * Also a drill down is possible which will help you to branch to SMOD. * * * * Written by : SAP Basis, ABAP Programming and Other IMG Stuff * * http://www.sap-img.com * ************************************************************************ REPORT zprocura_exit NO STANDARD PAGE HEADING. DATA: v_objkey LIKE sweinstcou-objkey. ***** Declarações de tabelas internas para WF. DATA: BEGIN OF it_container OCCURS 0.  INCLUDE STRUCTURE swcont. DATA: END OF it_container. DATA BEGIN OF applicant.  INCLUDE STRUCTURE swhactor. DATA END OF applicant. * Container Set Element DEFINE swc_set_element.  call function 'SWC_ELEMENT_SET'  exporting  element = &2  field = &3  tables  container = &1  exceptions  others = 1. END-OF-DEFINITION. PARAMETERS: p_codmod LIKE /pws/zycet033-codmod. PARAMETERS: p_nrseq LIKE /pws/zycet033-nrseq. PARAMETERS: p_nradto LIKE /pws/zycet033-nradto. PARAMETERS: p_despa LIKE /pws/zycet033-despach. PARAMETERS: p_nrpres LIKE /pws/zycet033-nrpres. START-OF-SELECTION.  BREAK-POINT.  CONCATENATE p_codmod p_nrseq p_nradto p_despa p_nrpres INTO v_objkey.  applicant-otype = 'US'.  applicant-objid = sy-uname.  swc_set_element it_container 'CODMOD' p_codmod.  swc_set_element it_container 'NRSEQ' p_nrseq.  swc_set_element it_container 'NRADTO' p_nradto.  swc_set_element it_container 'DESPACH' p_despa.  swc_set_element it_container 'NRPRES' p_nrpres. ***** Startup do workflow.  CALL FUNCTION 'SWE_EVENT_CREATE'

ZLGP003 Start Event

Embed Size (px)

DESCRIPTION

ZLGP003-Start Event.txt

Citation preview

Page 1: ZLGP003 Start Event

7/21/2019 ZLGP003 Start Event

http://slidepdf.com/reader/full/zlgp003-start-event 1/2

************************************************************************* Finding the user-exits of a SAP transaction code ** ** Enter the transaction code in which you are looking for the user-exit** and it will list you the list of user-exits in the transaction code. ** Also a drill down is possible which will help you to branch to SMOD. ** ** Written by : SAP Basis, ABAP Programming and Other IMG Stuff ** http://www.sap-img.com *************************************************************************

REPORT zprocura_exit NO STANDARD PAGE HEADING.

DATA: v_objkey LIKE sweinstcou-objkey.

***** Declarações de tabelas internas para WF.DATA: BEGIN OF it_container OCCURS 0.  INCLUDE STRUCTURE swcont.DATA: END OF it_container.DATA BEGIN OF applicant.  INCLUDE STRUCTURE swhactor.DATA END OF applicant.* Container Set ElementDEFINE swc_set_element.

  call function 'SWC_ELEMENT_SET'  exporting  element = &2  field = &3  tables  container = &1  exceptions  others = 1.END-OF-DEFINITION.

PARAMETERS: p_codmod LIKE /pws/zycet033-codmod.PARAMETERS: p_nrseq LIKE /pws/zycet033-nrseq.

PARAMETERS: p_nradto LIKE /pws/zycet033-nradto.PARAMETERS: p_despa LIKE /pws/zycet033-despach.PARAMETERS: p_nrpres LIKE /pws/zycet033-nrpres.

START-OF-SELECTION.

  BREAK-POINT.

  CONCATENATE p_codmod p_nrseq p_nradto p_despa p_nrpres INTO v_objkey.

  applicant-otype = 'US'.  applicant-objid = sy-uname.

  swc_set_element it_container 'CODMOD' p_codmod.  swc_set_element it_container 'NRSEQ' p_nrseq.  swc_set_element it_container 'NRADTO' p_nradto.  swc_set_element it_container 'DESPACH' p_despa.  swc_set_element it_container 'NRPRES' p_nrpres.

***** Startup do workflow.  CALL FUNCTION 'SWE_EVENT_CREATE'

Page 2: ZLGP003 Start Event

7/21/2019 ZLGP003 Start Event

http://slidepdf.com/reader/full/zlgp003-start-event 2/2

  EXPORTING  objtype = 'ZBUSLGP001'  objkey = v_objkey  event = 'CREATED'  creator = applicant  start_with_delay = ' '  TABLES  event_container = it_container  EXCEPTIONS  objtype_not_found = 1  OTHERS = 2.

  IF sy-subrc = 0.  COMMIT WORK.  MESSAGE s000(zhr001) WITH  'Solicitação foi enviada para aprovação !'.  ELSE.  ROLLBACK WORK.  MESSAGE e000(zhr001) WITH  'Erro ao submeter solicitação à aprovação!'.  ENDIF.

END-OF-SELECTION.