Sie sind auf Seite 1von 3

SAP-Advisor.

com
Advising SAP users, developers and consultants.
Home About Us Welcome ABAP BASIS AIX/Oracle SAPScript SmartForms SD/FI Policies
Search

Contact Info

Donate

If you find these articles to be useful, please consider making a donation.

Debugging tips for SAP SmartForms documents


Posted by Wayne on January 22, 2010

Search Articles

Search

If you are not familiar with the ABAP debugger or if you are just getting started using it, then you might find it challenging to locate the ABAP code that you have written in your SmartForms documents.

Articles by date

Article Categories
ABAP (13) BDC Programs (3) Data Migration (2) Debugger (1) Texts (1) User Exits (1) AIX (82) Basics (17) Configuring TCP/IP (17) SysAdmin I (19) SysAdmin II (15) SysAdmin IV:Storage Management (14) BASIS (10) Administration (8) Printers (2) System Errors (5) SAP Misc (4) SD/FI (9) Payment Processing (1) SmartForms (3)

The purpose of this article is to provide some information and a few tips on using the debugger to help troubleshoot problems in the ABAP code in SmartForms documents.

June 2013 M T W T F S S
1 3 4 5 6 7 8 2 9

SmartForms
There are many advantages to using SmartForms over traditional SAPScripts for your SAP documents. While the interface makes it easier to design and implement the overall layout of the document, you also have the ability to incorporate ABAP code at strategic places right in the SmartForm without having to modify the print program. However, there are times when you need to debug the ABAP code that you have written within your SmartForms document.

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 May

Recent Articles
How to transport SAP Variants Tracking SAP transactions and ABAP report usage by User AIX Version 5.1 File Size Limitations AIX Ver. 4 SysAdmin IV:Storage Management (Unit 9) Storage Area Network (SAN) Concepts AIX Ver. 4 SysAdmin IV:Storage Management (Unit 8) ESS Overview AIX Ver. 4 SysAdmin IV:Storage Management (Unit 7) Mirroring and Quorum (2 of 2) AIX Ver. 4 SysAdmin IV:Storage Management (Unit 7) Mirroring and Quorum (1 of 2) AIX Ver. 4 SysAdmin IV:Storage Management (Unit 6) LVM Fundamentals (2 of 2) AIX Ver. 4 SysAdmin IV:Storage Management (Unit 6) LVM Fundamentals (1 of 2) AIX Ver. 4 SysAdmin IV:Storage Management (Unit 5) Introductions to HACMP

Debugging Tips
Those who have used the ABAP debugger know that it can sometimes be difficult to find the specific lines of code that you are looking for. In fact, it can sometimes be like looking for a needle in a haystack. At the very least, you can spend a significant amount of time stepping through layer after layer of programs, includes and function modules. However, by knowing a few simple tips you can stop document printing at just the right location so that you can find and debug the ABAP code that you have written in your SmartForms document.

SmartForms Function Module Names


First of all, it is important to realize that all SmartForms documents are compiled into their final run-time programs when they are activated. SAP dynamically creates a unique program name with associated includes and function modules when the SmartForm is activated. While in your SmartForms document go to the menu option Environment > Function Module Name. There you will find the function module name that SAP created for your

Archives
May 2013 (1) December 2011 (1) November 2011 (14) October 2011 (15) September 2011 (19) August 2011 (17) July 2011 (17) June 2011 (1) May 2011 (1) January 2011 (3) June 2010 (1) March 2010 (1) February 2010 (3)

SmartForms document. The name of the function module will look something like: /1BCDWB/SF00000015.

SmartForms - Program Names


The next step is to find the name of the SmartForms program name which can be done by using transaction code SE37 Function Builder and entering the Function Module Name that you found in the previous step. Go to the Attributes Tab and there you will find the program name which looks something like this: /1BCDWB/SAPLSF00000015. Notice that the word SAP has been added to the Function Module Name to create the Program Name.

Where SAP stores your ABAP Code in SmartForms


To find the ABAP code that you have written inside your SmartForms document simply double-click on the program name which will take you inside the program. There you will see several include statements in two different sections: 1. System-defined Include-files

Recent Comments
saphelpdesk on Welcome rizki on SAP transaction codes for BASIS

January 2010 (2) December 2009 (2) November 2009 (2) August 2009 (1) July 2009 (10)

/1BCDWB/LSF00000015TOP "Global Data /1BCDWB/LSF00000015UXX "Function Modules 2. User-defined Include-files /1BCDWB/LSF00000015F01 "User Code Your ABAP code will be found within a FORM with near the end of the User-defined Include-files /1BCDWB/LSF00000015F01. A different FORM is generated for each section of code that you have written in the SmartForms document. Each FORM name is generated with the format %C##. For example your ABAP code will be located in a FORM that is named%C01, %C02, C03 and so forth.

Administrators Wayne Lytle on Debugging tips for SAP SmartForms documents smartforms on Debugging tips for SAP SmartForms documents Wayne Lytle on How to add a picture to the SAP main menu EleMarK on How to add a picture to the SAP main menu Mohammad Jaster on How to Execute Operating System Commands from within SAP

SAP-Advisor.com

Setting Breakpoints in the ABAP Debugger


Now that you know where to find your ABAP code in the SmartForms generated programs you are ready to get started using the ABAP Debugger. You can start by creating an output for your SmartForms document. At this point just before saving the document with the new output, simply enter /h and press execute. This will activate the debugger which will pop-up after saving the document. Note: If you happen to activate the debugger before the document is saved then the debugger will start placing you in the ABAP code before the document save code begins and not where the document printing begins. If this happens then simply press the Continue button so that it will jump past the document save code and stop again where the document print code begins. If the document prints without the debugger stopping at the document print code then you will have to begin again. Once the debugger starts you can quickly set a breakpoint using the Program Name and the User-Include file so that the debugger will stop exactly at the point where your ABAP code is located in the SmartForms document. Use the menu path Breakpoints > Breakpoint at > Source Code and enter the Program Name and Include file name you found earlier. You will also need to enter the program line in the Row field in order to specify the exact location where you want the debugger to stop.

Google News U.S. : Sci/Tech


Sales of older iPhones, iPads banned as agency says Apple infringed Samsung ... - Washington Post Google Glass Says 'No' to Adult Content - eWeek Frog thought to be extinct found in Israel pond - USA TODAY

Program Name: /1BCDWB/SAPLSF00000015 Include: /1BCDWB/LSF00000015F01 Forget Haswell: Why tablet Row: #### - "Line number of your code where it appears in the include file processors mean more to Once you have the breakpoint set, press the Continue button. This will stop the Intel at Computex PCWorld SmartForm execution at the exact point where you want to start debugging you ABAP code. At this point you can check values of variables, look at table contents and step through your ABAP code to find out where problems exist. Apple to Offer 7400 Jobs for Their New Campus in Cupertino - Headlines & Global News

Conclusion
Without knowing a few basic tips about how to find your ABAP code in a SmartForms document, you can spend a lot of time stepping through standard ABAP code in SAP. While object oriented code has changed the world of programming, it can also present challenges when you dont know where to look to find the specific code that you want to troubleshoot. Note: The Program Name and the Include File names of your SmartForms document will be different in each system in your SAP landscape since they will be dynamically recreated when they are transported to each system. Therefore, if you want to use the debugger on the same SmartForms document but in a different SAP system, you will have to lookup the Program Name and Include files names in that system.
Categories: ABAP, Debugger, SmartForms | SmartForms | 2 Comments Tags: ABAP, debug, debugger,

SAP-Advisor.com

Tabbed Area

Calendar
June 2013 M T W T F S S
1 3 4 5 6 7 8 2 9

2 comments
smartforms says:
April 21, 2011 at 9:22 am

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 May Using break-points in function modules or within smartform documents is great help for debugging to troubleshoot in smartforms. Those basic tips you have summarized will help great during bug identifiying. Thanks

Categories Archives Comments

Wayne Lytle says:


May 5, 2011 at 5:19 pm

It looks like you have a couple of good articles with some useful tips on SmartForm debugging also. Thanks for the response and keep up the good work.

Leave a Reply

Name (required) Mail (will not be published) (required) Website

Submit Comment

CAPTCHA Code *

Issuing a warning message when duplicate materials are entered on a sales order How to recover when the SAP spool is full

2009 SAP-Advisor Celestial Aura Theme by dkszone.net

Das könnte Ihnen auch gefallen