0% found this document useful (0 votes)
80 views

Tools in Smartforms:: SE78 (Administration of Form Graphics)

The document discusses various tools available in smartforms including Form Painter, Table Painter, PC Editor, Navigation Tree, and Error List. It also discusses using commands like SFTRACE for tracing smartforms and using the COMMAND function to control the number of records displayed per page. Page protection is described as a way to display contents across page breaks without interruption. Different types of windows for output are also listed like the main window, secondary window, final window, and copies window. The document concludes with suggestions for finding BAdIs and differences between customer exits and user exits.

Uploaded by

madanaganesh
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

Tools in Smartforms:: SE78 (Administration of Form Graphics)

The document discusses various tools available in smartforms including Form Painter, Table Painter, PC Editor, Navigation Tree, and Error List. It also discusses using commands like SFTRACE for tracing smartforms and using the COMMAND function to control the number of records displayed per page. Page protection is described as a way to display contents across page breaks without interruption. Different types of windows for output are also listed like the main window, secondary window, final window, and copies window. The document concludes with suggestions for finding BAdIs and differences between customer exits and user exits.

Uploaded by

madanaganesh
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 18

Tools in smartforms:

Form Painter
Table Painter
PC Editor
Navigation Tree

Error List

When we check the smart forms and if any error occurs, it will be
displayed at the bottom of the maintenance screen
SE78 (Administration of Form Graphics).
Select-Options: Sign, option, high and Low
SFTRACE- tracing smartfomrs.
Using 'COMMAND' to achieve page break

In some cases user will ask only specific number of records should be displayed per
page, but based on space availability of main window data will populate. To restrict
manually the number of records displayed per page we can use COMMAND.

A folder can be used for two purposes


1. Page protection. like Prtect endprotect in scripts(so all come on one page)
2. Logical grouping
If u want to put a condition on a group of text elemnts u can put them in a floder
and apply the condtion once to the folder

Page Protection is used to avoid displaying the broken contents of the page and
allow it to display in the new page from the beginning after the previous page. E.g. I
have two texts available and i want to display them in two different pages without
any break in any of the page contents. But here if we don't use Page Protection
then first text will be displayed in first page and if some space is available in the
first page then second text also will get started after the first text contents (few
lines) in the first page itself, it will break the second text contents and the rest of
the lines of the second text it will display in the second page. If we use Page
Protection then First text contents will be displayed in the first page and without any
break of the second text contents, it will be displayed in a new page i.e. in the
second page.

Page protection:
1.Create a Folder in the table ,
2.Go to Output Options,
3.Initially Page Protectinon Checkbox is disable.
4.Drag the line type into folder and give the line type name in the folder.
5.now the page protection check box will enable .
6. check the page protection checkbox .
7.now the table is page protected.
Or
For the Page protect in tables, there is option in table itself.
Just double click on the table, then select table tab and click on details, then there
is check box in every line type for the page break, select this check box.

SPAD: Output device types.


Version management in SAP smartforms between different servers

bar code printing using SAP Scripts/Smart forms :


Tcode: SE73.
Smartform output to PDF in 1 step:
Run the Smart Form. Write PDF! On command field and press Enter. Your PDF will
get open in separate window which can be printed easily.

How to Print front and Back in smartforms:


You have to choose "D" for PRINT MODE in the OUTPUT OPTIONS of your page.

Standard Text and including them in the smartform


Go to transaction code SO10 and enter the text name which you want to create. Include text in

How To Trace Smartform:


If you want to debug Smartform in non-modifiable client, then you can try debugging Smartform
using Transaction SFTRACE.

1. Main window.
It is for the continues output like table output.
2. Secondary window.
For output with a fixed length.
3. Final window.
This is also a special type of secondary window for the details
that has to be processed only at the end of the form processing .
4. Copies window.
This is a special type of secondary window for making pages as copy or
original.

Exits:
To find a BAdI for any SAP transaction do the following:
Click on System->Status
Double click on the program name
Once inside the program search for CL_EXITHANDLER=>GET_INSTANCE.
Make sure the radiobutton In main program is checked
A list of all the programs with call to the BAdIs will be listed.
The export parameter EXIT_NAME for the method GET_INSTANCE of class
CL_EXITHANDLER will have the user exit assigned to it.
The changing parameter INSTANCE will have the interface assigned to it.

Single Use Business Add-Ins


Do NOT select the Multiple use checkbox
from the Administration tab when defining
a Single Use BAdI

BAdI has a single Implementation


Similar to procedures
Return values can be expected
Can use importing, changing and
returning parameters
N/A
A single implementation will be triggered
by the application program

Multiple Use Business Add-Ins


Select the Multiple use checkbox from
the Administration tab when creating the
BAdI definition
BAdI has multiple implementations
Similar to event calls
Cannot expect return values
Can use importing and changing
parameters
For multiple implementations there is no
sequence control because at the time of
BAdI definition it does not know which
implementation will be active
All active implementations will be
triggered by the application program
using the BAdI

difference between customer exits and user exits


1.USER EXITS are FORMS and are called by SAP standard programs
using PERFORM.
CUSTOMER EXITS are FUNCTIONS so they are called using CALL
FUNCTION (or more exactly CALL CUSTOMER FUNCTION).
2.Inside the form (user exit) you can read and change almost
any global data from host program.
Inside a function (customer exit) you can only acces your
import/export/changing/tables parameters.
3.User exits are more flexible because you have more
information to use in your code but on the other hand , it
is very easy to manipulate erroneously global data and lead
the standard program to a dump or even to make database
inconsistent.
Customer exits are more restrictive but you are sure any
change you can make to any parameters will never lead to
inconsistency
4.User-exit doesn't have any classification.
In customer-exit we have function-module exit,screen exit

menu exit.
5.User exits are Basically designed For SD module.
Customer exits Are available for MM,SD,FI,HR..Basically
designed for all modules
We can find out the entire possible Customer exits based Call customer

Format: CALL CUSTOMER-FUNCTION '910'


The naming standard of function modules for function module exits is:
EXIT_<program name>_<3 digit suffix>
Examples:
All User exits start with the word USEREXIT_...
FORM USEREXIT_XXXX....
INCLUDE ZZUSEREXIT.......
ENDFORM.
How to find User exits (rarely used, applicable for SD module)
1. Just go to SE84. Search for Package >> VMOD
And go through all includes. Access key is required for modifications.
2. SQL trace method: Switch the trace on in ST01. Search for string EXIT and you
can find all the customer exits.
Finding BADIS:

There are multiple ways of searching for BADI.


Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
Finding BADI Using SQL Trace (TCODE-ST05).
Finding BADI Using Repository Information System (TCODE- SE84).
Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
Go to the Transaction, for which we want to find the BADI,
Get the Program Name of Corresponding Transaction.
(Click on System->Status. Double Click on Program Name)
Once inside the program search for CL_EXITHANDLER=>GET_INSTANCE.
Make sure the radio button In main program is checked.
A list of all the programs with call to the BADIs will be listed.
The export parameter EXIT_NAME for the method GET_INSTANCE of class
CL_EXITHANDLER will have the user exit assigned to it.
The changing parameter INSTANCE will have the interface assigned to it.
Finding BADI Using SQL Trace (TCODE-ST05).
/people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
Finding BADI Using Repository Information System (TCODE- SE84).
Go to Maintain Transaction (TCODE- SE93).
Enter the Transaction VD02 for which you want to find BADI.
Click on the Display push buttons.
Get the Package Name. (Package VS in this case)
Go to TCode: SE84->Enhancements->Business Add-inns->Definition
Enter the Package Name and Execute.
Explicit enhancement option

ENHANCEMENT-POINT
ENHANCEMENT-SECTION

One which can be provided at a specific place - called Enhancement Point, and
another which can
be used to replace a set of statements called Enhancement Section.
When the Enhancement-Section is implemented, only the implementation gets
executed and the original code doesnt get executed

Fallback Class: The default implementation class is called if no active implementation

and no default implementation exists for a BAdi dedefinition with the current filter
restrictions.

Module pool Program:

Report Programs:
1. Reports are stand alone programs.
2. We use reports to read data base tables & represent results in Lists
3. Reports are collection of processing blocks, controlled by System calls depending on events.
4. Reports can use LDBs or SELECT STATEMENTS
defined by DEVELOPER.
5.Reports can call Dialogue programs and vice versa.

Dialog Programming
1.Dialogue programs are not stand alone programs. (we
have to link the dialogue programs to at least one or
more SCREENS & TRANSACTION CODES)
2. We use Dialogue Programs to read & change
Database tables.
3.Dialogue programs are controlled by Screen flow logic.
4.Dialogue program is also called as Module pool program
or TRANSACTION.

5.These module pools are separated in to PBO and PAI


events.

Difference between Report and Dialog Programs

Report Program:
A report is a program that typically reads and analyzes data in database tables without changing
the database.
Dialog Program:
A dialog program allows you to work interactively with the system and to change the contents of
the database tables. Each dialog program has a certain sequence of screens that are processed by
the system one after the other.
Screen Flow Logic
Screen Flow logic is primarily divided into four components.

Process Before Output (PBO) event: which is processed before the screen is displayed
Process After Input (PAI) event: which is processed after a user action on the screen

Process on help request (POH): which is processed when F1 is pressed

Process on value request (POV):which is processed when F4 is pressed

Dynpro

A screen together with its Flow logic is called a Dynpro (Dynamic Program since the
screen flow logic influences the program flow)
Each dynpro controls exactly one step of your Dialog Program.

The screens belonging to a program are numbered. The screen flow sequence can be
either linear or cyclic. From within a screen chain, you can even call another screen chain
and, after processing it, return to the original chain. You can also override the staticallydefined next screen from within the dialog modules of the ABAP program.

MODULE EXIT AT EXIT-COMMAND.


i have a scenario,on screen i enter some data and i press the cancel button a popup
should be displayed saying do you want to cancel.if i press on yes then leave to
screen 0.but if i press no then the previous data entered should be displayed on the
same screen.

REPORT ztest_at_exit.
DATA:
var1(10),
var2(10),
var3(10).
CALL SCREEN 100.
&---*&
Module STATUS_0100 OUTPUT
&---text
---MODULE status_0100 OUTPUT.
SET PF-STATUS 'ZTEST_AT_EXIT'.
SET TITLEBAR 'ZTEST_AT_EXIT'.
ENDMODULE.
&----

" STATUS_0100 OUTPUT

*&
Module USER_COMMAND_0100 INPUT
&---text
---MODULE user_command_0100 INPUT.
DATA:
w_ucomm LIKE sy-ucomm.
w_ucomm = sy-ucomm.

CASE w_ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'ADD'.
var3 = var1 + var2.
ENDCASE.
ENDMODULE.
" USER_COMMAND_0100 INPUT
&---*&
Module EXIT_100 INPUT
&---text
---MODULE exit_100 INPUT.
DATA:
answer.
w_ucomm = sy-ucomm.
CASE w_ucomm.
WHEN 'EXIT2'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
text_question = 'Do you want to save this ?'
IMPORTING
answer
= answer.
exception
text_not_found
=1
OTHERS
= 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
IF NOT answer EQ '1'.
LEAVE TO SCREEN 0.
ENDIF.
ENDIF.
ENDCASE.
ENDMODULE.
Or

" EXIT_100 INPUT

In PAI define a module like


module exit at exit-command.
and use Function Module
POPUP_TO_CONFIRM
Create a cancel button with type 'E'
write code in PAI
MODULE EXIT AT EXIT-COMMAND.
under this module.
module exit.
if sy-ucomm = 'CANCEL'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar
= c_txt05
text_question
= c_txt06
text_button_1
= 'Yes'
text_button_2
= 'No'
default_button
= '1'
display_cancel_button = ' '
IMPORTING
answer
= l_answer
EXCEPTIONS
OTHERS
= 0.
IF l_answer = '1'.
do this.
else
do this.
endif.
ENDIF.endmodule.
->Which Function type is used when we use at exit command?
To use at exit command, we must assign function type E to the relevant function
in the Menu or screen painter.
http://www.sapabapiq.com/2013/03/module-pool-programminginterview.html
After user interaction with the screen, you may need to know the position of the cursor when the action
occurred. This is particularly important if the user chooses the Choose function (F2 or mouse doubleclick).
To find out the cursor position, use the following statement:
GET CURSOR FIELD <f> [OFFSET <off>]
[LINE <lin>]
[VALUE <val>]
[LENGTH <len>].

Calling Modules Unconditionally

When the user chooses a function with type E, the screen flow logic jumps directly to the following
statement:
MODULE <mod> AT EXIT-COMMAND.

Logical DB->PNPCE:

A report that wants to use the PNPCE must enter this in its report attributes under Logical
database.
In addition, the PERNR structure must be declared in the report using the 'TABLES PERNR'
statement. You can only use the PERNR structure again in certain circumstances. The use of the
'GET PERNR' event is therefore forbidden. Instead, use the 'GET PERAS' event. Except for the
PERNR-PERNR component, all other components of the PERNR structure are no longer filled
and have initial values. This kind of programming (with the exception of PERNR-PERNR)
therefore not permitted.
In addition to the 'GET PERAS' event, you can also use the GET PERSON' and 'GET GROUP'
events. To be able to use these events, you must declare them using the NODES statement
(NODES PERSON', 'NODES GROUP', or. NODES PERAS').
Explanation of Terms
If the 'GET PERSON' and 'GET GROUP events and the 'AS PERSON TABLE' addition for the
INFOTYPES statement are not used, the report indicates that it does not require the functionality
for evaluating Concurrent Employment. In this case, the report runs in a PNP-compatible
session. This is referred to as PNP mode in the following documentation. On the other hand, if
the report uses the functionality for evaluating Concurrent Employment we refer to CE mode.
Features
Process of an Evaluation

The PNPCE selection screen offers you as standard a range of functions that you can use to
restrict the personnel number and person selection. These are discussed in more detail in the
following sections. The process is initially as follows regardless of whether the report runs in CE
or PNP mode. All available functions and selection conditions leads to the selection of personnel
numbers. If you use the sorting function, this set of personnel numbers is then sorted according
to the sort criteria you selected. In PNP mode, the GET PERAS event is triggered as a result for
each personnel number.
In CE mode, the persons belonging to the personnel numbers are determined first for all
personnel numbers selected. The GET PERSON event is then triggered for each person. The
person ID is specified in the OBJID component of the PERSON structure. PERNR_NUM
contains the total number of personnel assignments (= personnel numbers) that this person has
and the ALL_PERNRS table, which contains a list of these personnel numbers regardless of
whether they were actually selected or not. The SELECTED flag is set to X for the personnel
numbers selected. The flag is initial for all personnel numbers that are not selected. The
PROCESS flag specifies whether the personnel number should be processed in the rest of the
process. This flag is set to X by default for the personnel numbers selected. However, the report
can set or delete this flag at the GET PERSON event for all personnel numbers. In this way,
report and logical database communicate with each other which enables the report to control the
rest of the process.
GET PERSON Structure:

Get Employee HR Connection group mail id and all HR Connections from HR Country
unit:
* Get the position of employee from HRP1001
SELECT SINGLE sobid FROM hrp1001
INTO lv_position
WHERE otype = 'P'
AND
objid = emp_no
AND
plvar = '01'
AND
rsign = 'B'
AND
sclas = 'S'
AND
relat = '008'
AND
begda LE sy-datum
AND
endda GE sy-datum.
* Get the Org unit from positon (S-A-003)
SELECT SINGLE sobid FROM hrp1001
INTO lv_org_unit
WHERE otype = 'S'
AND
objid = lv_position
AND
plvar = '01'
AND
rsign = 'A'
AND
relat = '003'
AND
begda LE sy-datum
AND
endda GE sy-datum
AND
sclas = 'O'.
* Get the HR country unit from the org unit (O-A-O01)
SELECT SINGLE sobid FROM hrp1001
INTO lv_country_unit
WHERE otype = 'O'
AND
objid = lv_org_unit
AND
plvar = '01'
AND
rsign = 'A'
AND
relat = 'O01'
AND
begda LE sy-datum
AND
endda GE sy-datum
AND
sclas = '1O' .

"#EC *

"#EC *

"#EC *

*
Get all the HR Connections (positions) from the HR Country Unit
* (10-B-O01-S)
REFRESH lt_hrp1001.
SELECT sobid FROM hrp1001
INTO TABLE lt_hrp1001
WHERE otype = '1O'
AND
objid = lv_country_unit
AND
plvar = '01'
AND
rsign = 'B'
AND
relat = 'O01'
AND
begda LE sy-datum
AND
endda GE sy-datum
AND
sclas = 'S'.
* Get the PERNRs from the positions

LOOP AT lt_hrp1001 INTO wa_hrp1001.


MOVE wa_hrp1001-sobid TO wa_hrp1001-objid.
MODIFY lt_hrp1001 FROM wa_hrp1001.
CLEAR wa_hrp1001.
ENDLOOP.
IF lt_hrp1001[] IS NOT INITIAL.
SELECT sobid
FROM hrp1001
INTO TABLE lt_sobid
FOR ALL ENTRIES IN lt_hrp1001
WHERE otype = 'S'
AND
objid = lt_hrp1001-objid
AND
plvar = '01'
AND
rsign = 'A'
AND
relat = '008'
AND
begda LE sy-datum
AND
endda GE sy-datum
AND
sclas = 'P'.
ENDIF.
* Get the userids from the PERNRs
LOOP AT lt_sobid INTO wa_sobid.
MOVE wa_sobid-sobid TO wa_pernr-pernr.
APPEND wa_pernr TO lt_pernr.
APPEND wa_pernr TO tt_pernr.
CLEAR : wa_pernr,wa_sobid.
ENDLOOP.
IF lt_pernr[] IS NOT INITIAL.
SELECT usrid
FROM pa0105
INTO TABLE tt_uname
FOR ALL ENTRIES IN lt_pernr
WHERE pernr = lt_pernr-pernr AND subty = '0001' AND
begda LE sy-datum AND endda GE sy-datum.
ENDIF.
LOOP AT tt_uname INTO ls_uname.
CONCATENATE 'US' ls_uname-usrid INTO ls_uname-usrid.
MODIFY tt_uname FROM ls_uname.
ENDLOOP.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy