crm 5.2 - building smart forms
TRANSCRIPT
-
7/28/2019 CRM 5.2 - Building Smart Forms
1/29
CRM 5.2 - Building Smart Forms
By
Prem Kumar
SAP-CRM Practice, Pune
mailto:[email protected]:[email protected] -
7/28/2019 CRM 5.2 - Building Smart Forms
2/29
Contents
1. INTERODCUTION..........................................................................................................................................
1.1 INTERODUCTION..........................................................................................................................03
2. PROCEDURE
2.1 HOW TO CREATEA SMARTFROMS...........................................................................................04
2.2 PASSING DATA TO SAMRTFROMS............................................................................................09
2.3 HOW TO SET A URL IN SAMRTFROMS.....................................................................................14
2.4 HOW TO INSERT TICKET NUMBER IN SUBJECT LINE..........................................................16
2.5 HOW TO ADD SAMRTSTYLE IN THE SAMRTFOMS...............................................................18
2.6 HOW TO CREATE A TEXT MODULE AND USE IN THE SAMRTFORMS.............................25
-
7/28/2019 CRM 5.2 - Building Smart Forms
3/29
1.1 INTERODUCTION
SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and
maintaining forms.
SAP Smart Forms allow you to execute simple modifications to the form and in the formlogic by using simple graphical tools; in 90% of all cases, this won't include any
programming effort. Thus, a power user without any programming knowledge can configure
forms with data from an SAP System for the relevant business processes.
To print a form, you need a program for data retrieval and a Smart Form that contains the
entire from logic. As data retrieval and form logic are separated, you must only adapt the
Smart Form if changes to the form logic are necessary. The application program passes the
data via a function module interface to the Smart Form . When activating the Smart
Form, the system automatically generates a function module. At runtime, the system
processes this function module.
You can insert static and dynamic tables. This includes line feeds in individual table cells,
triggering events fortable headings and subtotals, and sorting data before output.
Key Benefits of SAP Smart Forms:
SAP Smart Forms allows you to reduce considerably the implementation costs of
mySAP.com solutions since forms can be adjusted in minimum time.
You design a form using the graphical Form Painter and the graphical Table Painter. The
form logic is represented by a hierarchy structure (tree structure) that consists of individual
nodes, such as nodes for global settings, nodes for texts, nodes for output tables, ornodes
for graphics.
To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
These actions do not include writing of coding lines or using a Script language.
Using your form description maintained in the Form Builder, Smart Forms generates a
function module that encapsulates layout, content and form logic. So you do not need a
group of function modules to print a form, but only one.
-
7/28/2019 CRM 5.2 - Building Smart Forms
4/29
2.1 Getting started with Smart Forms (Building a simple application)
Step 1: Go to transaction Smartforms.
Step 2: Enter a name for the form and click on Create.
Step 3: Enter a short description (subject of smartfrom) for the form.
In this example, we will print a simple text using our form. To create a text, expand Pages and
Windows New Page. Select Main Window and Right click on that. Select Create Text
-
7/28/2019 CRM 5.2 - Building Smart Forms
5/29
Step 4: Give a name to the text and short description.
Step 5: Also enter the text you want to see on the form.
Step 6: SAVE and Activate the Smart form.
To know the function module that is generated upon activation of this smart form, click on
Environment Function module name.
-
7/28/2019 CRM 5.2 - Building Smart Forms
6/29
Following popup with the function module would appear.
Step 7: Test the smart form by clicking on Test. You would be navigated to the function builder withthe function module defaulting to the one that is generated earlier.
Step 8: Click on execute.
-
7/28/2019 CRM 5.2 - Building Smart Forms
7/29
Step 9: Since we do not have any parameters to pass on, click on Execute.
-
7/28/2019 CRM 5.2 - Building Smart Forms
8/29
2.2 PASSING DATA TO THE SMARTFORMS
-
7/28/2019 CRM 5.2 - Building Smart Forms
9/29
Scenario: Let us take a simple scenario of passing webclient field's value from Driver program to theSmart Form.
Step 1: Go to transaction SMARTFORMS and create a Smart Form.
Step 2: To pass the values from the driver program to Smart Form, we need to define the forminterface with the parameters to be passed on.
Click on Global Settings Form Interface.
Step 3: Now define the import parameters "ORDERADM_H", ZCRM+ORDER_CODES and
HRPERSON_S
-
7/28/2019 CRM 5.2 - Building Smart Forms
10/29
Step 4: Now create a Text in the Main window to display the above parameters.
Step 5: To add a field, we need to click on Insert Field.
-
7/28/2019 CRM 5.2 - Building Smart Forms
11/29
Step 6: Enter the field names between the & (Ampersand) as shown below:
Step 7: Add all required fields like this in the text body.
-
7/28/2019 CRM 5.2 - Building Smart Forms
12/29
Step 8: Save and Activate the Smart Form. Test and run the Smart Form by clicking on Execute.
-
7/28/2019 CRM 5.2 - Building Smart Forms
13/29
Step 9: Enter the values as shown below and click on execute.
-
7/28/2019 CRM 5.2 - Building Smart Forms
14/29
2.3 HOW TO SET URL LINK IN SMARTFROMS
Step 1:Go to transaction Smartforms.
Step 2: open the smartfroms in change mode .The URL will be implemented in the text module.Step 3: Insert the URL in the text module.
Step 4: Select the link and click on the URL button.
Step 5: save and activate.
-
7/28/2019 CRM 5.2 - Building Smart Forms
15/29
Step 6:
Note: when we use a template in email -sometimes formatting do no work that requires some
email setting. If the link length is more then one line then it will come in the next link withoutleft margin -To solve it we should not maintain left margin in the smart style .if we are using
or should not give left margin in main window in form painter.
-
7/28/2019 CRM 5.2 - Building Smart Forms
16/29
2.4 HOW TO INSERT TICKET NUMBER IN SUBJECT LINE OF SMARTFROMS
Scenario: The smartfrom is importing field value in the run time from the class "
ZL_DOC_PROCESSING_CRM_ORDER" method "CRM_ORDER_EXEC_SMART_FORM ".
So here we are getting ticket number in the run time and we want to add ticket
number in the subject line like below. Example:
Subject: Your service ticket # 40000376
Analysis : while debugging I find out that the screen field in smart form have fix size 30
characters and the data element caption (tdtitle) have real size 50 char
Solution:
So I plan to pass "Ticket # ticket no" at the run time to the smartfrom subject I added & in the subject field of the smartfroms(screen field)
I replaced the "&" with "ticket # ticket no" at the run time.
Step 1: Go to transaction Smartforms
Step 2: I added '&' in the Smartfrom subject.
Step 3: Use SE24 open the class "CRM_ORDER_EXEC_SMART_FORM"
Step 4: Select the method "CRM_ORDER_EXEC_SMART_FORM"
Step 5: The ticket number has leading zero so to avoid it use pass the ticket number to
Function module "CONVERSION_EXIT_ALPHA_OUTPUT".
Step 6: Split the subject line of smartfrom by '&' and store in two strings
SPLIT ls_output_options-tdtitle AT '&' INTO res1 res2.
-
7/28/2019 CRM 5.2 - Building Smart Forms
17/29
Step 7: Concatenate the Ticket # Ticket no" with the split subject string
CONCATENATE res1 ' 'Ticket#' ls_cap_int res2 INTO ls_caption
Step 8: there should be one space between every word. So condense the subject line.
Step 9: Output-option used as an import parameter in smart form which have a field "tdtitle"
which use to store the subject line for smartfroms.
Step 10: Finally move he concatenated string to the subject line of smart from and have pass
the subject line as a parameter to the samrt form function module.
Subject: "You service & has been created"
At the run time: "You service ticket # 40000375 has been created"
-
7/28/2019 CRM 5.2 - Building Smart Forms
18/29
2.5 HOW TO ADD SMARTSTYLE IN SMARTFROMS TEXT MODULE
SAP Smart Styles: Style name
To display texts in a form (SAP Smart Form), we need a style (Smart Style), which containsthe formatting information of the text (paragraph and character formats).
We specify the style in the output options of the form attributes. It applies for the entire form.
In the output options of particular form sub objects (text, address, alternative, folder, loop,
table, template, complex paragraph), we can assign a different style, which overrules the
general style. This style is used for all sub nodes of the sub object until again another style is
specified.
Step 1: Go to transaction SmartStyles or Smartfroms
Step 2: Enter a style name and click on Create.
Following screen appears:
-
7/28/2019 CRM 5.2 - Building Smart Forms
19/29
Step 3: to create a paragraph, click on folder Paragraph Formats and click on Create (as shown inthe above screenshot).
Step 4: following pop-up appears: Enter a paragraph format name.
Step 5: Enter a suitable description for your graph and enter the left margin value as 2 CH.
-
7/28/2019 CRM 5.2 - Building Smart Forms
20/29
Step 6: Now select the tab Indents and spacing: set the alignment
There are two options below.
Page protection: Use this switch to determine whether to display the paragraph entirely on onepage.
Next paragraph on same page: Next paragraph switch. If set, the system displays the next
paragraph on the same page as the current paragraph; the paragraphs are not separated by a
page break.
-
7/28/2019 CRM 5.2 - Building Smart Forms
21/29
Step 7: Select the tab Font to choose appropriate font, color and style.
Step 9: Select the tabs to set the set the tab spacing.
Step 10: Select the Numbering and outline" as P1 and put the left delimiter as .. If the left delimiteris not mentioned, the values would be displayed as 11, 12, 13... instead of 1.1, 1.2, 1.3
-
7/28/2019 CRM 5.2 - Building Smart Forms
22/29
Step 11: Save and activate your Smart Style.
Step 12: Now go to transaction SmartForms.
Step 13: Create a Smart Form or open an existing one.
Step 14: Select the tab Output Options to mention the Smart Style to be used.
Step 15: Now go to tab General Attributes.
-
7/28/2019 CRM 5.2 - Building Smart Forms
23/29
Step 16: Now to change the editor, click on Goto -> Change Editor
Step 17: Here enter the desired text:
Step 18: Return to the main screen of the Text. The paragraph (p1 name will be appear)
-
7/28/2019 CRM 5.2 - Building Smart Forms
24/29
Step 19: Save and activate the Smart Form. Test & run the Smart Form.
-
7/28/2019 CRM 5.2 - Building Smart Forms
25/29
2.6 TEXT MODULE CREATION AND USE IN SMART FORMS
We use the text type TextModule of the text node to refer to an existing text module in the
system. This allows you to easily use texts from one text module in several forms. In
addition, it is not necessary to load the entire form description to maintain these texts.
You can use text modules in two ways:
Refer to the text module. The text then appears read-only in the PC editor and is
included when you print the form.
Copy the text module. The system then copies the text of the module and
automatically converts the text node into an editable text element.
Text modules can be used across clients and are connected to the transport and translation
systems.
If you refer to a text module, you can use the SFSY-SUBRC system field to check at runtime,
whether the text module was found in the system.
Text module creation Steps:
Step 1: Go to the transaction "smart forms".
Step 2: Select text module and give a name for the text module example: here I am creating
text module for Awaiting ticket template.
Step 3: Click on create button.
Step 4: Enter a unique name for the node and a description (for example, business term).
Step 5: On the General Attributes tab select the text type Text.
Step 6: Enter text which you want to add in the Smart Forms text.
-
7/28/2019 CRM 5.2 - Building Smart Forms
26/29
Step 7: Select the URL, which you want to make as a link and click on the URL button.
Step 8: To add fields select insert button.
Step 9: Give the fields within opening and closing & and click on button.
-
7/28/2019 CRM 5.2 - Building Smart Forms
27/29
Step 10: To select any text style (which is existing in the system) click on the reset
character formatting and select the desire one.
We can apply different formatting in the text paragraph/lines. Like here in the
example I created "P1 URL format"," P3 justified" ,"P4 font size 10" and "P2 Bold Curior"
by transaction "smartstyles".
Step 11: Save and come out.
How to add text module in the Smart Forms.
Step 1: Go to transaction "smart forms".
Step 2: Open the Smart Forms in which you want to add text module.
Step 3: Select the text module of Smart Forms
-
7/28/2019 CRM 5.2 - Building Smart Forms
28/29
Step 4: Choose the General tab of text module.
Step 5: choose text type as Text Module.
Step 6: Give the name of the text module created example: ZAWTTKT_TXT
And choose language English "EN" and press enter
Step 7: The text in the text module we created will come automatically in the text area of
The Smart Forms. Any changes if we will make in the text module text, will be
reflecting directly in the text is of the Smart Forms.
-
7/28/2019 CRM 5.2 - Building Smart Forms
29/29