SlideShare uma empresa Scribd logo
1 de 7
Essential
                    SAP Tutorial
         SAP ABAP Tips:
Debugging a Background Task in SAP
        Business Workflow
        By Vadzim Khlystun
                1             Copyrighted 2012 by LeverX, Inc.
Tutorial Goal
  Sometimes while testing SAP Workflow you need to debug ABAP
   code in a method used in on of the background tasks. Just setting
   a break-point in this method won’t work since background task is
   executed in another context in background. Fortunately, there is a
   workaround exits which can be used to debug this scenario.
  Be careful when using this technique because it based on
   causing an infinite loop in ABAP stack and can hang up SAP
   system if used improperly.




                                 2                        Copyrighted 2012 by LeverX, Inc.
Step 1
   Add following
    code at the           DATA lv_exit.
    beginning of           DO.
    the method
    you want to             IF lv_exit = 'X'.
    debug and set            EXIT.
    a break-point
    at the first line.
                            ENDIF.
                           ENDDO.


                                     3          Copyrighted 2012 by LeverX, Inc.
Step 2
   Run/trigger the workflow
    you want to debug.
   Run transaction SM50.
   Select process
    generated by your
    workflow (which most
    likely has username
    WF_BATCH)




                               4   Copyrighted 2012 by LeverX, Inc.
Step 3
          In menu select Administration
           - > Program - > Debugging
          A new session with active
           debugger will pop up.
          After finishing debugging,
           change value of variable
           lv_exit to something else or
           end the process by selecting
           ‘Cancel’ button in
           Administration menu.

21 July 2012                               5   Copyrighted 2011 by LeverX, Inc.
Conclusion
   Described technique is a powerful tool which is very useful when
    testing SAP workflow. Use it responsibly to not cause outages in
    SAP system.




                                   6                         Copyrighted 2012 by LeverX, Inc.
Contact Information


Please contact us for more information about our services or solutions available.

                                LeverX, Inc.
                     800 West El Camino Real, Suite 180
                       Mountain View, CA 94040 USA
                           Tel: (650) 625 – 8347
                         Web Site: www.LeverX.com
                                        7                           Copyrighted 2012 by LeverX, Inc.

Mais conteúdo relacionado

Destaque

Destaque (8)

SAP ALE Idoc
SAP ALE IdocSAP ALE Idoc
SAP ALE Idoc
 
Abap reports
Abap reportsAbap reports
Abap reports
 
IDOC , ALE ,EDI
IDOC , ALE ,EDIIDOC , ALE ,EDI
IDOC , ALE ,EDI
 
Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overview
 
Module pool programming
Module pool programmingModule pool programming
Module pool programming
 
Sap abap ale idoc
Sap abap ale idocSap abap ale idoc
Sap abap ale idoc
 
SAP ABAP - Needed Notes
SAP   ABAP - Needed NotesSAP   ABAP - Needed Notes
SAP ABAP - Needed Notes
 
SAP ABAP data dictionary
SAP ABAP data dictionarySAP ABAP data dictionary
SAP ABAP data dictionary
 

Mais de LeverX

SAP PLM Bill of Material (BOM) Redlining
SAP PLM Bill of Material (BOM) Redlining SAP PLM Bill of Material (BOM) Redlining
SAP PLM Bill of Material (BOM) Redlining LeverX
 
LeverX ABAP Tutorial - HTTP Request Handler Creation
LeverX ABAP Tutorial - HTTP Request Handler CreationLeverX ABAP Tutorial - HTTP Request Handler Creation
LeverX ABAP Tutorial - HTTP Request Handler CreationLeverX
 
LeverX SAP ABAP Tutorial - Creating and Calling Web Services
LeverX SAP ABAP Tutorial - Creating and Calling Web ServicesLeverX SAP ABAP Tutorial - Creating and Calling Web Services
LeverX SAP ABAP Tutorial - Creating and Calling Web ServicesLeverX
 
LeverX SAP PLM Tutorial - BOM Redlining
LeverX SAP PLM Tutorial - BOM RedliningLeverX SAP PLM Tutorial - BOM Redlining
LeverX SAP PLM Tutorial - BOM RedliningLeverX
 
LeverX SAP ABAP Tutorial Creating Function Modules
LeverX SAP ABAP Tutorial Creating Function ModulesLeverX SAP ABAP Tutorial Creating Function Modules
LeverX SAP ABAP Tutorial Creating Function ModulesLeverX
 
LeverX SAP Tutorial Product Structure Synchronization Overview and Fucntio…
LeverX SAP Tutorial Product Structure Synchronization Overview and Fucntio…LeverX SAP Tutorial Product Structure Synchronization Overview and Fucntio…
LeverX SAP Tutorial Product Structure Synchronization Overview and Fucntio…LeverX
 
LeverX - A Comprehensive Guide to SAP PLM 7.01
LeverX - A Comprehensive Guide to SAP PLM 7.01LeverX - A Comprehensive Guide to SAP PLM 7.01
LeverX - A Comprehensive Guide to SAP PLM 7.01LeverX
 
LeverX SAP 7.02 Navigation Essentials
LeverX SAP 7.02 Navigation EssentialsLeverX SAP 7.02 Navigation Essentials
LeverX SAP 7.02 Navigation EssentialsLeverX
 
LeverX Tutorial - SAP PLM Guided Structure Synchronization - Overview and Fun...
LeverX Tutorial - SAP PLM Guided Structure Synchronization - Overview and Fun...LeverX Tutorial - SAP PLM Guided Structure Synchronization - Overview and Fun...
LeverX Tutorial - SAP PLM Guided Structure Synchronization - Overview and Fun...LeverX
 
LeverX SAP PLM Tutorial - Product Structure Management - Create a Product St...
LeverX SAP PLM Tutorial - Product Structure Management  - Create a Product St...LeverX SAP PLM Tutorial - Product Structure Management  - Create a Product St...
LeverX SAP PLM Tutorial - Product Structure Management - Create a Product St...LeverX
 
LeverX ABAP Basics - Using The TREX Search Component
LeverX ABAP Basics - Using The TREX Search ComponentLeverX ABAP Basics - Using The TREX Search Component
LeverX ABAP Basics - Using The TREX Search ComponentLeverX
 
LeverX SAP ABAP Basics - Creating Custom Screen Via Screen Painter
LeverX SAP ABAP Basics - Creating Custom Screen Via Screen PainterLeverX SAP ABAP Basics - Creating Custom Screen Via Screen Painter
LeverX SAP ABAP Basics - Creating Custom Screen Via Screen PainterLeverX
 
LeverX SAP Essential Tutorial - Simple Data Extraction
LeverX SAP Essential Tutorial - Simple Data ExtractionLeverX SAP Essential Tutorial - Simple Data Extraction
LeverX SAP Essential Tutorial - Simple Data ExtractionLeverX
 
LeverX Essential SAP Tutorial - ABAP: Creating A New Development Package
LeverX Essential SAP Tutorial - ABAP: Creating A New Development PackageLeverX Essential SAP Tutorial - ABAP: Creating A New Development Package
LeverX Essential SAP Tutorial - ABAP: Creating A New Development PackageLeverX
 

Mais de LeverX (14)

SAP PLM Bill of Material (BOM) Redlining
SAP PLM Bill of Material (BOM) Redlining SAP PLM Bill of Material (BOM) Redlining
SAP PLM Bill of Material (BOM) Redlining
 
LeverX ABAP Tutorial - HTTP Request Handler Creation
LeverX ABAP Tutorial - HTTP Request Handler CreationLeverX ABAP Tutorial - HTTP Request Handler Creation
LeverX ABAP Tutorial - HTTP Request Handler Creation
 
LeverX SAP ABAP Tutorial - Creating and Calling Web Services
LeverX SAP ABAP Tutorial - Creating and Calling Web ServicesLeverX SAP ABAP Tutorial - Creating and Calling Web Services
LeverX SAP ABAP Tutorial - Creating and Calling Web Services
 
LeverX SAP PLM Tutorial - BOM Redlining
LeverX SAP PLM Tutorial - BOM RedliningLeverX SAP PLM Tutorial - BOM Redlining
LeverX SAP PLM Tutorial - BOM Redlining
 
LeverX SAP ABAP Tutorial Creating Function Modules
LeverX SAP ABAP Tutorial Creating Function ModulesLeverX SAP ABAP Tutorial Creating Function Modules
LeverX SAP ABAP Tutorial Creating Function Modules
 
LeverX SAP Tutorial Product Structure Synchronization Overview and Fucntio…
LeverX SAP Tutorial Product Structure Synchronization Overview and Fucntio…LeverX SAP Tutorial Product Structure Synchronization Overview and Fucntio…
LeverX SAP Tutorial Product Structure Synchronization Overview and Fucntio…
 
LeverX - A Comprehensive Guide to SAP PLM 7.01
LeverX - A Comprehensive Guide to SAP PLM 7.01LeverX - A Comprehensive Guide to SAP PLM 7.01
LeverX - A Comprehensive Guide to SAP PLM 7.01
 
LeverX SAP 7.02 Navigation Essentials
LeverX SAP 7.02 Navigation EssentialsLeverX SAP 7.02 Navigation Essentials
LeverX SAP 7.02 Navigation Essentials
 
LeverX Tutorial - SAP PLM Guided Structure Synchronization - Overview and Fun...
LeverX Tutorial - SAP PLM Guided Structure Synchronization - Overview and Fun...LeverX Tutorial - SAP PLM Guided Structure Synchronization - Overview and Fun...
LeverX Tutorial - SAP PLM Guided Structure Synchronization - Overview and Fun...
 
LeverX SAP PLM Tutorial - Product Structure Management - Create a Product St...
LeverX SAP PLM Tutorial - Product Structure Management  - Create a Product St...LeverX SAP PLM Tutorial - Product Structure Management  - Create a Product St...
LeverX SAP PLM Tutorial - Product Structure Management - Create a Product St...
 
LeverX ABAP Basics - Using The TREX Search Component
LeverX ABAP Basics - Using The TREX Search ComponentLeverX ABAP Basics - Using The TREX Search Component
LeverX ABAP Basics - Using The TREX Search Component
 
LeverX SAP ABAP Basics - Creating Custom Screen Via Screen Painter
LeverX SAP ABAP Basics - Creating Custom Screen Via Screen PainterLeverX SAP ABAP Basics - Creating Custom Screen Via Screen Painter
LeverX SAP ABAP Basics - Creating Custom Screen Via Screen Painter
 
LeverX SAP Essential Tutorial - Simple Data Extraction
LeverX SAP Essential Tutorial - Simple Data ExtractionLeverX SAP Essential Tutorial - Simple Data Extraction
LeverX SAP Essential Tutorial - Simple Data Extraction
 
LeverX Essential SAP Tutorial - ABAP: Creating A New Development Package
LeverX Essential SAP Tutorial - ABAP: Creating A New Development PackageLeverX Essential SAP Tutorial - ABAP: Creating A New Development Package
LeverX Essential SAP Tutorial - ABAP: Creating A New Development Package
 

LeverX ABAP Essentials - Debugging SAP Workflow

  • 1. Essential SAP Tutorial SAP ABAP Tips: Debugging a Background Task in SAP Business Workflow By Vadzim Khlystun 1 Copyrighted 2012 by LeverX, Inc.
  • 2. Tutorial Goal  Sometimes while testing SAP Workflow you need to debug ABAP code in a method used in on of the background tasks. Just setting a break-point in this method won’t work since background task is executed in another context in background. Fortunately, there is a workaround exits which can be used to debug this scenario.  Be careful when using this technique because it based on causing an infinite loop in ABAP stack and can hang up SAP system if used improperly. 2 Copyrighted 2012 by LeverX, Inc.
  • 3. Step 1  Add following code at the  DATA lv_exit. beginning of DO. the method you want to IF lv_exit = 'X'. debug and set EXIT. a break-point at the first line. ENDIF. ENDDO. 3 Copyrighted 2012 by LeverX, Inc.
  • 4. Step 2  Run/trigger the workflow you want to debug.  Run transaction SM50.  Select process generated by your workflow (which most likely has username WF_BATCH) 4 Copyrighted 2012 by LeverX, Inc.
  • 5. Step 3  In menu select Administration - > Program - > Debugging  A new session with active debugger will pop up.  After finishing debugging, change value of variable lv_exit to something else or end the process by selecting ‘Cancel’ button in Administration menu. 21 July 2012 5 Copyrighted 2011 by LeverX, Inc.
  • 6. Conclusion  Described technique is a powerful tool which is very useful when testing SAP workflow. Use it responsibly to not cause outages in SAP system. 6 Copyrighted 2012 by LeverX, Inc.
  • 7. Contact Information Please contact us for more information about our services or solutions available. LeverX, Inc. 800 West El Camino Real, Suite 180 Mountain View, CA 94040 USA Tel: (650) 625 – 8347 Web Site: www.LeverX.com 7 Copyrighted 2012 by LeverX, Inc.