Reg: SUPPRESS AND PICK in module pool?
what is SUPPRESS DAILOG in module pool.
what is the PICK function type in module pool.
Hi,
Check this for Suppress Dialog.
<b>SUPPRESS DIALOG.
Effect
Suppresses output of the current screen.
However, flow control continues normally and dialog resumes on the next screen.
Note
SUPPRESS DIALOG should only be used in a PBO (PROCESS BEFORE OUTPUT) module.</b>
Regards
vijay
Similar Messages
-
How to download and upload a module pool program ?
hi i am a sudent.can anyone suggest me how to download and upload a module pool program?
Moderator message: please search for available information/documentation.
Edited by: Thomas Zloch on May 29, 2011 12:45 PMHi,
You cannot just download and upload module pool programs .
There are 2 different ways.
1. Copy all the includes and and create the same in the target system. You can download and upload the the Screen.
But GUI status you have to manually create.
2. If you have completely saved the module-pool program in one Workbench request(including Z tables u have used) in the original system ,just release the workbench request and copy the data file and co file and upload to the target system ( use CG3Y & CG3Z).
If the workbench is a Local Request save it in a Transport of copies and then move.
Regards
Aromal R -
How to display image and data in module pool screen?
Hi,
I want to display image and relevant data besides the image in module pool screen, I am using docking container to display the image.
Actually I am able to display image or data any one but not both.
one more thing I want to display multiple images and their data.
Please suggest some one if you have any idea.
Regards,
Dileep.You can try below way, I have used in report.
DATA: gc_docking TYPE REF TO cl_gui_docking_container, "#EC NEEDED "Docking Container
gc_split TYPE REF TO cl_gui_easy_splitter_container, "#EC NEEDED "Splitter
gc_top_container TYPE REF TO cl_gui_container, "#EC NEEDED "Top Container
gc_bottom_container TYPE REF TO cl_gui_container, "#EC NEEDED "Bottom Container
gc_document TYPE REF TO cl_dd_document, "#EC NEEDED "Document
gc_events TYPE REF TO lcl_event_class, "#EC NEEDED " Local Event Class
gc_grid TYPE REF TO cl_gui_alv_grid, "#EC NEEDED " ALV Class
" Creating Docking
CREATE OBJECT gc_docking
EXPORTING
ratio = c_95.
IF sy-subrc EQ 0.
* Splitting the Docking container
CREATE OBJECT gc_split
EXPORTING
parent = gc_docking
sash_position = c_10 "Position of Splitter Bar (in Percent)
with_border = c_1. "With Border = 1 Without Border = 0
ENDIF.
* Placing the containers in the splitter
gc_top_container = gc_split->top_left_container .
gc_bottom_container = gc_split->bottom_right_container .
* Creating Grid
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_bottom_container.
ELSE.
* Background job handling
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_docking.
ENDIF.
* Creating the document
CREATE OBJECT gc_document
EXPORTING
style = 'ALV_GRID'.
Regards,
Sameer -
How to create a gui pf status and guititle in module pool programming?
hi frnds,
how to create a gui pf status and gui title in module pool programming?
my problem is i created a screen and wen execute the screen by a tcode.am nt able to activate SAVE BACK EXIT CANCEL COMMANDS?.how to do this can any one explain in detail procedure?
plz gve step by step process.Hi,
For Title:In PBO...just write
SET TITLEBAR 'ZTITLE'.
double click on 'ZTITLE'....give whatever title u want...save it...activate...and check...reward points if useful...
PF means FUNCTION CODE
ex; set pf-status 'zrstatus'.
double click on the zrstatus expand the application server ,
at the time of execution the default menu(ie system,help),application toolbar buttons like enter,help etc and function keys(by default there will be no function keys)as are there on the normal
will appear on the screen.
Details:
PF-STATUS is used to set the GUI Status of a screen, ie you can control the options on your menu bar, application toolbar, the function keys assigned to various options etc.
Implementing the status for a screen can be done in 2 ways:
1) Create the GUI status using the object list of the program or by using the transaction SE41. Then, assign it to the screen using SET PF-STATUS statement.
2) Create the GUI status by means of forward navigation, ie, use the SET PF-STATUS 'XXX' statement where 'XXX' is the name of the GUI status and double click on it to create it.
Status names can have a maximum of 20 characters.
After assigning a GUI status to a screen, this is inherited to all subsequent screens. In order to have a different status for each of the subsequent screens, you have to set a separate status for each screen.
In transaction SE41,
1) Give the program name and the status name and click on the Create button.
2) Go to 'Function keys' and expand.
3) On top of the save icon type SAVE, on top of the back icon type BACK, on top the the exit icon type EXIT etc ie on top of all the icons that you want to use, type the respective names that you want to give.
Whatever you have typed now becomes the function codes of these icons and can be used in your program.
For example you have a screen 100.
In the 'Element list' tab of the screen, give "ok_code" as the name where "OK" is the type of screen element. Activate screen.
The flow logic for the screen looks like this:
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
Create the modules STATUS_0100 and USER_COMMAND_0100 in the main program by simply double clicking on them.
The code for these modules can be something like this:
MODULE status_0100 OUTPUT.
SET PF-STATUS 'Example'. "Example is the name of the GUI status
ENDMODULE.
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'SAVE'.
"call a subroutine to save the data or give statements to save data.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
Regards,
Shiva Kumar (Reward If helpful) -
System generated value for a field and incrementing (using module pool pro)
Hi,
I'm getting system generated value for a field and incrementing (i.e done by coding) when i'm saving the screen or transaction (which is created using module pool programming) while modifying, saving its working fine, but when i'm going out of the screen or exit n again i start the screen (with some ztransco) the value for the field again starting from 0 so i want to start from the same value for a field where we exit or got out from the screen n incremented respectively while saving the screen,
Thanks & Regards,
MS
Edited by: Rob Burbank on May 4, 2010 10:40 AMSearch the forum for number range objects.
Rob -
Suppress table control in module pool programming
Hi Frnds
I need your help to find out if is possible to suppress a table control by configuration in SPRO.
I am able to suppress all the other fields on the screen using the configuration in SPRO,but for table control it is not working that ways.
By programming in PBO I am able to proceed but I need to find out if it possible to do the same through configuration.
Thanks
Mitesh
nulladd module vertical_scroll in PBO and try.
module vertical_scroll output.
data n type i.
describe table it_div lines n.
tabctrl-lines = n.
endmodule.
reward if useful. -
Difference between poh and pov in module pool programming
hi all,
pls tell me difference between poh and pov and how i check validation in screenHi,
POV gives you F4 help.
like:
You can call dialog modules in the POV event using the event keyword PROCESS ON VALUE-REQUEST.
PROCESS ON VALUE-REQUEST.
FIELD f MODULE mod.
After the PROCESS ON VALUE-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F4 for a field f, the system calls the module mod belonging to the FIELD statement. If there is more than one FIELD statement for the same field f, only the first is executed. The module mod is defined in the ABAP program like a normal PAI module. However, the contents of the screen field f are not available, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. You can now program your own value lists in the module. However, this procedure is only recommended if it really is not possible to use a search help. Defining search helps is much easier than PROCESS ON VALUE-REQUEST, since the system takes over some of the standard operations, such as getting field contents from the screen. It also ensures that the F4 help has a uniform look and feel throughout the system. Furthermore, it means that you do not have to reassign input help to fields on each screen.
Despite the introduction of search helps (and search help exits), there are still cases in which you need to use parts of the standard F4 functions directly. In this case, there are some standard function modules that you can use in the POV event. They support search helps, as well as all other kinds of input help, and are responsible for data transport between the screen and the input help. These alll have the prefix F4IF_. The most important are:
· F4IF_FIELD_VALUE_REQUEST
Calls the input help of the ABAP Dictionary dynamically. You can pass the component names of a structure or database table of the ABAP Dictionary to the function module in the import parameters TABNAME and FIELDNAME. The function module starts the ABAP Dictionary input help for this component. All of the relevant screen fields are read. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the users selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
· F4IF_INT_TABLE_VALUE_REQUEST
This function module displays a value list that you created in an ABAP program. The self-programmed value list is passed to the function module as the table parameter VALUE_TAB. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the users selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
There are also two function modules - DYNP_VALUES_READ and DYNP_VALUES_UPDATE - that can read the values of screen fields and return values to them during the POV event. For further information, refer to the relevant function module documentation.
Input help in dialog modules
REPORT demo_dynpro_f4_help_module.
TYPES: BEGIN OF values,
carrid TYPE spfli-carrid,
connid TYPE spfli-connid,
END OF values.
DATA: carrier(3) TYPE c,
connection(4) TYPE c.
DATA: progname TYPE sy-repid,
dynnum TYPE sy-dynnr,
dynpro_values TYPE TABLE OF dynpread,
field_value LIKE LINE OF dynpro_values,
values_tab TYPE TABLE OF values.
CALL SCREEN 100.
MODULE init OUTPUT.
progname = sy-repid.
dynnum = sy-dynnr.
CLEAR: field_value, dynpro_values.
field_value-fieldname = 'CARRIER'.
APPEND field_value TO dynpro_values.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE value_carrier INPUT.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'DEMOF4HELP'
fieldname = 'CARRIER1'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'CARRIER'.
ENDMODULE.
MODULE value_connection INPUT.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
TABLES
dynpfields = dynpro_values.
READ TABLE dynpro_values INDEX 1 INTO field_value.
SELECT carrid connid
FROM spfli
INTO CORRESPONDING FIELDS OF TABLE values_tab
WHERE carrid = field_value-fieldvalue.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CONNID'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'CONNECTION'
value_org = 'S'
TABLES
value_tab = values_tab.
ENDMODULE.
*POH gives you F1 documentation:*
like:
If data element supplement documentation is insufficient for your requirements, or you want to display help for program fields that you have not copied from the ABAP Dictionary, you can call dialog modules in the POH event:
PROCESS ON HELP-REQUEST.
FIELD is defined in the ABAP program like a normal PAI module. The processing logic of the module must ensure that adequate help is displayed for the field in question. Instead of calling an extra screen with text fields, you should use one of the following function modules to display a suitable SAPscript document:
HELP_OBJECT_SHOW_FOR_FIELD
This function module displays the data element documentation for components of any structure or database table from the ABAP Dictionary. You pass the name of the component and structure or table to the import parameters FIELD and TABLE.
HELP_OBJECT_SHOW
Use this function module to display any SAPscript document. You must pass the document class (for example, TX for general texts, DE for data element documentation) and the name of the document to the import parameters DOKCLASS and DOKNAME. For technical reasons, you must also pass an empty internal table with the line type TLINE to the tables parameter of the function module.
For further information about how to create SAPscript documents, refer to the Documentation of System Objects documentation.
Field help on screens.
REPORT DEMO_DYNPRO_F1_HELP.
DATA: TEXT(30),
VAR(4),
INT TYPE I,
LINKS TYPE TABLE OF TLINE,
FIELD3, FIELD4.
TABLES DEMOF1HELP.
TEXT = TEXT-001.
CALL SCREEN 100.
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE F1_HELP_FIELD2 INPUT.
INT = INT + 1.
CASE INT.
WHEN 1.
VAR = '0100'.
WHEN 2.
VAR = '0200'.
INT = 0.
ENDCASE.
ENDMODULE.
MODULE F1_HELP_FIELD3 INPUT.
CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'
EXPORTING
DOKLANGU = SY-LANGU
DOKTITLE = TEXT-002
CALLED_FOR_TAB = 'DEMOF1HELP'
CALLED_FOR_FIELD = 'FIELD1'.
ENDMODULE.
MODULE F1_HELP_FIELD4 INPUT.
CALL FUNCTION 'HELP_OBJECT_SHOW'
EXPORTING
DOKCLASS = 'TX'
DOKLANGU = SY-LANGU
DOKNAME = 'DEMO_FOR_F1_HELP'
DOKTITLE = TEXT-003
TABLES
LINKS = LINKS.
ENDMODULE.
Regards,
Renjith Michael -
Want help in creating pov and poh in module pool
i want to create process on help and process on value request.
which function modules to use and how use them
then i want put icon symbols over push buttons.
can u please send me this information also.
i am new to screen programming .krishna,
For POV
Input Help in Dialog Modules
You can call dialog modules in the POV event using the event keyword PROCESS ON VALUE-REQUEST.
PROCESS ON VALUE-REQUEST.
FIELD are not available, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. You can now program your own value lists in the module. However, this procedure is only recommended if it really is not possible to use a search help. Defining search helps is much easier than PROCESS ON VALUE-REQUEST, since the system takes over some of the standard operations, such as getting field contents from the screen. It also ensures that the F4 help has a uniform look and feel throughout the system. Furthermore, it means that you do not have to reassign input help to fields on each screen.
Despite the introduction of search helps (and search help exits), there are still cases in which you need to use parts of the standard F4 functions directly. In this case, there are some standard function modules that you can use in the POV event. They support search helps, as well as all other kinds of input help, and are responsible for data transport between the screen and the input help. These all have the prefix F4IF_. The most important are:
F4IF_FIELD_VALUE_REQUEST
Calls the input help of the ABAP Dictionary dynamically. You can pass the component names of a structure or database table of the ABAP Dictionary to the function module in the import parameters TABNAME and FIELDNAME. The function module starts the ABAP Dictionary input help for this component. All of the relevant screen fields are read. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the users selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
F4IF_INT_TABLE_VALUE_REQUEST
This function module displays a value list that you created in an ABAP program. The value list is passed to the function module as the table parameter VALUE_TAB. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the users selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
There are also two function modules - DYNP_VALUES_READ and DYNP_VALUES_UPDATE - that can read the values of screen fields and return values to them during the POV event. For further information, refer to the relevant function module documentation.
Input help in dialog modules
REPORT DEMO_DYNPRO_F4_HELP_MODULE.
TYPES: BEGIN OF VALUES,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
END OF VALUES.
DATA: CARRIER(3) TYPE C,
CONNECTION(4) TYPE C.
DATA: PROGNAME LIKE SY-REPID,
DYNNUM LIKE SY-DYNNR,
DYNPRO_VALUES TYPE TABLE OF DYNPREAD,
FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,
VALUES_TAB TYPE TABLE OF VALUES.
CALL SCREEN 100.
MODULE INIT OUTPUT.
PROGNAME = SY-REPID.
DYNNUM = SY-DYNNR.
CLEAR: FIELD_VALUE, DYNPRO_VALUES.
FIELD_VALUE-FIELDNAME = 'CARRIER'.
APPEND FIELD_VALUE TO DYNPRO_VALUES.
ENDMODULE.
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE VALUE_CARRIER INPUT.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
TABNAME = 'DEMOF4HELP'
FIELDNAME = 'CARRIER1'
DYNPPROG = PROGNAME
DYNPNR = DYNNUM
DYNPROFIELD = 'CARRIER'.
ENDMODULE.
MODULE VALUE_CONNECTION INPUT.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = PROGNAME
DYNUMB = DYNNUM
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = DYNPRO_VALUES.
READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.
SELECT CARRID CONNID
FROM SPFLI
INTO CORRESPONDING FIELDS OF TABLE VALUES_TAB
WHERE CARRID = FIELD_VALUE-FIELDVALUE.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'CONNID'
DYNPPROG = PROGNAME
DYNPNR = DYNNUM
DYNPROFIELD = 'CONNECTION'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = VALUES_TAB.
ENDMODULE.
The next screen (statically defined) for screen 100 is itself. It has the following layout:
The input fields have been adopted from the program fields CARRIER and CONNECTION. The pushbutton has the function code CANCEL with function type E.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
MODULE INIT.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
PROCESS ON VALUE-REQUEST.
FIELD CARRIER MODULE VALUE_CARRIER.
FIELD CONNECTION MODULE VALUE_CONNECTION.
When the user chooses input help for the individual fields, the following is displayed:
For the Airline field, the POV module VALUE_CARRIER is called. The function module F4IF_FIELD_VALUE_REQUEST displays the input help for the component CARRIER1 of the structure DEMOF4HELP from the ABAP Dictionary, namely the search help DEMOF4DE. The users selection is returned to the screen field CARRIER.
For the Flight number field, the POV module VALUE_CONNECTION is called. The function module DYNP_VALUE_READ transports the value of the screen field CARRIER into the program. The program then reads the corresponding values from the database table SPFLI into the internal table VALUES_TAB using a SELECT statement, and passes the internal table to F4IF_INT_TABLE_VALUE_REQUEST. This displays the internal table as input help, and places the users selection into the screen field CONNECTION.
For POH
Field Help
There are three ways of displaying field help for screen elements:
Data Element Documentation
If you place a field on the screen in the Screen Painter by copying a ABAP Dictionary field, the corresponding data element documentation from the ABAP Dictionary is automatically displayed when the user chooses field help (as long as the help has not been overridden in the screen flow logic).
For further information about creating data element documentation, refer to data elements.
Data Element Supplement Documentation
If the data element documentation is insufficient, you can expand it by writing a data element supplement
Data element supplement documentation contains the heading Definition, as well as the following others:
Use
Procedure
Examples
Dependencies
To create data element supplement documentation for a screen, choose Goto ® Documentation ® DE supplement doc. from the element list of the screen. A dialog box appears in which the system proposes a number as the identified for the data element supplement. You can then enter help texts for the above headings using the SAPscript editor.
Data element supplement documentation created in this way is program- and screen-specific. Any data element supplement documentation created in the ABAP Dictionary with the same number is overridden by the screen-specific documentation. You can link existing data element supplement documentation created in the ABAP Dictionary with a screen field by using the table THLPF. To do this, crate a new row in THLPF containing the following data: Program name, screen name, field name, and number of the data element supplement documentation.
To display data element supplement documentation, you must code the following screen flow logic in the POH event:
PROCESS ON HELP-REQUEST.
FIELD is defined in the ABAP program like a normal PAI module. The processing logic of the module must ensure that adequate help is displayed for the field in question. Instead of calling an extra screen with text fields, you should use one of the following function modules to display a suitable SAPscript document:
HELP_OBJECT_SHOW_FOR_FIELD
This function module displays the data element documentation for components of any structure or database table from the ABAP Dictionary. You pass the name of the component and structure or table to the import parameters FIELD and TABLE.
HELP_OBJECT_SHOW
Use this function module to display any SAPscript document. You must pass the document class (for example, TX for general texts, DE for data element documentation) and the name of the document to the import parameters DOKCLASS and DOKNAME. For technical reasons, you must also pass an empty internal table with the line type TLINE to the tables parameter of the function module.
For further information about how to create SAPscript documents, refer to the Documentation of System Objects documentation.
Field help on screens.
REPORT DEMO_DYNPRO_F1_HELP.
DATA: TEXT(30),
VAR(4),
INT TYPE I,
LINKS TYPE TABLE OF TLINE,
FIELD3, FIELD4.
TABLES DEMOF1HELP.
TEXT = TEXT-001.
CALL SCREEN 100.
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE F1_HELP_FIELD2 INPUT.
INT = INT + 1.
CASE INT.
WHEN 1.
VAR = '0100'.
WHEN 2.
VAR = '0200'.
INT = 0.
ENDCASE.
ENDMODULE.
MODULE F1_HELP_FIELD3 INPUT.
CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'
EXPORTING
DOKLANGU = SY-LANGU
DOKTITLE = TEXT-002
CALLED_FOR_TAB = 'DEMOF1HELP'
CALLED_FOR_FIELD = 'FIELD1'.
ENDMODULE.
MODULE F1_HELP_FIELD4 INPUT.
CALL FUNCTION 'HELP_OBJECT_SHOW'
EXPORTING
DOKCLASS = 'TX'
DOKLANGU = SY-LANGU
DOKNAME = 'DEMO_FOR_F1_HELP'
DOKTITLE = TEXT-003
TABLES
LINKS = LINKS.
ENDMODULE.
The next screen (statically defined) for screen 100 is 100. It has the following layout:
The screen fields DEMOf1HELP-FIELD1 and DEMOF1HELP-FIELD2 from the ABAP Dictionary and the program fields FIELD3 and FIELD4 are assigned to the input fields. The pushbutton has the function code CANCEL with function type E.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
PROCESS ON HELP-REQUEST.
FIELD DEMOF1HELP-FIELD2 MODULE F1_HELP_FIELD2 WITH VAR.
FIELD FIELD3 MODULE F1_HELP_FIELD3.
FIELD FIELD4 MODULE F1_HELP_FIELD4.
The components FIELD1 and FIELD2 of structure DEMOF1HELP both refer to the data element DEMOF1TYPE. This data element is documented, and also has two supplements with numbers 0100 and 0200.
The following field help is displayed:
When the user chooses F1 on the input field for DEMOF1HELP-FIELD1, the data element documentation for DEMOF1TYPE is displayed, since the field does not occur in the PROCESS ON HELP-REQUEST event.
If the user chooses F1 repeatedly for the input field DEMOF1HELP-FIELD2, the data element documentation is displayed, along with the supplement documentation for either 0100 or 0200 alternately. The variable VAR is filled in the dialog module F1_HELP_FIELD2.
When the user chooses F1 on the input field for FIELD3, the data element documentation for DEMOF1TYPE is displayed, since this is called in the dialog module F1_HELP_FIELD3 by the function module HELP_OBJECT_SHOW_FOR_FIELD.
When the user chooses F1 on the input field for FIELD4, the SAPscript documentation DEMO_FOR_F1_HELP is displayed, since this is called in the dialog module F1_HELP_FIELD4 by the function module HELP_OBJECT.
Don't forget to reward if useful... -
Difference between screen painter and module pool
Hi guys,
what's the difference between SCREEN PAINTER and MODULE POOL ....
can anyone plz give brief description ...
regards
venuhi ,
As its said by many colleagues in SDN , there are not very major differences between Modulepools and screen painter .
The few differences are :
1) <b>Module pool is nothing but a pool ( series ) of screens . and Screen painter ( SE51 ) is a tool used for creating/designing screens .</b>
2) <u>While creating a modulepool you even need to create a transaction and assign this module pool program else the mpool program doesnt work . I think this is place we can say they are different .</u>
3) <b>If at all you create a screen in screen painter ( SE51 ) , that doesnot function by its own , you need to assign it to any of the executable programs or modulepool programs .Here is again a difference .</b>
Regards,
Ranjita ..
Message was edited by:
Ranjita Kar -
Hi all plz any one send me the doc for Module pool programmiing to learn on my own
thanks & regards
vamsinHi,
This is the material find the attachment.
hi,
Pool table
A database table defined in the ABAP Dictionary whose database instance is assigned to more than one table defined in the ABAP Dictionary. Multiple pool tables are assigned to a table pool in the database. The key fields of a pool table have to be character-type fields. The table pool's primary key consists of two fields: TABNAME for the name of a pool table, and VARKEY for the interdependent contents of the key fields in the corresponding pool table. The non-key fields of the pool table are stored in compressed format in their own column, called VARDATA, of the table pool. The only way to access pool tables is by using Open SQL. Joins are not allowed.
Table Pool
Database table in the database that contains the data of several pool tables.
Cluster Table
Database table defined in the ABAP Dictionary, whose version on the database is not only assigned to one table defined in the ABAP Dictionary. Several cluster tables are assigned to a table cluster in the database. The intersection of the key fields of the cluster tables forms the primary key of the table cluster. The other columns of the cluster tables are stored in compressed form in a single column VARDATA of the table cluster. You can access cluster tables only via Open SQL, and only without using joins.
Table Cluster
Database table in the database that contains the data of several cluster tables.
Note: Never mix up with a database table that has the necessary structure for storing data clusters in database tables and in the shared memory. Those are called INDX-type, with reference to the database table INDX supplied by SAP. Data clusters are groupings of data objects for transient and persistent storage in a selectable storage medium. A data cluster can be processed using the statements IMPORT, EXPORT, and DELETE FROM
P.Naganjana ReddyDAY-4 CONTENTS
SCREEN PAINTER
��
Introduction to Dialog Programming
��
Transactions
Screens (dynpros)
ABAP/4 module pool
Transferring Field Data
Field Attributes
Error Dialogs
Data Consistency
Dynpro
Layout
��
Exercise
TABLE CONTROL
��
Functional scope
��
Programming
��
Attributes
��
EXERCISE
TABSTRIP CONTROLS
��
Defining the Tabstrip Control Area and Tab Titles
��
Assigning a Subscreen Area to a Tab Title
��
Paging in the SAPgui
��
Programming the Flow Logic
��
EXERCISE
P.Naganjana Reddy
SCREEN WITH FIELDS
Introduction to Dialog Programming
Transactions
A transaction is a program that conducts a dialog with the user. In a typical dialog, the
system displays a screen on which the user can enter or request information. As a reaction on
the the user input or request, the program executes the appropriate actions: it branches to the
next screen, displays an output, or changes the database.
Example
A travel agent wants to book a flight. The agent enters the corresponding data on the
screen. The system either confirms the desired request, that is, the agent can book the flight
and the customer travels on the desired day on the reserved seat to the chosen destination,
or the system displays the information that the flight is already booked up.
To fulfil such requirements, a dialog program must offer:
_a user-friendly user interface
_format and consistency checks for the data entered by the user
_easy correction of input errors
_access to data by storing it in the database.
ABAP/4 offers a variety of tools and language elements to meet the requirements stated
above in the dialog programs.
Structure of a Dialog Program
A dialog program consists of the following basic components:
P.Naganjana Reddy
Screens (dynpros)
Each dialog in an SAP system is controlled by dynpros. A dynpro (Dynamic PROgram) consists of a screen and its flow logic and controls exactly one dialog step. The flow logic determines which processing takes place before displaying the screen (PBO-Process Before Output) and after receiving the entries the user made on the screen (PAI-Process After Input).
The screen layout fixed in the Screen Painter determines the positions of input/output
fields, text fields, and graphical elements such as radio buttons and checkboxes. In addition, the Menu Painter allows to store menus, icons, pushbuttons, and function keys in one or more GUI statuses. Dynpros and GUI statuses refer to the ABAP/4 program that control the sequence of the dynpros and GUI statuses at runtime.
ABAP/4 module pool
Each dynpro refers to exactly one ABAP/4 dialog program. Such a dialog program is also called a module pool, since it consists of interactive modules. The flow logic of a dynpro contains calls of modules from the corresponding module pool. Interactive modules called at the PBO event are used to prepare the screen template in accordance to the context, for example by setting field contents or by suppressing fields from the display that are not needed. Interactive modules called at the PAI event are used to check the user input and to trigger appropriate dialog steps, such as the update task.
All dynpros to be called from within one transaction refer to a common module pool. The dynpros of a module pool are numbered. By default, the system stores for each dynpro the dynpro to be displayed next. This dynpro sequence or chain can be linear as well as cyclic. From within a dynpro chain, you can even call another dynpro chain and, after processing it, return to the original chain.
Transferring Field Data
How do I display fields known in an ABAP/4 module on the screen? How do I transfer
user entries on the screen to the module? In contrast to report programming, you cannot write field data to the screen using the WRITE statement. The system instead transfers data by comparing screen field names with ABAP/4 variable names. If both names are the same, it transfers screen field values to ABAP/4 program fields and vice versa. This happens immediately before and immediately after displaying the screen.
Field Attributes
For all screen fields of a dynpro, field attributes are defined in the Screen Painter. If a
field name in the screen corresponds to the name of an ABAP/4 Dictionary field, the system automatically establishes a reference between these two fields. Thus, a large number of field attributes in the dynpro is automatically copied from the ABAP/4 Dictionary. The field attributes together with data element and domain of the assigned Dictionary field form the basis for the standard functions the dynpro executes in a dialog (automatic format check for screen fields, automatic value range check, online help, and so on).
Error Dialogs
Another task of the dynpro processor is to conduct error dialogs. Checking the input data is carried out either automatically using check tables of the ABAP/4 Dictionary or by the ABAP/4 program itself. The dynpro processor includes the error message into the received screen and returns the screen to the user. The message may be context-sensitive, that is, the system replaces placeholders in the message text with current field contents. In addition, only fields whose contents is related to the error and for which a correction may solve the error can accept input.
P.Naganjana Reddy
Data Consistency
To keep data consistent within complex applications, ABAP/4 offers techniques for
optimizing database updates that operate independent of the underlying database and correspond to the special requests of dialog programming. For more information on database updates, see Programming Database Updates.
Dynpro
Each screen contains fields used to display or request information. Fields can be text strings, input or output fields, radio buttons, checkboxes, or pushbuttons. The screen of Transaction TZ10 contains only texts and input/output fields.
An SAP dynpro consists of several components:
Flow logic: Calls of the ABAP/4 modules for a screen.
Screen layout: Positions of the texts, fields, pushbuttons, and so on for a screen.
Screen attributes: Number of the screen, number of the subsequent screen, and others.
Field attributes: Definition of the attributes of the individual fields on a screen.
SCREEN PAINTER
You create and edit all components of a dynpro in the Screen Painter. To call the Screen
Painter, create a dynpro in the Object Browser or double-click on an existing dynpro. The Object Browser then calls the Screen Painter. There, you can enter the flow logic of the new dynpro. By pressing the corresponding pushbutton you can maintain the Screen attributes, branch to the Full Screen-Editor or you choose the pushbutton Field list and change the attributes of fields.
Screen Attributes
From the users point of view, a transaction is a sequence of screens, displayed one after
another. How do I determine this sequence? The transactionss attributes determine the first screen to be displayed. The attributes of the individual dynpros determine which screen to display
P.Naganjana Reddy
after the current screen. You can also set the number of the subsequent screen dynamically from within the ABAP/4 program.
Layout
Choose Fullscreen to go to the screen editor. Here you can determine the layout of the
screen. For Transaction TZ10, the desired fields can be copied from Table SPFLI of the
ABAP/4 Dictionary.
Field Attributes
To display and modify the attributes of the individual fields (input/output fields, input
required, possible entries button, invisible, and so on), use the Field list.The fields Company (SPFLI-CARRID) and Flight number (SPFLI-CONNID) are defined as input/output fields. All other fields are used only for outputting the flight data.
Flow Logic
The flow control code of a dynpro consists of a few statements that syntactically ressemble ABAP/4 statements. However, you cannot use flow contol keywords in ABAP/4 and vice versa. You enter the flow control code in the Screen Painter as one component of the dynpro.
The flow control for the dynpro of Transaction TZ10 looks like this:
PROCESS BEFORE OUTPUT.
MODULE SET_STATUS_0100.
PROCESS AFTER INPUT
MODULE USER_COMMAND_0100.
The PROCESS statement names the event type for the dynpro and the MODULE statement tells the system which ABAP/4 routine to call for this event. In this example, there is only one MODULE for each event PBO and PAI. However, an event can contain several statements with several keywords. (The flow control language contains only few statement types. The most important are MODULE, FIELD, CHAIN, LOOP, CALL SUBSCREEN.) To display information on the statement syntax in the flow logic, choose Utilities Help on... in the flow logic editor. In the subsequent dialog window, mark Flow logickeyword, enter the name of the desired keyword, and press ENTER.
ABAP/4 Module Pool
In the Object Browser, the module pool code belongs to one of the following categories:
Global fields: data declarations that can be used by all modules in the module pool
PBO modules: modules that are called before displaying the screen
PAI modules: modules that are called in response to the user input
Subroutines: subroutines that can be called from any position within the module pool.
You use the ABAP/4 Dictionary to store frequently used data declarations centrally. Objects defined in the Dictionary are known throughout the system. Active Dictionary definitions can be accessed by any application. Data defined in the Dictionary can be included in a screen or used by an ABAP/4 program. You declare global data in the TOP module of the transaction, using the TABLES, STRUCTURE, LIKE statements and others. Transaction TZ10 accesses the Dictionary definition of Table SPFLI to provide the desired flight data display. If the TOP include contains the TABLES: SPFLI declaration, all modules in the module pool can access the table fields of
P.Naganjana Reddy
Table SPFLI. The PAI module USER_COMMAND_0100 checks which pushbutton the user activated (CASE OK_CODE). The Display pushbutton in Transaction TZ10 has the function code
SHOW. (For more information on handling function codes, see Processing User Requests). The program then tries to select those records in the SPFLI database that correspond to the data the user entered. The WHERE condition determines matching records by comparing the fields SPFLI-CARRID and SPFLI-CONNID with the database key fields CARRID and CONNID. As soon as a matching record is found, the database transfers all accompanying SPFLI fields to the program table.
When the screen is displayed again, the complete information appears in the output fields
of the screen. The system automatically displays these fields, since the ABAP/4 field names SPFLI-CARRID and SPFLI-CONNID are the same as the screen field names.
In the PBO module STATUS_0100 of Transaction TZ10, the screen 100 receives a GUI status (using SET PF-STATUS) and a GUI title (using SET TITLEBAR):
SET PF-STATUS TZ0100.
SET TITLEBAR 100.
A GUI status is a subset of the interface elements used for a certain screen. The status
Comprise those elements that are currently needed by the transaction. The GUI status for a transaction may be composed of the following elements:
The GUI title is the screen title displayed in the title bar of the window. In contrast to the
GUI status that can be used for several screens, a GUI title belongs to one screen.To create and edit GUI status and GUI title, you use the Menu Painter. To start the Menu Painter, create a GUI status or GUI title in an object list in the Object Browser (or double-click on an existing status or title).
Interaction between Dynpro and ABAP/4 Module Pool
In its most simple form, a transaction is a collection of screens and ABAP/4 routines, controlled and executed by a dialog processor. The dialog processor processes screen after screen, thereby triggering the appropriate ABAP/4 processing for each screen. For each screen, the system executes the flow logic that contains the corresponding ABAP/4 processing. The control passes from screen flow logic to ABAP/4 code and back.
The sequence of events for Transaction TZ10, for example, looks like this:
P.Naganjana Reddy
1.
In the PBO event, the statement MODULE STATUS_0100 passes control to the corresponding ABAP/4 module.In the ABAP/4 module pool, the screen to be displayed receives a menu interface.
2.
After processing the module STATUS_0100, control returns to the flow logic.For the PBO event, no further processing is required. The system display the screen and receives entries from the user. The entries are:
the values for the fields Company and Flight number.
the four-character function code that tells which pushbutton the user activated.
3.
The user input triggers the PAI event. The first PAI statement passes control to the ABAP/4 module USER_COMMAND_0100.Module USER_COMMAND_0100 processes the requests of the user.
4. After processing MODULE USER_COMMAND_0100, control returns to PAI. This terminates the dialog.
P.Naganjana Reddy
EXERCISE
Goto to ABAP editor, and enter the program name ZKA_SCREEN.
Declare the tables and call the screen.
In order to create the object, double click on the screen no, you will automatically guided to the screen painter SE51.
P.Naganjana Reddy
Enter the short description and click on the FLOW LOGIC tab.
Uncomment the flow logic, both PAI and PBO.
P.Naganjana Reddy
Now click on the LAYOUT button.
Click on the DICTIONARY/PROGRAM FIELDS WINDOW F6 button. Type in the table name and click on GET FROM DIC button and select the fields required for the screen and click on the COPY button.
P.Naganjana Reddy
Now drag and place the INPUT/OUTPUT fields box on the screen.
Now click on the TEXT FIELD button and place in the screen and stretch the box for the size required. Now double click on the box, U will get the attributes screen. Enter the name and Text for the field.
P.Naganjana Reddy
Now we need to place the bush buttons. So Click on the push button on the left side and place it on the screen. Double click on it, u will get the attributes screen. Enter the name, text and the icon required and mainly the FCTCODE. It is the one which links the screen painter with the code.
Once everything is set up, SAVE, CHECK and ACTIVATE the screen.
P.Naganjana Reddy
Click on the BACK button. U will be guided to the FLOW LOGIC screen.
Double click on PAI, Because for the screen painter with the fields, Process After the Input is done and so u will guided to the Editor screen.
P.Naganjana Reddy
Now we need to set the System-Uses commands which links the code to the Editor.
So the conditions would be:
IF SY-UCOMM = 'DISPLAY'.
SELECT SINGLE * FROM ZKA_CENTER WHERE CENTERNO = ZKA_CENTER-CENTERNO.
ELSEIF SY-UCOMM ='SAVE'.
INSERT ZKA_CENTER.
ELSEIF SY-UCOMM = 'REFRESH'.
CLEAR ZKA_CENTER.
ELSEIF SY-UCOMM = 'GOTO'.
LEAVE TO SCREEN '0002'.
ELSEIF SY-UCOMM = 'EXIT'.
LEAVE PROGRAM.
ENDIF.
If u create many screens and need links between the screens then u can use GOTO to guide to the other screen.
SAVE, CHECK and ACTIVATE and click on TEST.
P.Naganjana Reddy
Now click on the DISPLAY button.
Also verify with SAVE, REFRESH and EXIT buttons. Thus the screen painter.
P.Naganjana Reddy
TABLE CONTROL
Basic form
CONTROLS ctrl TYPE TABLEVIEW USING SCREEN scr.
Effect
Creates a table control ctrl of the type TABLEVIEW . The reference screen for the initialization is the screen scr . Area of use The table control (referred to here as TC ) facilitates the display and entry of one-line, tabular data in dialog transactions. The functional scope has been defined so that you can implement many typical set operations usually handled by an elementary STEP-LOOP with the standard methods of a TC . Functional scope
Resizeable table grid for displaying and editing data.
Column width and column position modifiable by user and by program.
Storing and loading of user-specific column layout.
Selection column for line selection with color selection display.
Variable column headers as pushbuttons for column selection.
Simple selection, multiple selection, Select/deselect all.
Scrolling functions (horizontal and vertical) via scroll bar.
Fixing of any number of key columns.
Setting attributes for each cell at runtime.
Programming The data exchange between the application and the SAPgui is achieved with a STEP-LOOP , i.e. an ABAP/4 module is called to transfer data for each page.
Example
Processing without an internal table
PROCESS BEFORE OUTPUT.
LOOP WITH CONTROL ctrl.
MODULE ctrl_pbo.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL ctrl.
MODULE ctrl_pai.
ENDLOOP.
In this case, the module ctrl_pbo OUTPUT is called once for each output line before the screen is displayed, in order to fill the output fields. After the user has entered data on the screen, the module ctrl_pai INPUT is executed to check the input and copy the new contents.
Example
Processing with an internal table
P.Naganjana Reddy
PROCESS BEFORE OUTPUT.
LOOP AT itab WITH CONTROL ctrl CURSOR ctrl-CURRENT_LINE.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT itab WITH CONTROL ctrl.
MODULE ctrl_pai.
ENDLOOP.
Here, the system fills the output fields before displaying the screen by reading the internal table itab. When the user has entered data, the module ctrl_pai INPUT must be executed to check the input and to refresh the contents of the internal table. Vertical scrolling with the scroll bar is followed by the event PAI for the displayed page. Then, cntl-TOP_LINE is increased and PBO is processed for the next page. Program-driven scrolling and the most of the functionality described above is achieved by manipulating the control attributes.
Attributes The CONTROLS statement creates a complex data object of the type CXTAB_CONTROL with the name of the control. You maintain the initial values in the Screen Painter and assign the screen with the initial values for a control using the addition USING SCREEN . Initialization is achieved automatically in the "1st access to the control" (setting or reading values). You can use the customizing button (in the top right corner) to save the current setting (column widths and column positions) and use it as the initial value for the next call. All the initial values can be overwritten by the program using the MOVE ... TO TC attributes statement.
EXERCISE
Enter the Editor with SE38.
Declare the Tables and an internal table.
Then use the CONTROLS statement to have the controls for the Table control.
P.Naganjana Reddy
CONTROLS: <var> TYPE TABLEVIEW USING SCREEN '<screenno>'.
Now call the screen with the CALL SCREEN statement. Click on the screen to draw the table.
Fill in the attributes screen with the short description and click on the LAYOUT button.
Now click on the TABLE CONTROL button and draw the table to the size required. Double click on the table and enter the Attributes giving the Table-control name.
And select the check boxes for the vertical & horizontal resizing and separators.
Click on the DICTIONARY/PROGRAM FIELDS WINDOW F6 button. Type in the table name and click on GET FROM PROGRAM button and select the fields required for the screen and click on the COPY button.
P.Naganjana Reddy
Enter the header with the TEXT FIELDS button by double clicking on the TEXT FIELD and fill in the ATTRIBUTES button with the name and text.
P.Naganjana Reddy
SAVE, CHECK & ACTIVATE.
Click the BACK button and go the FLOW LOGIC screen.
P.Naganjana Reddy
REPORT ZKA_TC .
TABLES: ZKA_EMP.
DATA: ITAB LIKE ZKA_EMP OCCURS 0 WITH HEADER LINE.
CONTROLS: TC TYPE TABLEVIEW USING SCREEN '0001'.
CALL SCREEN '0001'.
*& Module STATUS_0001 OUTPUT
text
MODULE STATUS_0001 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
SELECT * FROM ZKA_EMP INTO TABLE ITAB.
ENDMODULE. " STATUS_0001 OUTPUT
*& Module USER_COMMAND_0001 INPUT
P.Naganjana Reddy
text
MODULE USER_COMMAND_0001 INPUT.
IF SY-UCOMM = 'EXIT'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE. " USER_COMMAND_0001 INPUT
P.Naganjana Reddy
TABSTRIP CONTROLS
A tabstrip control is a screen object consisting of two or more pages. Each tab page consists of a tab title and a page area. If the area occupied by the tabstrip control is too narrow to display all of the tab titles, a scrollbar appears, allowing you to reach the titles that are not displayed. There is also a pushbutton that allows you to display a list of all tab titles.
Tabstrip controls allow you to place a series of screens belonging to an application on a single screen, and to navigate between them easily. The recommended uses and ergonomic considerations for tabstrip controls are described in the Tabstrip Control section of the SAP Style Guide.
From a technical point of view, a tab page is a subscreen with a pushbutton assigned to it, which is displayed as the tab title.
The tabstrip control is the set of all the tab pages. Tabstrip controls are therefore subject to the same restrictions as subscreens. In particular, you cannot change the GUI status
P.Naganjana Reddy
when you switch between pages in the tabstrip control. However, they are fully integrated into the screen environment, so present no problems with batch input.
To use a tabstrip control on a screen, you must be using a SAPgui with Release 4.0 or higher, and its operating system must be Motif, Windows 95, MacOS, or Windows NT with version 3.51 or higher.
When you create a tabstrip control, you must:
Define the tab area on a screen and the tab titles.
Assign a subscreen area to each tab title.
Program the screen flow logic.
Program the ABAP processing logic.
You must then decide whether you want to page through the tabstrip control at the SAPgui or on the application server. In the first case, each tab page has its own subscreen. In the second, there is a single subscreen area that is shared by all tab pages.
Defining the Tabstrip Control Area and Tab Titles
You define both the tabstrip area and the tab titles in the screen layout. The tabstrip area has a unique name and a position, length, and height. You can also specify whether the tabstrip area can be resized vertically or horizontally when the user resizes the window. If the area supports resizing, you can specify a minimum size for it.
When you define a tabstrip area, it already has two tab titles. Tab titles are technically exactly the same as pushbuttons. To create additional tab titles, simple create pushbuttons in the row containing the tab titles. Tab titles have the same attributes as pushbuttons, that is, each has a name, a text, and a function code. You can also use icons and dynamic texts with tab titles.
Assigning a Subscreen Area to a Tab Title
You must assign a subscreen area to each tab title. There are two ways of doing this:
Paging in the SAPgui
You need to assign a separate subscreen area to each tab title, and define the function codes of the tab titles with type P (local GUI function). In the screen flow logic, you call all the subscreens in the PBO event. This means that all of the tab pages reside locally on the SAPgui.
When the user chooses a tab title, paging takes place within the SAPgui. In this respect, the tabstrip control behaves like a single screen. In particular, the PAI event is not triggered when the user chooses a tab title, and no data is transported. While this improves the performance of your tabstrip control, it also has the negative effect that when the user does trigger the PAI event, all of the input checks for all of the subscreens are performed. This means that when the user is working on one tab page, the input checks may jump to an unfilled mandatory field on another page.
P.Naganjana Reddy
Local paging at the SAPgui is therefore most appropriate for screens that display data rather than for input screens.
Paging on the Application Server
One subscreen area is shared by all tab titles and called in the PBO event. You define the function codes of the individual tab titles without a special function type. When the user chooses a tab page, the PAI event is triggered, and you must include a module in your flow logic that activates the appropriate tab page and assigns the correct subscreen to the subscreen area.
Since the PAI event is triggered each time the user chooses a tab title, this method is less economical for the application server, but the input checks that are performed only affect the current tab page.
Procedure in Either Case
You create the subscreen areas within the tabstrip area. You assign the subscreen areas to one or more tab titles in the Screen Painter by selecting one or more titles. You can also assign a subscreen area to a tab title in the tab title attributes by entering the name of the subscreen area in the Reference field attribute.
The procedure for the alphanumeric Screen Painter is described under Creating Tabstrip Controls.
If you are paging at the SAPgui, create a subscreen area for each tab title. If you are paging at the application server, select all tab titles and create a single subscreen area. The subscreen areas may not cover the top line of the tab area. However, within a tab area, more than one subscreen area can overlap.
Programming the Flow Logic
In the flow logic, all you have to do by hand is include the correct subscreens. The screen flow and data transport to the ABAP program is the same as for normal subscreens. There are two ways of programming the screen flow logic, depending on how you have decided to page through the tabstrip control.
Paging in the SAPgui
When you page in the SAPgui, you must include a subscreen for each subscreen area:
PROCESS BEFORE OUTPUT. ... CALL SUBSCREEN: <area1> INCLUDING [<prog 1>] <dynp 1>, <area2> INCLUDING [<prog 2>] <dynp 2>, <area3> INCLUDING [<prog 3>] <dynp 3>, ... ...
P.Naganjana Reddy
PROCESS AFTER INPUT. ... CALL SUBSCREEN: <area1>, <area2>, <area3>, ... ...
Paging on the Application Server
When you page on the application server, you only have to include a subscreen for the one subscreen area:
PROCESS BEFORE OUTPUT. ... CALL SUBSCREEN <area> INCLUDING [<prog>] <dynp>. ...
PROCESS AFTER INPUT. ... CALL SUBSCREEN <area>. ...
Handling in the ABAP Program
Before you can use a tabstrip control in your ABAP program, you must create a control for each control in the declaration part of your program using the following statement:
CONTROLS <ctrl> TYPE TABSTRIP.
where <ctrl> is the name of the tabstrip area on a screen in the ABAP program. The control allows the ABAP program to work with the tabstrip control. The statement declares a structure with the name <ctrl> . The only component of this structure that you need in your program is called ACTIVETAB.
Use in the PBO event
Before the screen is displayed, you use the control to set the tab page that is currently active. To do this, assign the function code of the corresponding tab title to the component ACTIVETAB:
<ctrl>-ACTIVETAB = <fcode>.
When you page at the SAPgui, you only need to do this once before the screen is displayed. This initializes the tabstrip control. The default active tab page is the first page. After this, the page activated when the user chooses a tab title is set within SAPgui.
When you page on the application server, you must assign the active page both before the screen is displayed for the first time, and each time the user pages. At the same time, you must set the required subscreen screen.
P.Naganjana Reddy
You can suppress a tab page dynamically by setting the ACTIVE field of table SCREEN to 0 for the corresponding tab title.
Use in the PAI event
In the PAI event, ACTIVETAB contains the function code of the last active tab title on the screen. When you page in the SAPgui, this allows you to find out the page that the user can currently see. When you page at the application server, the active tab page is controlled by the ABAP program anyway. The OK_CODE field behaves differently according to the paging method:
Paging in the SAPgui
When you page in the SAPgui, the PAI event is not triggered when the user chooses a tab title, and the OK_CODE field is not filled. The OK_CODE field is only filled by user actions in the GUI status or when the user chooses a pushbutton either outside the tabstrip control or on one of the subscreens.
Paging on the application server
If you are paging at the application server, the PAI event is triggered when the user chooses a tab title, and the OK_CODE field is filled with the corresponding function code. To page through the tabstrip control, you must assign the function code to the ACTIVETAB component of the control:
<ctrl>-ACTIVETAB = <ok_code>.
This statement overwrites the function code of the last active tab page with that of the new tab title. At the same time, you must ensure that the correct subscreen is inserted in the subscreen area. Otherwise, tabstrip controls are handled like normal subscrens in ABAP programs, that is, the ABAP program of a subscreen screen must contain the dialog modules called from the flow logic of the subscreen.
P.Naganjana Reddy
EXERCISE
Goto SE38. Enter the tabstrip program name Eg: ZKA_TABSTRIP and click on the create button.
First we need to declare the tables.
Then use the controls for the tabstrip.
Syntax: <ctrl-name> TYPE TASTRIP.
Now call the screen. Using CALL SCREEN statement.
Double click on the screen no to draw the screen for tabstrip control.
Now uncomment the FLOW LOGIC and click on the LAYOUT.
P.Naganjana Reddy
The flow logic for the tabstrip would be as follows.
PBO:
The PBO is initiated so that the subscreen for the corresponding tab can be maintained.
Syntax:
CALL SUBSCREEEN <sub-screen name> INCLUDING SY-REPID <screen-var>.
PAI:
When the tab is clicked, the corresponding subscren should open
Syntax:
CALL SUBSCREEN <subscreen>.
P.Naganjana Reddy
DRAWING THE TABSTRIP CONTROL:
Click on the TABSTRIP button and place it on the screen for the required size.
Double click on the control and give the name for the tabstrip control in the ATTRIBUTES screen.
Now double click on the tab and fill in the attributes screen for the name and the text.
Also draw the subscreen in one of the tab and refer the same subscreen in the rest of the tabs.
P.Naganjana Reddy
Now in the sub-screens, we need to get the screen for the tabs.
So call an other screen and draw with fields and pushbuttons to perform actions very similar like SCREEN WITH FIELDS (refer screen painter).
Enter the short description and click on the FLOW LOGIC tab.
P.Naganjana Reddy
Uncomment the flow logic, both PAI and PBO.
Now click on the LAYOUT button.
Naganjana Reddy.P
Click on the DICTIONARY/PROGRAM FIELDS WINDOW F6 button. Type in the table name and click on GET FROM DIC button and select the fields required for the screen and click on the COPY button.
Now drag and place the INPUT/OUTPUT fields box on the screen.
P.Naganjana Reddy
Now click on the TEXT FIELD button and place in the screen and stretch the box for the size required. Now double click on the box, U will get the attributes screen. Enter the name and Text for the field.
Now we need to place the bush buttons. So Click on the push button on the left side and place it on the screen. Double click on it, u will get the attributes screen. Enter the name, text and the icon required and mainly the FCTCODE. It is the one which links the screen painter with the code.
P.Naganjana Reddy
Once everything is set up, SAVE, CHECK and ACTIVATE the screen.
P.Naganjana Reddy
Click on the BACK button. U will be guided to the FLOW LOGIC screen.
Double click on PAI, Because for the screen painter with the fields, Process After the Input is done and so u will guided to the Editor screen.
P.Naganjana Reddy
Now we need to set the System-Uses commands which links the code to the Editor.
So the conditions would be:
IF SY-UCOMM = 'DISPLAY'.
SELECT SINGLE * FROM ZKA_CENTER WHERE CENTERNO = ZKA_CENTER-CENTERNO.
ELSEIF SY-UCOMM ='SAVE'.
INSERT ZKA_CENTER.
ELSEIF SY-UCOMM = 'REFRESH'.
CLEAR ZKA_CENTER.
ELSEIF SY-UCOMM = 'GOTO'.
LEAVE TO SCREEN '0002'.
ELSEIF SY-UCOMM = 'EXIT'.
LEAVE PROGRAM.
ENDIF.
The same procedure for the company table as well will lead the screen in the below manner.
P.Naganjana Reddy
Summary:
REPORT ZKA_TABSTRIP .
TABLES: ZKA_EMP,ZKA_COM.
CONTROLS: TS TYPE TABSTRIP..
DATA: SCREENNO(4) TYPE N.
CALL SCREEN '0003'.
*& Module STATUS_0001 OUTPUT
text
MODULE STATUS_0001 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
IF SCREENNO IS INITIAL.
TS-ACTIVETAB = 'EMP'.
SCREENNO = '0002'.
ENDIF.
ENDMODULE. " STATUS_0001 OUTPUT
*& Module USER_COMMAND_0001 INPUT
text
MODULE USER_COMMAND_0001 INPUT.
IF SY-UCOMM = 'EMP'.
TS-ACTIVETAB = 'EMP'.
SCREENNO = '0002'.
ELSEIF SY-UCOMM = 'COM'.
TS-ACTIVETAB = 'COM'.
SCREENNO = '0003'.
ENDIF.
ENDMODULE. " USER_COMMAND_0001 INPUT
*& Module USER_COMMAND_0002 INPUT
text
MODULE USER_COMMAND_0002 INPUT.
IF SY-UCOMM = 'DISPLAY'.
SELECT SINGLE * FROM ZKA_EMP WHERE EMPNO = ZKA_EMP-EMPNO.
ELSEIF SY-UCOMM = 'SAVE'.
INSERT ZKA_EMP.
ELSEIF SY-UCOMM = 'REFRESH'.
CLEAR ZKA_EMP.
ELSEIF SY-UCOMM = 'EXIT'.
LEAVE PROGRAM.
ENDIF.
P.Naganjana Reddy -
How to display LONG TEXT STRING in Module Pool Screen ?
Hi Experts,
I want to display long text string, on screen designed through module pool(SE51). I tried to display through input/output field , but it displays it in SINGLE LINE and i have to scroll all through to view all string.
I want to display it in rectangular format . It doesnt allow me to set HEIGHT of component.
Please provide solution.
Thanks in advance.
Regards
DeepakThis is the program where u can get the WA_THEAD from other program like report and trying to display and modifying that text. U can do instead of WA_THEAD u can generate here itself and use also
*& Module pool ZMP_LTEXT *
PROGRAM ZMP_LTEXT .
TABLES: STXL.
*& Module STATUS_9000 OUTPUT
MODULE STATUS_9000 OUTPUT.
CONSTANTS:line_length type i value 132.
DATA:g_editor type ref to cl_gui_textedit,
g_editor_container type ref to cl_gui_custom_container,
CONT1 type scrfname value 'CONT1',
g_repid like sy-repid,
g_ok_code like sy-ucomm,
g_mytable(132) type c occurs 0,
g_mycontainer(30) type c ,
v_result(256) type c,
g_head like thead,
it_line type table of tline with header line,
wa_stxl type stxl.
DATA : BEGIN OF IT_THEAD1,
ICON TYPE ICON-ID.
INCLUDE STRUCTURE STXL.
DATA : END OF IT_THEAD1.
DATA : IT_THEAD LIKE TABLE OF IT_THEAD1,
WA_THEAD LIKE LINE OF IT_THEAD.
IMPORT WA_THEAD FROM MEMORY ID 'ABCD'.
select SINGLE * from STXL into wa_stxl
where tdname = '00006000156500000002'.
SELECT SINGLE * from STXL into wa_stxl
where tdname = WA_THEAD-TDNAME
AND TDID = WA_THEAD-TDID
AND TDOBJECT = WA_THEAD-TDOBJECT
AND TDSPRAS = WA_THEAD-TDSPRAS.
IF SY-SUBRC NE 0.
MESSAGE 'NO RECORD EXIST' TYPE 'E'.
ENDIF.
MOVE-CORRESPONDING WA_STXL TO G_HEAD.
SET PF-STATUS 'STATUS'.
SET TITLEBAR '001'.
if g_editor is initial.
CREATE OBJECT G_EDITOR_CONTAINER
EXPORTING
PARENT =
CONTAINER_NAME = CONT1
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT G_EDITOR
EXPORTING
MAX_NUMBER_CHARS =
STYLE = 0
WORDWRAP_MODE = cl_gui_textedit=>wordwrap_at_fixed_position
for to fix number of characters in row to 132 characers
WORDWRAP_POSITION = line_length
WORDWRAP_TO_LINEBREAK_MODE = cl_gui_textedit=>true
for the word to break to next line if it dont fit in line
FILEDROP_MODE = DROPFILE_EVENT_OFF
PARENT = G_EDITOR_CONTAINER
LIFETIME =
NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
GUI_TYPE_NOT_SUPPORTED = 5
others = 6 .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH g_mytable.
MOVE: WA_THEAD-TDNAME TO STXL-TDNAME,
WA_THEAD-TDID TO STXL-TDID,
WA_THEAD-TDOBJECT TO STXL-TDOBJECT,
WA_THEAD-TDSPRAS TO STXL-TDSPRAS.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = wa_stxl-tdid
LANGUAGE = wa_stxl-tdspras
NAME = wa_stxl-tdname
OBJECT = wa_stxl-tdobject
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = it_line
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT IT_LINE INTO V_RESULT.
APPEND V_RESULT TO G_MYTABLE.
ENDLOOP.
CALL METHOD G_EDITOR->SET_TEXT_AS_R3TABLE
EXPORTING
TABLE = G_MYTABLE
EXCEPTIONS
ERROR_DP = 1
ERROR_DP_CREATE = 2
others = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9000 INPUT
MODULE USER_COMMAND_9000 INPUT.
CASE SY-UCOMM.
REFRESH G_MYTABLE[].
REFRESH IT_LINE[].
CLEAR V_RESULT.
WHEN 'SAVE'.
CALL METHOD G_EDITOR->GET_TEXT_AS_R3TABLE
EXPORTING
ONLY_WHEN_MODIFIED = FALSE
IMPORTING
TABLE = G_MYTABLE
IS_MODIFIED =
EXCEPTIONS
ERROR_DP = 1
ERROR_CNTL_CALL_METHOD = 2
ERROR_DP_CREATE = 3
POTENTIAL_DATA_LOSS = 4
others = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT G_MYTABLE INTO V_RESULT.
APPEND V_RESULT TO IT_LINE.
ENDLOOP.
CLEAR V_RESULT.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = G_HEAD
INSERT = ' '
SAVEMODE_DIRECT = 'X'
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
TABLES
LINES = IT_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH G_MYTABLE[].
REFRESH IT_LINE[].
CLEAR V_RESULT.
WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
LEAVE TO SCREEN '0'.
*CALL SCREEN '0'.
WHEN OTHERS.
ENDCASE.
*G_OK_CODE = SY-UCOMM.
*CLEAR SY-UCOMM.
ENDMODULE. " USER_COMMAND_9000 INPUT -
Regarding Module Pool's Cancel button
Hi Guys,
Please help me I have created on Module Pool and now this module pool is called through a a UserExit .
now the thing is if i cancel button which is placed on my popup screen then it is still going into the output which is wrong it should show up the previous screen.
My code for the Sy-ucomm = cancel is
IF SY-UCOMM = 'CANC'.
SET SCREEN 0.
LEAVE SCREEN.
ENDIF.
Can you please provide me some code by which i can go to the previous screen.I am calling the Module pool through User exit and inside user exit i am calling FM which calls my screen.
Userexit -> FM -> ModulePool
here is the code :
***INCLUDE LZRMA_NOTIFO01 .
*& Module STATUS_0150 OUTPUT
* text
MODULE STATUS_0150 OUTPUT.
* SET PF-STATUS SY-DYNNR.
* SET TITLEBAR SY-DYNNR.
ENDMODULE. " STATUS_0150 OUTPUT
*& Module CUA_STATUS OUTPUT
* text
MODULE CUA_STATUS OUTPUT.
* SET PF-STATUS SY-DYNNR.
* SET TITLEBAR SY-DYNNR.
ENDMODULE. " CUA_STATUS OUTPUT
*& Module EXIT_SCREEN INPUT
* text
MODULE EXIT_SCREEN INPUT.
DATA: C_FCODE_ABBR LIKE SY-PFKEY VALUE 'ABBR' .
break-point.
CASE OK-CODE.
WHEN C_FCODE_ABBR.
*-- Abbrechen
* Daten zurücknehmen
CLEAR RQM01.
* RAISE CANCEL.
set screen 0.
LEAVE TO SCREEN 0.
call transaction 'QM01'.
ENDCASE.
IF SY-UCOMM = 'CANC'. " Here is the SY-UCOMM Where i have to handle the CANC BUTTON
* SET SCREEN 0.
* LEAVE SCREEN.
LEAVE PROGRAM.
ENDIF.
ENDMODULE. " EXIT_SCREEN INPUT
*& Module CHECK_NOTIF_NO INPUT
* text
MODULE CHECK_NOTIF_NO INPUT.
*& Below condition checks if the user enter a Notification Num and Porduction
* Order Then Message comees Please enter a Prod Order or RMA Notif Num only
* Process cannot accept both.
IF NOT VIQMEL-QMNUM IS INITIAL.
IF NOT RQM01-FERTAUFNR IS INITIAL.
MESSAGE E904(QM). " Please enter a Prod order or RMA Notif Num only.
" Process can't accept both
ENDIF.
ENDIF.
*& If Production order is entered, then check if the Order type is 'AES1' or *
*& 'AES3'AES2,AES4, AES5, AES6,ICSO, PM01, PM02, RMA, SM01, SM02, ZEXR,
*& Message flashes ' Please enter only enter RMA Notif Number. *
data: v_dauat like afpo-dauat.
SELECT SINGLE DAUAT INTO V_DAUAT FROM AFPO WHERE AUFNR = RQM01-FERTAUFNR.
if sy-subrc = 0.
IF V_DAUAT = 'AES1' OR V_DAUAT = 'AES3' OR
V_DAUAT = 'AES2' OR V_DAUAT = 'AES4' OR
V_DAUAT = 'ICSO' OR V_DAUAT = 'PM01' OR
V_DAUAT = 'PM01' OR V_DAUAT = 'RMA' OR
V_DAUAT = 'SM01' OR V_DAUAT = 'SM02' OR V_DAUAT = 'ZEXR'..
MESSAGE E905(QM). " Please Only enter a RMA Notif Number.
ENDIF.
endif.
ENDMODULE. " CHECK_NOTIF_NO INPUT
*& Module FEAUF_SAAUF_CHECK INPUT
* text
MODULE FEAUF_SAAUF_CHECK INPUT.
OK-CODE = SY-UCOMM.
*Added by CChauhan
IF VIQMEL-QMNUM IS INITIAL.
*& End of Addition by CChauhan
IF NOT RQM01-FERTAUFNR IS INITIAL
AND ( NOT RQM01-VERID IS INITIAL
OR NOT RQM01-RM_WERKS IS INITIAL
OR NOT RQM01-RM_MATNR IS INITIAL ).
* only production order or manufacturing version meaningfully
MESSAGE E902(QM).
ENDIF.
*Added by CChauhan
ENDIF.
*& End of Addition by CChauhan
ENDMODULE. " FEAUF_SAAUF_CHECK INPUT
*& Module FEAUF_FEPOS_CHECK INPUT
* text
MODULE FEAUF_FEPOS_CHECK INPUT.
IF VIQMEL-QMNUM = ''.
IF RQM01-FERTAUFNR = ''
AND RQM01-FERTVORNR <> ''.
MESSAGE E903(QM).
ENDIF.
ENDIF.
IF SY-UCOMM = 'CANC'.
LEAVE SCREEN.
ENDIF.
ENDMODULE. " FEAUF_FEPOS_CHECK INPUT
*& Module FAUF_LESEN INPUT
* text
MODULE FAUF_LESEN INPUT.
*& Added by CChauhan Date: 01/23/2007
*& Execute further if RMa_Notif(VIQMEL-QMNUM)ield is blank.
IF VIQMEL-QMNUM IS INITIAL.
*&End by CChauhan Date: 01/23/2007
PERFORM FAUF_LESEN USING RQM01-FERTAUFNR
RQM01-FERTVORNR
CHANGING CAUFV
AFVC.
* Belegdaten an Qualitätsmeldung übergeben
PERFORM FAUF_TO_QMEL USING CAUFV
AFVC
CHANGING RQM01.
*& Added by CChauhan Date: 01/23/2007
ENDIF.
*&End by CChauhan Date: 01/23/2007
ENDMODULE. " FAUF_LESEN INPUT
*& Form FAUF_LESEN
* text
* -->P_RQM01_FERTAUFNR text
* -->P_RQM01_FERTVORNR text
* <--P_CAUFV text
* <--P_AFVC text
FORM FAUF_LESEN USING VALUE(P_AUFNR) LIKE RQM01-FERTAUFNR
VALUE(P_VORNR) LIKE RQM01-FERTVORNR
CHANGING VALUE(P_CAUFV) LIKE CAUFV
VALUE(P_AFVC) LIKE AFVC .
CALL FUNCTION 'QMHL_HELP_FAUF'
EXPORTING
I_AUFNR = P_AUFNR
I_VORNR = P_VORNR
I_FOLGE = G_FOLGE
IMPORTING
E_CAUFV = P_CAUFV
E_AFVC = P_AFVC
EXCEPTIONS
ORDER_NOT_FOUND = 1
OPERATION_NOT_FOUND = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " FAUF_LESEN
*& Form FAUF_TO_QMEL
* text
* -->P_CAUFV text
* -->P_AFVC text
* <--P_RQM01 text
FORM FAUF_TO_QMEL USING VALUE(P_CAUFV) LIKE CAUFV
VALUE(P_AFVC) LIKE AFVC
CHANGING P_RQM01 LIKE RQM01.
* zunächst Berechtigung für Meldungsart/Werk prüfen
PERFORM CHECK_QAUT_QMEL USING SY-TCODE
TQ80-QMART
P_CAUFV-WERKS.
* Materialnummer des Fertigprodukts ermitteln
SELECT * FROM AFPO
WHERE AUFNR = P_CAUFV-AUFNR.
* Materialnummer steht in der ersten Auftragsposition
EXIT.
ENDSELECT.
IF SY-SUBRC IS INITIAL.
* Materialnummer übernehmen
P_RQM01-MATNR = AFPO-MATNR.
IF NOT AFPO-MATNR IS INITIAL.
PERFORM MATERIAL_CHECK USING AFPO-MATNR.
ENDIF.
* Charge
P_RQM01-CHARG = AFPO-CHARG.
*--- Lieferantencharge bestimmen
IF NOT P_RQM01-CHARG IS INITIAL.
SELECT SINGLE * INTO MCHA FROM MCHA
WHERE MATNR = P_RQM01-MATNR
AND WERKS = P_RQM01-MAWERK
AND CHARG = P_RQM01-CHARG.
IF SY-SUBRC EQ 0.
MOVE MCHA-LICHA TO P_RQM01-LICHN.
ENDIF.
ENDIF.
P_RQM01-LGORTCHAR = AFPO-LGORT.
ENDIF.
P_RQM01-MAWERK = P_CAUFV-WERKS.
IF NOT AFPO-MATNR IS INITIAL
AND NOT P_CAUFV-WERKS IS INITIAL.
PERFORM MATERIAL_WERK_CHECK USING AFPO-MATNR
P_CAUFV-WERKS.
ENDIF.
* Revisionsstand
P_RQM01-REVLV = P_CAUFV-REVLV.
* reklamierte Menge
P_RQM01-RKMNG = P_CAUFV-GAMNG - P_CAUFV-GASMG.
P_RQM01-BZMNG = P_CAUFV-GAMNG - P_CAUFV-GASMG.
P_RQM01-MGEIN = P_CAUFV-GMEIN.
* Arbeitsplatz
P_RQM01-ARBPL = P_AFVC-ARBID.
* eindeutiger Schluessel fuer Vorgang
P_RQM01-FERTAUFPL = P_AFVC-AUFPL.
P_RQM01-PNLKN = P_AFVC-APLZL.
* Info über automatische Datenübernahme
MESSAGE S026(QM) WITH P_CAUFV-AUFNR RQM01-FERTVORNR.
ENDFORM. " FAUF_TO_QMEL
*& Form CHECK_QAUT_QMEL
* text
* -->P_SY_TCODE text
* -->P_TQ80_QMART text
* -->P_P_CAUFV_WERKS text
FORM CHECK_QAUT_QMEL USING VALUE(P_TCODE)
VALUE(P_QMART)
VALUE(P_WERK).
CHECK NOT P_WERK IS INITIAL.
MOVE-CORRESPONDING RQM01 TO H_VIQMEL.
CALL FUNCTION 'QAUT_QMEL'
EXPORTING
I_WERKS = P_WERK
I_QMART = P_QMART
I_TCODE = P_TCODE
I_VIQMEL = H_VIQMEL.
ENDFORM. " CHECK_QAUT_QMEL
*& Form MATERIAL_CHECK
* text
* -->P_AFPO_MATNR text
FORM MATERIAL_CHECK USING VALUE(P_MATNR).
*-- lokale Daten
DATA : BEGIN OF L_DUMMY_TAB OCCURS 0,
DUMMY(1),
END OF L_DUMMY_TAB.
* Prüfung nur, falls Materialnummer und Werk gefüllt
CHECK NOT P_MATNR IS INITIAL.
* Verprobung auf MARA-Segment
MOVE C_MARA_SEGMENT TO MTCOM-KENNG.
MOVE P_MATNR TO MTCOM-MATNR.
TABLES: MTCOR.
CALL FUNCTION 'MATERIAL_READ'
EXPORTING
SCHLUESSEL = MTCOM
IMPORTING
MATDATEN = MARA
RETURN = MTCOR
TABLES
SEQMAT01 = L_DUMMY_TAB
EXCEPTIONS
ACCOUNT_NOT_FOUND = 01
BATCH_NOT_FOUND = 02
FORECAST_NOT_FOUND = 03
LOCK_ON_ACCOUNT = 04
LOCK_ON_MATERIAL = 05
LOCK_ON_PLANT = 06
LOCK_ON_SALES = 07
LOCK_ON_SLOC = 08
LOCK_SYSTEM_ERROR = 09
MATERIAL_NOT_FOUND = 10
PLANT_NOT_FOUND = 11
SALES_NOT_FOUND = 12
SLOC_NOT_FOUND = 13
SLOCNUMBER_NOT_FOUND = 14
SLOCTYPE_NOT_FOUND = 15
TEXT_NOT_FOUND = 16
UNIT_NOT_FOUND = 17.
CASE SY-SUBRC.
WHEN C_RC00.
* alles o.k.
RQM01-MATKL = MARA-MATKL.
RQM01-PRDHA = MARA-PRDHA.
WHEN C_RC10.
MESSAGE E005(QM) WITH P_MATNR.
ENDCASE.
* Beim Material sitzt Loeschvormerkung.
IF NOT MTCOR-LVORM IS INITIAL.
MESSAGE W008(M3).
ENDIF.
ENDFORM. " MATERIAL_CHECK
*& Form MATERIAL_WERK_CHECK
* text
* -->P_AFPO_MATNR text
* -->P_P_CAUFV_WERKS text
FORM MATERIAL_WERK_CHECK USING VALUE(P_MATNR)
VALUE(P_WERK).
*-- local data
DATA : BEGIN OF L_DUMMY_TAB OCCURS 0,
DUMMY(1),
END OF L_DUMMY_TAB.
* Examination only, if materials number and work filled
CHECK ( NOT P_MATNR IS INITIAL
AND NOT P_WERK IS INITIAL ).
* Checking on MARC segment
MOVE C_MARC_SEGMENT TO MTCOM-KENNG.
MOVE P_MATNR TO MTCOM-MATNR.
MOVE P_WERK TO MTCOM-WERKS.
CALL FUNCTION 'MATERIAL_READ'
EXPORTING
SCHLUESSEL = MTCOM
IMPORTING
MATDATEN = MARC
TABLES
SEQMAT01 = L_DUMMY_TAB
EXCEPTIONS
ACCOUNT_NOT_FOUND = 01
BATCH_NOT_FOUND = 02
FORECAST_NOT_FOUND = 03
LOCK_ON_ACCOUNT = 04
LOCK_ON_MATERIAL = 05
LOCK_ON_PLANT = 06
LOCK_ON_SALES = 07
LOCK_ON_SLOC = 08
LOCK_SYSTEM_ERROR = 09
MATERIAL_NOT_FOUND = 10
PLANT_NOT_FOUND = 11
SALES_NOT_FOUND = 12
SLOC_NOT_FOUND = 13
SLOCNUMBER_NOT_FOUND = 14
SLOCTYPE_NOT_FOUND = 15
TEXT_NOT_FOUND = 16
UNIT_NOT_FOUND = 17.
CASE SY-SUBRC.
WHEN C_RC00.
* alles o.k.
RQM01-KZDKZ = MARC-KZDKZ.
RQM01-KZKRI = MARC-KZKRI.
WHEN C_RC11.
MESSAGE E004(QM) WITH P_MATNR
P_WERK.
WHEN C_RC10.
MESSAGE E005(QM) WITH P_MATNR.
ENDCASE.
ENDFORM. " MATERIAL_WERK_CHECK
*& Module FCODE INPUT
* text
MODULE FCODE INPUT.
*& Inserted by CC 01/24/2007
II_VIQMEL-FERTAUFNR = RQM01-FERTAUFNR.
*& End by CC 01/24/2007
PERFORM FCODE USING OK-CODE.
ENDMODULE. " FCODE INPUT
*& Form FCODE
* text
* -->P_OK_CODE text
FORM FCODE USING VALUE(P_FCODE) LIKE SY-TCODE.
CASE P_FCODE.
WHEN C_FCODE_ENT1.
*-- Weiter
SET SCREEN 0.
LEAVE SCREEN.
ENDCASE.
IF SY-UCOMM = 'CANC'.
SET SCREEN 0.
LEAVE SCREEN.
ENDIF.
ENDFORM. " FCODE -
Can anybody provide me good step by step procedurehow create smart form and module pool programming.
My email Id is [email protected]hi,
SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML output).
According to SAP, you need neither have any programming knowledge nor use a Script language to adapt standard forms. However, basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).
1. Create a new smartforms
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
What is SAP Smart Forms?
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 form logic 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 for table headings and subtotals, and sorting data before output.
You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
SAP Smart Forms also support postage optimizing.
Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
What Transaction to start SAP Smart Forms?
Execute transaction SMARTFORMS to start SAP Smart Forms.
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, or nodes 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.
For Web publishing, the system provides a generated XML output of the processed form.
Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
PROGRAM YMPSKEL MESSAGE-ID YL.
DESCRIPTION
written by !
TABLES:
DATA: OK_CODE(4), " ok code - screen 1
OK_CODE2(4).
DATA C LIKE SY-INDEX. " Index for screen loop
*& Module USER_COMMAND_0100 INPUT
process after input for screen 0100 *
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'SAVE'.
WHEN 'DISP'.
WHEN 'LIST'.
C = 0. "reset loop control
WHEN OTHERS.
ENDCASE.
CLEAR OK_CODE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
process before output for screen 0100 *
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'AMEND'. " set gui status
SET TITLEBAR '100'. " set title
ENDMODULE. " STATUS_0100 OUTPUT
*& Form SAVE data
Save screen details
FORM SAVE.
CLEAR OK_CODE.
ENDFORM.
*& Form DISPLAY
FORM DISPLAY.
ENDFORM.
*& Module EXIT_COMMAND INPUT
exit commands are processed before validation *
defined by E against function in menu painter(function list)
MODULE EXIT_COMMAND INPUT.
CASE OK_CODE.
WHEN 'EXIT'. CLEAR OK_CODE. SET SCREEN 0. LEAVE SCREEN.
WHEN 'CANC'. CLEAR OK_CODE. SET SCREEN 0. LEAVE SCREEN.
WHEN 'BACK'. CLEAR OK_CODE. SET SCREEN 0. LEAVE SCREEN.
ENDCASE.
ENDMODULE. " EXIT_COMMAND INPUT
*& Form list
text *
FORM LIST.
CLEAR OK_CODE. SET SCREEN 200. LEAVE SCREEN.
ENDFORM. " LIST
*& Module EXIT_COMMAND_200 INPUT
exit command processing for screen 200 *
defined by E against function in menu painter(function list)
MODULE EXIT_COMMAND_200 INPUT.
CASE OK_CODE2.
WHEN 'EXIT'. CLEAR OK_CODE2. SET SCREEN 0. LEAVE SCREEN.
WHEN 'CANC'. CLEAR OK_CODE2. SET SCREEN 0. LEAVE SCREEN.
WHEN 'BACK'. CLEAR OK_CODE2. SET SCREEN 100. LEAVE SCREEN.
ENDCASE.
ENDMODULE. " EXIT_COMMAND_200 INPUT
*& Module STATUS_0200 OUTPUT
process before output for screen 200 *
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'POPUP'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0200 OUTPUT
Module pool programs are created in abap development work bench (TCODE: SE80).
Here we can do all the works whatever you can do in abap.
Module pool programs are also called dialog programs.
The module Pool are reports prepared for different screens and to manage the sequence of events of these screens, in the transaction SE80 you can see all the dynpros that you have for this kind of report, add new ones, add all types of element to the report.
Process Before Output is the part of the dynpro code that is processed before the user can do anything with the data in the screen
Process After Input is the part of the dynpro code that is processed after the interaction with the user.
module pool programs are excuted using Tcodes
regards,
sreelakshmi -
Input must bein module pool and the output should be in ALV report
Dear Friends,
Greetings.....................
Please give me solution for my problem.
Consider there is one module pool screen with the fields empno, edob, ecity.There is one search button.if the user clicks the search button.it should display the employee details based on empno and output must be in ALV reports.
Thanks in advance
RajHi,
Try to use
call function 'REUSE_ALV_POPUP_TO_SELECT'
exporting
i_title = text-021
i_zebra = 'X'
i_tabname = 'P_YSIZE1'
it_fieldcat = p_fieldcat[]
it_excluding = p_excltab[]
i_screen_start_column = 02
i_screen_start_line = 02
i_screen_end_column = 45
i_screen_end_line = 15
importing
e_exit = p_exit
es_selfield = p_selfield
tables
t_outtab = p_ysize1.
a® -
How to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?
hi frnds.
My problem is in module pool screen how to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?And how to do GUI STATUS and GUI TITLE? IN SE80.
ITS URGENT.POINTS WILL BE REWADED.THANKS IN ADVANCE.Hi,
Go through this thread.
[expand and collapse|expand and collapse]
Cheers,
Simha.
Maybe you are looking for
-
Error when posting Purchase Orders
Hello, Client gets the followin error for a particular item when doing purchase order : - No matching records found 'withholding tax' (OWHT) The error does not appear when purchase order is done from the server directly, but appears on SAP clients.
-
Delaying ISE Posture / Remediation
Hi, we have a requirement where we would like to add a small delay for about 10 - 15 seconds to the time it takes for the NAC agent to attempt remediation of the client. Is this possible? What seems to happen at the moment is that an error appears on
-
Dear experts I am very new to XI....Kindly let me know in detail... 1)About different mapping technincs available 2)Whether multiple mapping possible in Interface Mapping..?? 3)Is there any concept of nested mapping here in XI...?? Regards Arnab
-
Importing mpgs takes longer than it should
Importing mpgs takes longer than it should. I import 2 hr mpgs on a 6core 32gig ram machine & it takes too long. cs5.52
-
When migrating a database from Access to Oracle, and using NOT the "Quick Migration" (doing the whole thing from scratch), I notice an error (a logic one) in the generated trigger statement for simulating the auto-incremental field functionality. Fir