Module pools mixed in MP001600 GUI

Hello everybody,
I am facing a strange issue related to module pool. I have defined ZP001600  module pool for IT0016, which is shown for all the employees. However, if the employee belongs to Belgium, then an additional module pool is shown in the IT0016 GUI, which is specific and standard for Belgium (MP010900) and this one is appear mixed with the custom one ZP001600. I have tried to seek for a table where a sequence or order for this module pool are defined but I just found two different tables where are customize both modulule pool for this tables:
T582V - Assignment of Infotypes to Views
IT view ind. Infotype Name of view for infotypes Dialog module                  Program Name                             Screen number
12           0016     V109                                                      MP010900                                 0100
T582C Include Screens for Infotypes
Module Pool                              Standard screen Program Name                             Standard screen
MP001600                                 2000            ZP001600                                 0200
Could you please assist me?
Thanks in advance

April,
Thanks for your reply.  HR_PK_EXCEL_TO_INTERNAL_TABLE does not show up in our system when doing a search on function modules.  It is good to know that TEXT_CONVERT_XLS_TO_SAP has been released for customer use in newer systems than we are currently using.
I think that I'll use this function module, TEXT_CONVERT_XLS_TO_SAP, and call it a day. 
Although, I am still interested in other solutions if anybody out there has one.
Bruce
Message was edited by: Bruce Tjosvold

Similar Messages

  • Regarding module pool programming,reports and gui status

    hi,
       I have created a mpp program in which i called a report using the SUBMIT statement.In the Report i have used Gui status for BACK.When i execute the MPP and press BACK it should call a another screen of the MPP,but it leaves to the program i.e., it comes out.
    example,
    case sy-ucomm.
    When 'BACK'.
    CALL SCREEN 0002.
    endcase.
    This is what i have used in my report program.
    Please help me,
    Thanks in advance,
    Aruna

    Hi.
    Change the name BACK because it is standard FCode.
    Try Changing the Fcode.
    Awrd Points if useful
    Bhupal

  • 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)

  • ABAP Module pool programming

    Hi all  plz any one send me the doc  for  Module pool programmiing to learn on my own
    thanks & regards
    vamsin

    Hi,
    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 user’s point of view, a transaction is a sequence of screens, displayed one after
    another. How do I determine this sequence? The transactions’s 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

  • Module pool - table control - update ztable

    hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
    pd: sorry for my bad english
    this is my code:
    TOP:
    PROGRAM  z_pp_lote_etiquetas MESSAGE-ID zz.
    TABLES:zc2p_lote_etique,
           zc2p_lider_modul.
    DATA: ok_code LIKE sy-ucomm.
    DATA save_ok LIKE sy-ucomm.
    * internal table
    DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
    DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
    DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
    **************Workarea
    DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
    DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
    DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
    DATA: sel.
    DATA: MARK.
    DATA: init.
    DATA:  col TYPE scxtab_column.
    DATA: lines TYPE i.
    * Variable Declaration
    DATA : flg, "Flag to set the change mode
    ln TYPE i. "No. of records
    * Table Control Declartion.
    CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
    **PROCESS BEFORE OUTPUT INCLUDE **
    *&  Include           Z_PP_LOTE_ETIQUETAS_O01
    *& Module set_status OUTPUT
    * Setting the GUI status
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
      SET TITLEBAR 'Z_PP_LOT_ETIQ'.
    ENDMODULE. " set_status OUTPUT screen 100
    *  MODULE status_0101 OUTPUT
    * Setting the GUI status
    MODULE status_0101 OUTPUT.
      SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
      SET TITLEBAR 'Z_PP_LOT_ETIQ'.
    * Data retreving
      if init is INITIAL.
      select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
        DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
        zc2p_lider_crtl-lines = ln + 10.
        init = 'X'.
    endif.
    ENDMODULE.                    "status_0101 OUTPUT
    module change_sdyn_conn output.
    * you can change the content of current table control line via
    * sdyn_conn
      READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
    endmodule.                             " FILL_TABLE_CONTROL  OUTPUT
    MODULE set_screen_fields OUTPUT.
    LOOP AT SCREEN.
    IF flg IS INITIAL.
    screen-input = 0.
    ELSE.
    screen-input = 1.
    ENDIF.
    *ENDIF.
    * Modifying the screen after making changes
    MODIFY SCREEN.
    ENDLOOP.
    ENDMODULE. " set_screen_fields OUTPUT
    PROCESS AFTER INPUT INCLUDE.
    *  MODULE USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'LIDM'.
          CALL SCREEN 101.
        WHEN 'CANC'.
          LEAVE PROGRAM.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_0100 INPUT
    *  MODULE USER_COMMAND_0101 INPUT
    MODULE user_command_0101 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'SORT'.
          DATA: fldname(100),help(100).
          READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
          SPLIT col-screen-name AT '-' INTO help fldname.
          SORT it_zc2p_lider_modul BY (fldname).
        WHEN 'CHANGE'.
    * Setting the flag to make the table control in editable mode[excluding
    * primary key].
          flg = 'Y'.
        WHEN 'BACK'.
          CALL SCREEN 100.
          LEAVE SCREEN.
        WHEN 'CANCEL'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'SAVE'.
          MODIFY  zc2p_lider_modul FROM it_zc2p_lider_modul.
          COMMIT WORK.
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_0101 INPUT
    *  MODULE read_table_control INPUT
    MODULE read_table_control INPUT.
    * Check input values
      IF mark = 'X' AND save_ok = 'DELETE'.
        DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
        DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
      ENDIF.
    ENDMODULE.                             " READ_TABLE_CONTROL  INPUT
    Screen Flow Logic 100
    PROCESS BEFORE OUTPUT.
    MODULE status_0100.
    PROCESS AFTER INPUT.
    MODULE user_command_0100.
    Screen Flow Logic 101.
    PROCESS BEFORE OUTPUT.
      MODULE status_0101.
      LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
    zc2p_lider_crtl.
    * Dynamic screen modifications
        MODULE set_screen_fields.
        MODULE change_sdyn_conn.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_0101.
      LOOP AT it_zc2p_lider_modul.
        MODULE read_table_control.
      ENDLOOP.
    i hope somebody can help for what i missing here  thanks

    >
    Sanjeev Kumar wrote:
    > Hello Edgar,
    >
    > Problem seems to be there in the flow logic of 101
    >
    >
    > PROCESS BEFORE OUTPUT.
    >   MODULE status_0101.
    >   LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
    > zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
    > * Dynamic screen modifications
    >     MODULE set_screen_fields.
    >     MODULE change_sdyn_conn.
    >   ENDLOOP.
    > *
    > PROCESS AFTER INPUT.
    >   MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.

    >   LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
    >     MODULE read_table_control.
    >   ENDLOOP.
    >
    >
    >
    > With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
    >
    > Try these changes and I hope it will work.
    >
    > Thanks
    > Sanjeev
    i do the firts advice but the second one i get syntax error :
    my code :
    PROCESS AFTER INPUT.
      LOOP  at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
        MODULE read_table_control.
      ENDLOOP.
       MODULE user_command_0101.
    error :
    In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP     
    AT".

  • 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.

  • Module pool

    Hi,
    I have created a sample prog for module pool.
    I took a button on layout.
    in flow logic okcode like sy-ucomm.
    case okcode.
    when 'button'.
       write:/'sffs'.
    endcase.
    And i have created the tcode also.
    while trying to exe it is giving msg as
    GUI CAPABILITY OF TRANSACTION ZSCREEN NOT YET CLASSIFIED.
    What is the error pls solve it.
    Regards,
    Siri

    Hi
    A) have created a sample prog for module pool.
    I took a button on layout.
    in flow logic okcode like sy-ucomm.
    case okcode.
    when 'button'.
    write:/'sffs'.
    endcase
    U have to leave the screen before using the WRITE statament:
    case okcode.
    when 'button'.
    LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0. 
    write:/'sffs'.
    LEAVE SCREEN.
    endcase.
    B) And i have created the tcode also.
    while trying to exe it is giving msg as
    GUI CAPABILITY OF TRANSACTION ZSCREEN NOT YET CLASSIFIED.
    Check if you have choose the right attribute of trx for module pool by se93
    Max

  • How to DOWNLOAD  a whole module pool program????

    Hi..
    can anybody tell me how to download a <b>whole module pool program</b> into my desktop with .sap extension???
    Actually i want to download a whole module pool program from a server so that i can upload the same program into another sap server instead of writing the whole code.
    Thanx in advance......

    the program is exits..
    i don't y it is not for ur.....
    i am sending d code for the same....
    create a program and check...
    *& Report  REPTRAN                                                     *
    *& This report allows to display and save complete programs and        *
    *& function modules.                                                   *
    *& This report was originally written by Frank Wolf, Xaption GmbH.     *
    *& Its original name was ZREPTRAN (see www.abaps.de).                  *
    REPORT  reptran LINE-SIZE 170      .
    TABLES: d010inc, trdir, eudb, title, d020t, trkey, tfdir, tmdir, tadir,
            seoclass,  seoclassdf, seoclassex, seoclasstx, seometarel,
            seocompo,  seocompodf, seocompoex, seocompotx, seoimplrel,
            seomapatt, seomapcls,  seoredef,   seofriends, seotypepls,
            seosubco,  seosubcodf, seosubcoex, seosubcotx.
    TYPES: abapline(255).
    TYPES: BEGIN OF ty_tit,
            code TYPE rsoldleng-title,
            text TYPE title-text_line,
           END OF ty_tit.
    TYPES: BEGIN OF ty_reptxt,
            id TYPE textpool-id,
            key TYPE textpool-key,
            entry TYPE textpool-entry,
            length(4) TYPE n,
           END OF ty_reptxt.
    TYPES: BEGIN OF ty_d020t,
            prog TYPE d020t-prog,
            dynr TYPE d020t-dynr,
            dtxt TYPE d020t-dtxt,
           END OF ty_d020t.
    TYPES: BEGIN OF dynp_rel_type,         "Dynpro-Releases
            rel(1),
            dot(1),
            version(2),
           END OF dynp_rel_type.
    TYPES: BEGIN OF ty_seocompodf_t.
            INCLUDE STRUCTURE seocmpkey.
    TYPES:  version TYPE seocompodf-version,
            alias TYPE seocompodf-alias,
            redefin TYPE seocompodf-redefin,
            exposure TYPE seocompodf-exposure,
            state TYPE seocompodf-state,
            editorder(4) TYPE n,
            locked TYPE seocompodf-locked,
            dispid(4) TYPE n.
            INCLUDE STRUCTURE seochange.
            INCLUDE STRUCTURE seomtdapx.
            INCLUDE STRUCTURE seoevtapx.
            INCLUDE STRUCTURE seotypapx.
    TYPES:  typtype TYPE seocompodf-typtype,
            type TYPE seocompodf-type,
            tableof TYPE seocompodf-tableof,
            srcrow1(4) TYPE n,
            srccolumn1(2) TYPE n,
            srcrow2(4) TYPE n,
            srccolumn2(2) TYPE n.
            INCLUDE STRUCTURE seocmpref.
    TYPES: END OF ty_seocompodf_t.
    TYPES: BEGIN OF ty_seosubcodf_t.
            INCLUDE STRUCTURE seoscokey.
    TYPES:  version TYPE seosubcodf-version,
            editorder(4) TYPE n,
            dispid(4) TYPE n.
            INCLUDE STRUCTURE seochange.
    TYPES:  pardecltyp TYPE seosubcodf-pardecltyp,
            parpasstyp TYPE seosubcodf-parpasstyp,
            typtype TYPE seosubcodf-typtype,
            type TYPE seosubcodf-type,
            tableof TYPE seosubcodf-tableof,
            srcrow1(4) TYPE n,
            srccolumn1(2) TYPE n,
            srcrow2(4) TYPE n,
            srccolumn2(2) TYPE n,
            parvalue TYPE seosubcodf-parvalue,
            paroptionl TYPE seosubcodf-paroptionl.
            INCLUDE STRUCTURE seoexcapx.
    TYPES: END OF ty_seosubcodf_t.
    Release bis 3.1
    *INCLUDE mseuxcom.
    DATA: eu_key TYPE rseu1_key.
        Titel
    DATA: tit    TYPE STANDARD TABLE OF ty_tit     WITH HEADER LINE.
    Release from 4.6
    DATA: fun4   TYPE STANDARD TABLE OF rsmpe_funt WITH HEADER LINE.
    DATA: ctx4   TYPE STANDARD TABLE OF rsmpe_ctx  WITH HEADER LINE.
    DATA: mtx4   TYPE STANDARD TABLE OF rsmpe_mnlt WITH HEADER LINE.
    DATA: men4   TYPE STANDARD TABLE OF rsmpe_men  WITH HEADER LINE.
    DATA: act4   TYPE STANDARD TABLE OF rsmpe_act  WITH HEADER LINE.
    DATA: doc4   TYPE STANDARD TABLE OF rsmpe_atrt WITH HEADER LINE.
    DATA: sta4   TYPE STANDARD TABLE OF rsmpe_stat WITH HEADER LINE.
    DATA: set4   TYPE STANDARD TABLE OF rsmpe_staf WITH HEADER LINE.
    DATA: pfk4   TYPE STANDARD TABLE OF rsmpe_pfk  WITH HEADER LINE.
    DATA: but4   TYPE STANDARD TABLE OF rsmpe_but  WITH HEADER LINE.
    DATA: tit4   TYPE STANDARD TABLE OF rsmpe_titt WITH HEADER LINE.
    DATA: stx4   TYPE STANDARD TABLE OF rsmptexts  WITH HEADER LINE.
    DATA: adm4   TYPE rsmpe_adm.
    Release from 4.6c
    DATA: biv46c TYPE STANDARD TABLE OF rsmpe_buts WITH HEADER LINE.
    DATA: reports    TYPE STANDARD TABLE OF trdir-name WITH HEADER LINE,
          reportname TYPE string.
    DATA: i_repsrc TYPE STANDARD TABLE OF abapline   WITH HEADER LINE.
    DATA: i_reptx  TYPE STANDARD TABLE OF textpool   WITH HEADER LINE.
    DATA: i_reptxt TYPE STANDARD TABLE OF ty_reptxt  WITH HEADER LINE.
    DATA: i_adm4 TYPE STANDARD TABLE OF rsmpe_adm    WITH HEADER LINE.
    DATA: i_tmd TYPE STANDARD TABLE OF tmdir.
    DATA: i_tfd TYPE STANDARD TABLE OF tfdir.
    DATA: i_cls TYPE STANDARD TABLE OF seoclass.
    DATA: i_cdf TYPE STANDARD TABLE OF seoclassdf.
    DATA: i_clx TYPE STANDARD TABLE OF seoclassex.
    DATA: i_clt TYPE STANDARD TABLE OF seoclasstx.
    DATA: i_cmr TYPE STANDARD TABLE OF seometarel.
    DATA: i_cmp TYPE STANDARD TABLE OF seocompo.
    DATA: i_cmd TYPE STANDARD TABLE OF seocompodf WITH HEADER LINE.
    DATA: i_cmd_t TYPE STANDARD TABLE OF ty_seocompodf_t WITH HEADER LINE.
    DATA: i_cmx TYPE STANDARD TABLE OF seocompoex.
    DATA: i_cmt TYPE STANDARD TABLE OF seocompotx.
    DATA: i_irl TYPE STANDARD TABLE OF seoimplrel.
    DATA: i_mat TYPE STANDARD TABLE OF seomapatt.
    DATA: i_mac TYPE STANDARD TABLE OF seomapcls.
    DATA: i_red TYPE STANDARD TABLE OF seoredef.
    DATA: i_frd TYPE STANDARD TABLE OF seofriends.
    DATA: i_tpl TYPE STANDARD TABLE OF seotypepls.
    DATA: i_sco TYPE STANDARD TABLE OF seosubco.
    DATA: i_scd TYPE STANDARD TABLE OF seosubcodf WITH HEADER LINE.
    DATA: i_scd_t TYPE STANDARD TABLE OF ty_seosubcodf_t WITH HEADER LINE.
    DATA: i_scx TYPE STANDARD TABLE OF seosubcoex.
    DATA: i_sct TYPE STANDARD TABLE OF seosubcotx.
    DATA: i_inc TYPE STANDARD TABLE OF d010inc-include WITH HEADER LINE.
    DATA: i_d020t TYPE STANDARD TABLE OF ty_d020t WITH HEADER LINE.
    DATA: hdr TYPE d020s,
          fld TYPE STANDARD TABLE OF d021s WITH HEADER LINE,
          src TYPE STANDARD TABLE OF d022s WITH HEADER LINE,
          mat TYPE STANDARD TABLE OF d023s WITH HEADER LINE.
    CONSTANTS:
               stars(64)          VALUE
                                                                "#EC NOTEXT
               comment1(64)       VALUE
    '*   THIS FILE IS GENERATED BY THE SCREEN PAINTER.              *',
                                                                "#EC NOTEXT
               comment2(64)       VALUE
    '*   NEVER CHANGE IT MANUALLY, PLEASE !                         *',
                                                                "#EC NOTEXT
               dynpro_text(8)     VALUE '%_DYNPRO',             "#EC NOTEXT
               header_text(8)     VALUE '%_HEADER',             "#EC NOTEXT
               params_text(8)     VALUE '%_PARAMS',             "#EC NOTEXT
               descript_text(13)  VALUE '%_DESCRIPTION',        "#EC NOTEXT
               fields_text(8)     VALUE '%_FIELDS',             "#EC NOTEXT
               kreuz(1)           VALUE 'x',                    "#EC NOTEXT
               flowlogic_text(11) VALUE '%_FLOWLOGIC'.          "#EC NOTEXT
    DATA: header_char TYPE scr_chhead.
    DATA: fields_char TYPE STANDARD TABLE OF scr_chfld WITH HEADER LINE.
    DATA: dynp_char TYPE STANDARD TABLE OF scr_chfld WITH HEADER LINE.
    DATA: prog_len     TYPE p.
    DATA: BEGIN OF dynp,
            prog TYPE d020s-prog,
            dnum TYPE d020s-dnum,
          END OF dynp.
    DATA:
        scrp_rel  TYPE dynp_rel_type VALUE '4.02'.  "Rel. Scrp. 4.02
          scrp_rel  TYPE dynp_rel_type VALUE '4.60'.  "Rel. Scrp. 4.6A
    DATA  dynp_rel  TYPE dynp_rel_type.    "akt. Rel. Dynpro
    DATA: dynpro_rel(4).
    DATA  status.
    DATA  prog_len_akt TYPE p.
    DATA  release.
    DATA  rows  LIKE sy-curow.
    DATA  lines LIKE sy-cucol.
    DATA: filename TYPE string.
    DATA: subrc LIKE sy-subrc.
    DATA: os(10).
    DATA: delux VALUE '/'.
    DATA: delwn VALUE '\'.
    DATA: delim.
    DATA: dirux(250) VALUE '-l>dir.tmp'.
    DATA: dirwn(250) VALUE '/Q /Cdir>dir.tmp'.
    DATA: command(250).
    DATA: shellux(250) VALUE 'bash'.
    DATA: shellwn(250) VALUE 'cmd.exe'.
    DATA: shell(250).
    DATA: file      TYPE rlgrap-filename.
    DATA: answer.
    DATA: incname   TYPE d010inc-include.
    DATA: repname   TYPE d010inc-include.
    DATA: rest1     TYPE d010inc-include.
    DATA: rest2     TYPE d010inc-include.
    DATA: kz_renam.
    DATA: classname TYPE seoclsname.
    DATA: classtype(2).
    DATA: offset  TYPE i.
    DATA: savepath(250).
    SELECT-OPTIONS:   report   FOR trdir-name.
    SELECTION-SCREEN: SKIP.
    SELECT-OPTIONS:   cnam     FOR trdir-cnam MATCHCODE OBJECT user_addr,
                      unam     FOR trdir-unam MATCHCODE OBJECT user_addr,
                      devclass FOR tadir-devclass,
                      subc     FOR trdir-subc,
                      rstat    FOR trdir-rstat,
                      cdat     FOR trdir-cdat,
                      udat   FOR trdir-udat.
    SELECTION-SCREEN: SKIP.
    PARAMETERS:       path(250).
    SELECTION-SCREEN: SKIP.
    PARAMETERS:       display  RADIOBUTTON GROUP func,
                      save     RADIOBUTTON GROUP func,
                      savedspl RADIOBUTTON GROUP func.
    SELECTION-SCREEN: SKIP.
    PARAMETERS:       codeonly AS CHECKBOX.
    SELECTION-SCREEN: SKIP.
    *PARAMETERS:       suffix(80) LOWER CASE.
    DATA:             suffix(80) TYPE c.
    LOAD-OF-PROGRAM.
      AUTHORITY-CHECK OBJECT 'S_DEVELOP'
          ID 'DEVCLASS' DUMMY
          ID 'OBJTYPE'  FIELD 'PROG'
          ID 'OBJNAME'  FIELD 'REPTRAN'
          ID 'PGROUP'   DUMMY
          ID 'ACTVT'    FIELD '03'.
      IF sy-subrc <> 0.
        MESSAGE e059(EU) WITH 'REPTRAN'.
      ENDIF.
    INITIALIZATION.
      GET PARAMETER ID 'REPTRAN_PATH' FIELD path.
      IF path IS INITIAL.
        path = 'C:\ABAPS\'.
      ENDIF.
      save = 'X'.
      codeonly = 'X'.
      CALL FUNCTION 'WS_QUERY'
           EXPORTING
              ENVIRONMENT    = ' '
              FILENAME       = ' '
                query          = 'OS'
              WINID          = ' '
           IMPORTING
                return         = os
           EXCEPTIONS
                inv_query      = 1
                no_batch       = 2
                frontend_error = 3
                OTHERS         = 4.
      IF sy-subrc = 0 AND
         ( os CS 'OS2' OR os CS 'DOS' OR os CS 'NT' ).
        delim = delwn.
        command = dirwn.
        shell = shellwn.
      ELSE.
        delim = delux.
        command = dirux.
        shell = shellux.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR path.
      GET CURSOR FIELD path VALUE path.
      filename = path.
      PERFORM fileselector.
    AT SELECTION-SCREEN.
      IF report[] IS INITIAL.
        IF NOT reports[] IS INITIAL.
          report = 'IEQ'.
          report-low = reports.
          APPEND report.
          MESSAGE i208(00)
             WITH 'Report/BSP application was also identified'(009).
        ELSE.
          MESSAGE e208(00)
             WITH 'Enter report or BSP application or enter path'(011).
        ENDIF.
      ENDIF.
    START-OF-SELECTION.
      offset = strlen( path ) - 1.
      IF path+offset(1) <> '\'.
        CONCATENATE path '\' INTO path.
      ENDIF.
      SET PARAMETER ID 'REPTRAN_PATH' FIELD path.
      FORMAT COLOR COL_BACKGROUND INTENSIFIED OFF.
      eu_key-sprsl = sy-langu.
      IF NOT save     IS INITIAL OR
         NOT display  IS INITIAL OR
         NOT savedspl IS INITIAL.
      DOWNLOAD PROGRAMS
        SELECT name  FROM trdir
               INTO  TABLE reports
               WHERE name IN report
               AND   cnam IN cnam
               AND   unam IN unam
               AND   subc IN subc
               AND   rstat IN rstat
               AND   cdat IN cdat
               AND   udat IN udat.
        IF sy-subrc <> 0.
          LOOP AT report.
            CONCATENATE report(3) 'SAPL' report+3 INTO report.
            MODIFY report.
          ENDLOOP.
          SELECT name  FROM trdir
                 INTO  TABLE reports
                 WHERE name IN report
                 AND   cnam IN cnam
                 AND   unam IN unam
                 AND   subc IN subc
                 AND   rstat IN rstat
                 AND   cdat IN cdat
                 AND   udat IN udat.
        ENDIF.
        IF sy-subrc <> 0.
          MESSAGE i208(00)
             WITH 'The program/function name entered does not exist!'(082).
        ENDIF.
        LOOP AT reports.
    Check if report is in development class
          classtype = reports+30.
          IF reports(5) NE 'CL_O2'.
            IF classtype = 'CP'.
              tadir-obj_name = reports.
              SHIFT tadir-obj_name RIGHT DELETING TRAILING space.
              SHIFT tadir-obj_name RIGHT BY 2 PLACES.
              SHIFT tadir-obj_name RIGHT DELETING TRAILING '='.
              SHIFT tadir-obj_name LEFT DELETING LEADING space.
              SELECT SINGLE * FROM  tadir
                     WHERE  pgmid     = 'R3TR'
                     AND    object    = 'CLAS'
                     AND    obj_name  = tadir-obj_name
                     AND    devclass  IN devclass.
            ENDIF.
            IF classtype <> 'CP' OR sy-subrc <> 0.
              SELECT SINGLE * FROM  tadir
                     WHERE  pgmid     = 'R3TR'
                     AND    object    = 'PROG'
                     AND    obj_name  = reports
                     AND    devclass  IN devclass.
              IF sy-subrc <> 0.
                SELECT SINGLE * FROM  tadir
                       WHERE  pgmid     = 'R3TR'
                       AND    object    = 'FUGR'
                       AND    obj_name  = reports
                       AND    devclass  IN devclass.
              ENDIF.
              IF sy-subrc <> 0 AND
                 ( reports(4) = 'SAPL' OR reports(4) = 'sapl' ).
                reportname = reports+4.
                SELECT SINGLE * FROM  tadir
                       WHERE  pgmid     = 'R3TR'
                       AND    object    = 'FUGR'
                       AND    obj_name  = reportname
                       AND    devclass  IN devclass.
              ENDIF.
            ENDIF.
            IF sy-subrc <> 0.
              CONTINUE.
            ENDIF.
          ENDIF.
          reportname = reports.
          PERFORM makepath USING    reportname
                                    path
                           CHANGING savepath.
          PERFORM writeinfo  USING reportname
                                   savepath.
          REFRESH: i_repsrc, i_reptx, i_reptxt, i_inc,
                   sta4, ctx4, fun4, mtx4, doc4, tit4, men4, act4, but4,
                   pfk4, set4, stx4, biv46c,
                   i_d020t, i_adm4,
                   i_tmd, i_tfd, i_cls, i_cdf, i_clx, i_clt, i_cmr, i_cmp,
                   i_cmd, i_cmx, i_cmt, i_irl, i_mat, i_mac, i_red, i_frd,
                   i_tpl, i_sco, i_scd, i_scx, i_sct, i_cmd_t, i_scd_t.
          CLEAR: adm4.
          eu_key-name  = reports.
          READ REPORT reports INTO i_repsrc.
          IF codeonly <> 'X'.
            READ TEXTPOOL reports INTO i_reptx.
          ENDIF.
          LOOP AT i_reptx.
            MOVE-CORRESPONDING i_reptx TO i_reptxt.
            APPEND i_reptxt.
          ENDLOOP.
          IF NOT display  IS INITIAL OR
             NOT savedspl IS INITIAL.
            PERFORM show_rep.
          ENDIF.
          IF classtype = 'CP' OR classtype = 'IP'.
            classname = reports(30).
            TRANSLATE classname USING '= '.
            SELECT * FROM tmdir INTO TABLE i_tmd
                   WHERE classname = classname.
            SELECT * FROM seoclass   INTO TABLE i_cls
                   WHERE clsname = classname.
            SELECT * FROM seoclassdf INTO TABLE i_cdf
                   WHERE clsname = classname.
            SELECT * FROM seoclassex INTO TABLE i_clx
                   WHERE clsname = classname.
            SELECT * FROM seoclasstx INTO TABLE i_clt
                   WHERE clsname = classname.
            SELECT * FROM seometarel INTO TABLE i_cmr
                   WHERE clsname = classname.
            SELECT * FROM seocompo   INTO TABLE i_cmp
                   WHERE clsname = classname.
            SELECT * FROM seocompodf INTO TABLE i_cmd
                   WHERE clsname = classname.
            LOOP AT i_cmd.
              MOVE-CORRESPONDING i_cmd TO i_cmd_t.
              APPEND i_cmd_t.
            ENDLOOP.
            SELECT * FROM seocompoex INTO TABLE i_cmx
                   WHERE clsname = classname.
            SELECT * FROM seocompotx INTO TABLE i_cmt
                   WHERE clsname = classname.
            SELECT * FROM seoimplrel INTO TABLE i_irl
                   WHERE clsname = classname.
            SELECT * FROM seomapatt  INTO TABLE i_mat
                   WHERE clsname = classname.
            SELECT * FROM seomapcls  INTO TABLE i_mac
                   WHERE clsname = classname.
            SELECT * FROM seoredef   INTO TABLE i_red
                   WHERE clsname = classname.
            SELECT * FROM seofriends INTO TABLE i_frd
                   WHERE clsname = classname.
            SELECT * FROM seotypepls INTO TABLE i_tpl
                   WHERE clsname = classname.
            SELECT * FROM seosubco   INTO TABLE i_sco
                   WHERE clsname = classname.
            SELECT * FROM seosubcodf INTO TABLE i_scd
                   WHERE clsname = classname.
            LOOP AT i_scd.
              MOVE-CORRESPONDING i_scd TO i_scd_t.
              APPEND i_scd_t.
            ENDLOOP.
            SELECT * FROM seosubcoex INTO TABLE i_scx
                   WHERE clsname = classname.
            SELECT * FROM seosubcotx INTO TABLE i_sct
                   WHERE clsname = classname.
          ELSE.
            CLEAR classtype.
          ENDIF.
          IF codeonly <> 'X'.
            SELECT * FROM tfdir INTO TABLE i_tfd
                   WHERE pname = reports.
            CALL FUNCTION 'RS_CUA_INTERNAL_FETCH'
                 EXPORTING
                      program         = reports
                    LANGUAGE        =
                    STATE           = 'A'
                 IMPORTING
                      adm             = adm4
                    LANGU           =
                    AUTHOR          =
                    DATE            =
                    TIME            =
                    CAUTHOR         =
                    CDATE           =
                    CTIME           =
                    GDATE           =
                    GTIME           =
                 TABLES
                      sta             = sta4
                      fun             = fun4
                      men             = men4
                      mtx             = mtx4
                      act             = act4
                      but             = but4
                      pfk             = pfk4
                      set             = set4
                      doc             = doc4
                      tit             = tit4
                      biv             = biv46c
                 EXCEPTIONS
                      not_found       = 1
                      unknown_version = 2
                      OTHERS          = 3.
            SELECT ddnr text_line FROM title INTO TABLE tit
                   WHERE ddlanguage = eu_key-sprsl AND
                         progname   = eu_key-name.
            SELECT * FROM rsmptexts INTO TABLE stx4
                   WHERE progname   = eu_key-name AND
                         sprsl = eu_key-sprsl.
            SELECT prog dynr dtxt FROM d020t INTO TABLE i_d020t
                   WHERE prog = reports AND
                         NOT dtxt LIKE 'SEL_SCREEN%'.
          ENDIF.
          IF NOT classtype IS INITIAL.
            reports = classname.
          ENDIF.
          TRANSLATE reports TO LOWER CASE.
          TRANSLATE reports USING '/.'.
          IF NOT save     IS INITIAL OR
             NOT savedspl IS INITIAL.
            CONCATENATE savepath reports suffix '.txt' INTO filename.
            PERFORM download TABLES i_repsrc USING filename
                             'Source'(003).
            IF NOT i_reptxt[] IS INITIAL.
              CONCATENATE savepath reports suffix '_txt.txt' INTO filename.
              PERFORM download TABLES i_reptxt USING filename
                               'Text elements'(004).
            ENDIF.
          ENDIF.
          SELECT include FROM d010inc INTO TABLE i_inc
                 WHERE master = eu_key-name.
          DELETE i_inc WHERE table_line(1) = '<'.
          DELETE i_inc WHERE table_line(1) = '>'.
          DELETE i_inc WHERE table_line = 'DB__SSEL'.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_inc[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_inc.txt' INTO filename.
            PERFORM download TABLES i_inc USING filename
                             'Include List'(033).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_tmd[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_tmd.txt' INTO filename.
            PERFORM download TABLES i_tmd USING filename
                             'Methods List'(048).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cls[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cls.txt' INTO filename.
            PERFORM download TABLES i_cls USING filename
                             'Class Entry'(050).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cdf[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cdf.txt' INTO filename.
            PERFORM download TABLES i_cdf USING filename
                             'Class Definition'(051).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_clx[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_clx.txt' INTO filename.
            PERFORM download TABLES i_clx USING filename
                             'Class Remote Info'(052).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_clt[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_clt.txt' INTO filename.
            PERFORM download TABLES i_clt USING filename
                             'Class Description'(053).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cmr[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cmr.txt' INTO filename.
            PERFORM download TABLES i_cmr USING filename
                             'Class Meta Relations'(054).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cmp[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cmp.txt' INTO filename.
            PERFORM download TABLES i_cmp USING filename
                             'Class Components'(055).
          ENDIF.
          IF ( NOT save      IS INITIAL OR
               NOT savedspl  IS INITIAL ) AND
               NOT i_cmd_t[] IS INITIAL.
            CONCATENATE savepath reports suffix '_cmd.txt' INTO filename.
            PERFORM download TABLES i_cmd_t USING filename
                             'Class Components Definitions'(056).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cmx[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cmx.txt' INTO filename.
            PERFORM download TABLES i_cmx USING filename
                             'Class Components Remote Infos'(057).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cmt[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cmt.txt' INTO filename.
            PERFORM download TABLES i_cmt USING filename
                             'Class Components Descriptions'(058).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_irl[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_irl.txt' INTO filename.
            PERFORM download TABLES i_irl USING filename
                             'Class Components Relation Types'(059).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_mat[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_mat.txt' INTO filename.
            PERFORM download TABLES i_mat USING filename
                             'Class Mapping Attributes'(060).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_mac[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_mac.txt' INTO filename.
            PERFORM download TABLES i_mac USING filename
                             'Class Mapping Classes'(061).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_red[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_red.txt' INTO filename.
            PERFORM download TABLES i_red USING filename
                             'Class Redefinitions'(062).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_frd[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_frd.txt' INTO filename.
            PERFORM download TABLES i_frd USING filename
                             'Class Friends'(063).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_tpl[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_tpl.txt' INTO filename.
            PERFORM download TABLES i_tpl USING filename
                             'Class Type-Pools'(064).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_sco[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_sco.txt' INTO filename.
            PERFORM download TABLES i_sco USING filename
                             'Class Sub Components'(065).
          ENDIF.
          IF ( NOT save      IS INITIAL OR
               NOT savedspl  IS INITIAL ) AND
               NOT i_scd_t[] IS INITIAL.
            CONCATENATE savepath reports suffix '_scd.txt' INTO filename.
            PERFORM download TABLES i_scd_t USING filename
                             'Class Sub Components Definitions'(066).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_scx[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_scx.txt' INTO filename.
            PERFORM download TABLES i_scx USING filename
                             'Class Sub Components Remote Infos'(067).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_sct[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_sct.txt' INTO filename.
            PERFORM download TABLES i_sct USING filename
                             'Class Sub Components Descriptions'(068).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_tfd[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_tfd.txt' INTO filename.
            PERFORM download TABLES i_tfd USING filename
                             'Function List'(049).
          ENDIF.
          IF NOT i_inc[] IS INITIAL.
            LOOP AT i_inc.
              REFRESH: i_reptx, i_reptxt.
              READ REPORT i_inc INTO i_repsrc.
              IF codeonly <> 'X'.
                READ TEXTPOOL i_inc INTO i_reptx.
              ENDIF.
              LOOP AT i_reptx.
                MOVE-CORRESPONDING i_reptx TO i_reptxt.
                APPEND i_reptxt.
              ENDLOOP.
              IF NOT display IS INITIAL OR
                NOT savedspl IS INITIAL.
                PERFORM show_inc.
              ENDIF.
              TRANSLATE i_inc TO LOWER CASE.
              TRANSLATE i_inc USING '/.'.
              IF NOT save     IS INITIAL OR
                 NOT savedspl IS INITIAL.
                CONCATENATE savepath i_inc suffix '.txt' INTO filename.
                PERFORM download TABLES i_repsrc USING filename
                                 'Include Source'(032).
                IF NOT i_reptxt[] IS INITIAL.
                  CONCATENATE savepath i_inc suffix '_txt.txt'
                              INTO filename.
                  PERFORM download TABLES i_reptxt USING filename
                                   'Text elements'(004).
                ENDIF.
              ENDIF.
            ENDLOOP.
          ENDIF.
          IF NOT i_d020t[] IS INITIAL.
            LOOP AT i_d020t.
              IMPORT DYNPRO hdr fld src mat ID i_d020t.
              CALL FUNCTION 'RS_SCRP_UPGRADE_DYNPRO'
                   TABLES
                        f = fld
                        m = mat
                   CHANGING
                        h = hdr.
              IF src[] IS INITIAL.
                DELETE i_d020t.
                CONTINUE.
              ENDIF.
              CLEAR src.
              READ TABLE src INDEX 1.
              IF src-line CS 'Do not change'.
                DELETE i_d020t.
                CONTINUE.
              ENDIF.
              CALL FUNCTION 'RS_SCRP_GET_SCREEN_INFOS'
                   EXPORTING
                        dynnr                 = hdr-dnum
                        progname              = hdr-prog
                        with_fieldlist        = 'X'
                   IMPORTING
                        lines                 = lines
                        columns               = rows
                   TABLES
                        fieldlist             = fld
                   EXCEPTIONS
                        dynpro_does_not_exist = 01
                        no_field_list         = 02.
              hdr-bzmx = lines.
              hdr-bzbr = rows.
              IF NOT display  IS INITIAL OR
                 NOT savedspl IS INITIAL.
                PERFORM show_dyn.
              ENDIF.
              IF NOT save     IS INITIAL OR
                 NOT savedspl IS INITIAL.
                PERFORM dynpro_download.
              ENDIF.
            ENDLOOP.
            IF ( NOT save     IS INITIAL OR
                 NOT savedspl IS INITIAL ) AND
               NOT i_d020t[] IS INITIAL.
              CONCATENATE savepath reports suffix '_dyn.txt' INTO filename.
              PERFORM download TABLES i_d020t USING filename
                               'Dynpro List'(040).
            ENDIF.
          ENDIF.
          IF NOT save     IS INITIAL OR
             NOT savedspl IS INITIAL.
            IF NOT sta4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_sta.txt' INTO filename.
              PERFORM download TABLES sta4 USING filename
                               'GUI Status'(013).
            ENDIF.
            IF NOT ctx4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_ctx.txt' INTO filename.
              PERFORM download TABLES ctx4 USING filename
                               'Object Codes'(045).
            ENDIF.
            IF NOT fun4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_fun.txt' INTO filename.
              PERFORM download TABLES fun4 USING filename
                               'Function Texts'(014).
            ENDIF.
            IF NOT men4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_men.txt' INTO filename.
              PERFORM download TABLES men4 USING filename
                               'Menus'(015).
            ENDIF.
            IF NOT tit4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_sti.txt' INTO filename.
              PERFORM download TABLES tit4 USING filename
                               'Title Codes'(042).
            ENDIF.
            IF NOT mtx4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_mtx.txt' INTO filename.
              PERFORM download TABLES mtx4 USING filename
                               'Menu Texts'(016).
            ENDIF.
            IF NOT act4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_act.txt' INTO filename.
              PERFORM download TABLES act4 USING filename
                               'Menu Bars'(047).
            ENDIF.
            IF NOT but4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_but.txt' INTO filename.
              PERFORM download TABLES but4 USING filename
                               'Push Buttons'(018).
            ENDIF.
            IF NOT pfk4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_pfk.txt' INTO filename.
              PERFORM download TABLES pfk4 USING filename
                               'PF Keys'(019).
            ENDIF.
            IF NOT adm4 IS INITIAL.
              APPEND adm4 TO i_adm4.
              CONCATENATE savepath reports suffix '_adm.txt' INTO filename.
              PERFORM download TABLES i_adm4 USING filename
                               'Management Information'(043).
            ENDIF.
            IF NOT set4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_set.txt' INTO filename.
              PERFORM download TABLES set4 USING filename
                               'Function Sets'(020).
            ENDIF.
            IF NOT stx4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_stx.txt' INTO filename.
              PERFORM download TABLES stx4 USING filename
                               'Status Texts'(023).
            ENDIF.
            IF NOT doc4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_doc.txt' INTO filename.
              PERFORM download TABLES doc4 USING filename
                               'Status Short Texts'(024).
            ENDIF.
            IF NOT biv46c[] IS INITIAL.
              CONCATENATE savepath reports suffix '_biv.txt' INTO filename.
              PERFORM download TABLES biv46c USING filename
                               'Invariant Functions'(048).
            ENDIF.
            IF NOT tit[] IS INITIAL.
              CONCATENATE savepath reports suffix '_tit.txt' INTO filename.
              PERFORM download TABLES tit USING filename
                               'Title Bars'(030).
            ENDIF.
          ENDIF.
          ULINE.
        ENDLOOP.
      ENDIF.
      REFRESH reports.
    *&      Form  DOWNLOAD
    FORM download TABLES   tabelle
                  USING    value(filename)
                           component.
      CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
              BIN_FILESIZE            = ' '
                filename                = filename
                filetype                = 'ASC'
         IMPORTING
              FILELENGTH              =
           TABLES
                data_tab                = tabelle
           EXCEPTIONS
                file_write_error        = 1
                no_batch                = 2
                gui_refuse_filetransfer = 3
                invalid_type            = 4
                OTHERS                  = 5.
    IF reports IS INITIAL.
       WRITE: / appls.
    ELSE.
       WRITE: / reports.
    ENDIF.
      WRITE: /(20) component.
      IF sy-subrc = 0.
        WRITE: 'successfully downloaded'(001).
        PERFORM getfilename USING    filename
                            CHANGING filename.
        WRITE: '->', filename.
      ELSE.
        WRITE: 'not downloaded,  RC ='(002), sy-subrc.
      ENDIF.
    ENDFORM.                                                    " DOWNLOAD
    *&      Form  FILESELECTOR
    FORM fileselector.
      DATA: repname(250).
      DATA: fdpos(2) TYPE p.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
              DEF_FILENAME     = ' '
                def_path         = path
                mask             = ',.txt,.txt.'
                mode             = 'O'
              TITLE            = ' '
           IMPORTING
                filename         = file
              RC               =
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
      subrc = sy-subrc.
      path = file.
      CLEAR: sy-fdpos, sy-subrc.
      fdpos = 1.
      WHILE sy-subrc = 0.
        fdpos = fdpos + sy-fdpos + 1.
        SEARCH path FOR delim STARTING AT fdpos.
      ENDWHILE.
      fdpos = fdpos - 1.
      path = path(fdpos).
      repname = file.
      CLEAR sy-subrc.
      WHILE sy-subrc = 0.
        SHIFT repname LEFT.
        SHIFT repname LEFT UP TO delim.
      ENDWHILE.
      SHIFT repname RIGHT UP TO '.'.
      SHIFT repname RIGHT.
      SHIFT repname LEFT DELETING LEADING space.
      TRANSLATE repname TO UPPER CASE.
      reports = repname.
      APPEND reports.
    ENDFORM.                               " FILESELECTOR
    *&      Form  LS
    FORM ls.
      TYPES: c80(80).
      DATA: dirtab TYPE STANDARD TABLE OF c80 WITH HEADER LINE.
      DATA: datei TYPE string.
      DATA: i LIKE sy-tabix.
      DATA: endtime LIKE sy-uzeit.
      CALL FUNCTION 'WS_EXECUTE'
           EXPORTING
              DOCUMENT       = ' '
                cd             = path
                commandline    = command
              INFORM         = ' '
                program        = shell
              STAT           = ' '
              WINID          = ' '
              OSMAC_SCRIPT   = ' '
              OSMAC_CREATOR  = ' '
              WIN16_EXT      = ' '
              EXEC_RC        = ' '
         IMPORTING
              RBUFF          =
           EXCEPTIONS
                frontend_error = 1
                no_batch       = 2
                prog_not_found = 3
                illegal_option = 4
                OTHERS         = 5.
      IF sy-subrc NE 0.
        MESSAGE e001(pc).
      Error when executing the WS program
      ENDIF.
      CONCATENATE path 'dir.tmp'  INTO datei.
      GET TIME.
      endtime = sy-uzeit + 3.
      WHILE sy-uzeit < endtime.
        GET TIME.
      ENDWHILE.
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename                = datei
                filetype                = 'ASC'
         IMPORTING
              FILELENGTH              =
           TABLES
                data_tab                = dirtab
           EXCEPTIONS
                file_read_error         = 1
                no_batch                = 2
                gui_refuse_filetransfer = 3
                invalid_type            = 4
                OTHERS                  = 5.
      IF sy-subrc NE 0.
        MESSAGE e001(pc).
      Error when executing the WS program
      ENDIF.
      REFRESH reports.
      i = 1.
      DO.
        SEARCH dirtab FOR '.txt' STARTING AT i.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
        READ TABLE dirtab INDEX sy-tabix.
        i = sy-tabix + 1.
        CHECK dirtab NS 'txt_.txt'.
        SHIFT dirtab LEFT UP TO space.
        SHIFT dirtab LEFT DELETING LEADING space.
        SHIFT dirtab LEFT UP TO space.
        SHIFT dirtab LEFT DELETING LEADING space.
        SHIFT dirtab LEFT UP TO space.
        SHIFT dirtab RIGHT UP TO '.'.
        SHIFT dirtab RIGHT.
        SHIFT dirtab LEFT DELETING LEADING space.
        IF NOT dirtab IS INITIAL.
          TRANSLATE dirtab TO LOWER CASE.
          APPEND dirtab TO reports.
        ENDIF.
      ENDDO.
      SORT reports.
      DELETE ADJACENT DUPLICATES FROM reports.
    ENDFORM.                                                    " LS
    *&      Form  SHOW_DYN
    FORM show_dyn.
    Printing Dynpro data
    Header for Dynpro
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Dynpro header', AT sy-linsz ''.
      FORMAT COLOR COL_NORMAL.
      WRITE: / 'Program:',    30 hdr-prog, AT sy-linsz '',
             / 'Dynpro:',      30 hdr-dnum, AT sy-linsz '',
             / 'Follow-up dynpro:', 30 hdr-fnum, AT sy-linsz ''.
      ULINE.
    Print field list
      FORMAT COLOR COL_TOTAL.
      WRITE:  / 'Field list'  COLOR COL_TOTAL, AT sy-linsz ''.
      FORMAT COLOR COL_HEADING.
      WRITE:  / 'Field',
             25 'Line',
             30 'Column',
             37 'TYPE',
             42 'LOOPTyp',
             50 'DDIC',
             55 'FormByte', AT sy-linsz ''.
      CALL FUNCTION 'RS_SCRP_FIELDS_RAW_TO_CHAR'
           TABLES
                fields_int  = fld
                fields_char = fields_char
           EXCEPTIONS
                OTHERS      = 1.
      FORMAT COLOR COL_NORMAL.
      LOOP AT fields_char.
        WRITE: /(24) fields_char-feldname,
                  25 fields_char-line,
                  30 fields_char-coln,
                  37 fields_char-feldformat,
                  42 fields_char-looptype,
                  50 fields_char-inttyp,
                  55 fields_char-fmb1,
                  58 fields_char-fmb2.
      ENDLOOP.
      ULINE.
    Display logic
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Logic', AT sy-linsz ''.
      FORMAT COLOR COL_NORMAL.
      LOOP AT src.
        WRITE: / src-line.
      ENDLOOP.
      ULINE.
      SKIP.
    Display matchcode data
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Matchcode data', AT sy-linsz ''.
      FORMAT COLOR COL_NORMAL.
      LOOP AT mat.
        WRITE: /(80) mat.
      ENDLOOP.
      IF sy-subrc NE 0.
        WRITE / ' no matchcode files available ' COLOR COL_NEGATIVE.
      ENDIF.
      NEW-PAGE.
    ENDFORM.                                                    " SHOW_DYN
    *&      Form  SHOW_REP
    FORM show_rep.
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Program:', reports, AT sy-linsz ''.
      FORMAT COLOR COL_BACKGROUND.
      LOOP AT i_repsrc.
        WRITE: / i_repsrc.
      ENDLOOP.
      ULINE.
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Text elements for program:', reports, AT sy-linsz ''.
      FORMAT COLOR COL_HEADING.
      WRITE:  / 'Type',
              5 'Key',
             20 'Length',
             30 'Text', AT sy-linsz ''.
      FORMAT COLOR COL_NORMAL.
      LOOP AT i_reptxt.
        WRITE: / i_reptxt-id,
               5 i_reptxt-key,
           20(4) i_reptxt-length,
          30(80) i_reptxt-entry.
      ENDLOOP.
      NEW-PAGE.
    ENDFORM.                                                    " SHOW_REP
    *&      Form  SHOW_INC
    FORM show_inc.
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Include:', i_inc, AT sy-linsz ''.
      FORMAT COLOR COL_BACKGROUND.
      LOOP AT i_repsrc.
        WRITE: / i_repsrc.
      ENDLOOP.
      ULINE.
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Text elements for include:', i_inc, AT sy-linsz ''.
      FORMAT COLOR COL_HEADING.
      WRITE:  / 'Type',
              5 'Key',
             20 'Length',
             30 'Text', AT sy-linsz ''.
      FORMAT COLOR COL_NORMAL.
      LOOP AT i_reptxt.
        WRITE: / i_reptxt-id,
               5 i_reptxt-key,
           20(4) i_reptxt-length,
          30(80) i_reptxt-entry.
      ENDLOOP.
      NEW-PAGE.
    ENDFORM.                                                    " SHOW_INC
    *&      Form  DYNPRO_DOWNLOAD
    &

  • User Decision in a Module Pool

    Hello Guys,
    I am relatively new to SAP workflows. I am implementing a solution here and I have mixed feelings about the design. I would love to hear some advice on how to proceed or some reassurance that I am going in the right path.
    Requirement:
    If a Requeust (say Material Creation)  is created by the Initiator in my Custom Module Pool program, the workflow is triggered and sent to the Approver.
    The Approver should View the Request by executing the workitem from his Inbox which will in-turn call the Module Pool Program.
    From there the approver will have two options either to Approve or Send Back.
    I have designed my workflow like this...
              View Request  (Activity)
                      |
              Aprrove / Reject  (User Decision)
       5.  I am marking the 'View Request' activty as complete from my Dialog Program so as to make the workflow come to the User Decision step so that I can pick one and execute form the Module Pool. I have a bad feeling that it might not be a standardized method. If not, then how shall I proceed.??

    From my point of view the decision step is completely unnecessary (or alternatively I am missing a point here). What is the role of the decision step in the process?
    If you have some kind of approval, you should be able to handle it with a one single workflow step. There is no "standard way" of doing things, but there are best practices. If you take a look to any of the SAP standard workflows, they normally work like this (let's take a leave request as an example):
    1. Approver clicks the "Approve leave" work item from his inbox
    2. This will open the leave request approval application
    3. Approver clicks the approve button.
    4. Clicking the approval button updates the leave request status to approved in the database and at the same time completes the "Approve leave" work item, and thus the workflow will continue.
    Everything is handled with a single step and there is no need for some kind of sequential decision step.
    Even better would be that when you click the approve button, you would trigger an event REQUEST.APPROVED of your possible business object instance, and your task would be waiting for this event. The event would complete the even, and thus you would not need to use SAP_WAPI_WORKITEM_COMPLETE (=your application/module pool does not need to know anything about the workflow (=work item ID) - it would just trigger the event for the request). The best approach is to separate the business logic / application from the workflow, if you have a possibility for it (and if you are building something from scratch, then you have all the possibilities for this).
    Kind regards,
    Karri

  • Module pool to maintiane table ztavble

    hi
    can anyone send me complete code to refer for maintaining a ztable
    following validation are required like
    1) sortiing
    deletein and addition save etc all as in table maintianece i need to code by module pool becasue in table maintainece sorting coding is not possible...
    also validation are
    1) whne user enters ship to info name 1 should automatically be populated from kna1 on pressing enter how to acheive this by module pool
    2) email verification format should be correct? how to acheive this by module pool
    3) sorting on basis of all fields
    regards
    Nishant

    Hi Nishanth,,,
    I also developed the same kind of Program for maintaining the Ztable...
    Jus create a new GUI Staus...with the required functions....
    Refer the below code:
       REPORT                     : Z0BRAP_TAX_EXCEPTION .
    TITLE                      : Tax Exceptions Table
    AUTHOR                     : Swaminathan PJ
    DATE                       : 04/12/2006
    DDN NUMBER                 : SAP-BR-TB0020
    TRANSPORT REQUEST NUMBER   : D12K912309
    REFERENCE                  :
    DESCRIPTION
    Program Z0BRAP_TAX_EXCEPTION is an Report program to update the table
    ZTBRAP_TAX_EXCPT,here user can Create/Change/Display the table entrie
    s and can perform the following functions (Filter,Sort,Summation and
    Subtotal).
    AMENDMENTS
    CHANGES REF         DATE         PERSON         Tran.Req. Number
    DESCRIPTION:
                   Include for Global Declarations                       *
       INCLUDE: znbrap_tax_exception_top.                                           " Include for Global Declarative elements
         Include
    All the subroutines are include
       INCLUDE znbrap_tax_exception.                                                " Include for all Subroutines
         START OF SELECTION
       START-OF-SELECTION.
      Main Subroutine
         PERFORM  procMain.
                         End of Selection                                *
       END-OF-SELECTION.
    INCLUDE                    : ZNBRAP_TAX_EXCEPTION_TOP
    TITLE                      : Data Declarations
    AUTHOR                     :
    DATE                       : 04.12.2006
    TRANSPORT REQUEST NUMBER   : D12K912309
    DESCRIPTION
    Global Data Declarations for Z0BRAP_TAX_EXCEPTION
    AMENDMENTS
    CHANGES REF         DATE         PERSON         Tran.Req. Number
    DESCRIPTION:
    ALV Declarations
    TYPE-POOLS: slis.
    Types contains the structure of the table
    *TYPES :   BEGIN OF gy_tax_exception.
               INCLUDE STRUCTURE ztbrap_tax_excpt.
                 mandt           TYPE   mandt,
                 zmonat          TYPE   monat,
                 zbukrs          TYPE   bukrs,
                 zlifnr          TYPE   lifnr,
                 zexctype        TYPE   zebrap_exctype,
                 zstcd1          TYPE   stcd1,
                 zaugdt_other    TYPE   budat,
                 zbelnr          TYPE   belnr,
                 zdmbtr          TYPE   dmbtr,
                 zwhtinssca      TYPE   dmbtr,
                 zuserch         TYPE   syuname,
                 zdate_change    TYPE   datum,
                 ztime_change    TYPE   uzeit,
    *TYPES:          END OF gy_tax_exception.
    Tables for the structure defined above
    *TYPES : gy_tax_exception_tab  TYPE STANDARD TABLE OF gy_tax_exception.
    Internal Table
    DATA: gt_tax_excpt_tab        TYPE   STANDARD TABLE OF ztbrap_tax_excpt WITH HEADER LINE, "Global internal table for Tax exceptions data
          gt_fieldcat                   TYPE   slis_fieldcat_alv OCCURS 0 WITH HEADER LINE.         "Global internal table for fieldcat
    *&  Include           ZNBRAP_TAX_EXCEPTION                             *
    *&      Form  procMain
          text
    -->  p1        text
    <--  p2        text
    FORM procMain .
    Set PF-Status
      perform procInitialize.
    Select Tax Exceptions Data
      perform procGetTaxExceptionsData.
    Display ALV Report with Tax Exceptions Data
      perform procDisplayTaxExceptionsData.
    ENDFORM.                    " procMain
          FORM initialize                                               *
    form procInitialize.
      CONSTANTS :
      lc_pfstatus               TYPE    abnkr VALUE 'ZTAX_EXCEPTION'. "Pf Status
    Set status
      set pf-status lc_pfstatus.
    endform.                    "procInitialize
          FORM retrieve_data                                            *
          Retrieve data from SAP                                        *
    form procGetTaxExceptionsData.
      REFRESH: gt_tax_excpt_tab.
      select * from ztbrap_tax_excpt
        appending corresponding fields of table gt_tax_excpt_tab.
    endform.                    "procGetTaxExceptionsData
    Called by REUSE_ALV_GRID_DISPLAY when user interacts.               *
    In this case, there are a number of buttons / menu options for      *
    user to select for non-standard functions:                          *
    o Single Display                                                    *
    o Single Change                                                     *
    o Single create                                                     *
    o Single Delete                                                     *
          --> lv_ucomm                                                  *
          --> LW_SELFIELD                                               *
    form user_command using lv_ucomm like sy-ucomm
                      lw_selfield type slis_selfield.
    Work area
      DATA: lw_update_tax_excpt TYPE    ztbrap_tax_excpt. " work area for tax exceptions data
      DATA: lw_tax_exception    TYPE    ztbrap_tax_excpt. " work area for tax exceptions data
    Variables
      DATA: lv_key              TYPE    abkrs ,                 "key fields
            lv_non_key          TYPE    abkrs,                  "Non Key Fields
            lv_insert           TYPE    ablnv,                  "Insert
            lv_change           TYPE    ablnv,                  "Change
            lv_entry            TYPE    ablnv,                  "Popup title
            lv_display          TYPE    ablnv,                  "Display
            lv_delete           TYPE    ablnv,                  "Delete
            lv_mode             TYPE    ablnv .                 "Menu options
    Constants
      CONSTANTS:
           lc_new               TYPE    alind VALUE 'ZNEW',     "Fcode for new
           lc_update            TYPE    alind VALUE 'ZBR',      "Fcode for change
           lc_view              TYPE    alind VALUE 'ZDISP',    "Fcode for display
           lc_delete            TYPE    alind VALUE 'ZDEL ',    "Fcode for delete
           lc_show_field        TYPE    abkrs VALUE '00',       "Show field
           lc_hide_field        TYPE    abkrs VALUE '02'.       "Hide field
    Clear Local Work Area
      CLEAR :
           lw_update_tax_excpt.
    Clear Local Variables
      CLEAR :
           lv_key,
           lv_non_key,
           lv_mode,
           lv_insert,
           lv_delete,
           lv_change,
           lv_display.
    Retrieve data for selected line & store it in a temp structure.
      READ TABLE gt_tax_excpt_tab index lw_selfield-tabindex .
      if sy-subrc is not initial and lv_ucomm <> lc_new  and lv_ucomm(6) <> 'DELETE'.
        message w123(m&).   " Position the cursor on a valid line
        exit.
      endif.
    Moving the contents to workarea
    MOVE gt_tax_excpt_tab-zmonat         TO lw_update_tax_excpt-zmonat.
    MOVE gt_tax_excpt_tab-zbukrs         TO lw_update_tax_excpt-zbukrs.
    MOVE gt_tax_excpt_tab-zlifnr         to lw_update_tax_excpt-zlifnr.
    MOVE gt_tax_excpt_tab-zexctype       to lw_update_tax_excpt-zexctype.
    MOVE gt_tax_excpt_tab-zstcd1         to lw_update_tax_excpt-zstcd1.
    MOVE gt_tax_excpt_tab-zaugdt_other   to lw_update_tax_excpt-zaugdt_other.
    MOVE gt_tax_excpt_tab-zbelnr         to lw_update_tax_excpt-zbelnr.
    MOVE gt_tax_excpt_tab-zdmbtr         to lw_update_tax_excpt-zdmbtr.
    MOVE gt_tax_excpt_tab-zwhtinssca     to lw_update_tax_excpt-zwhtinssca.
    MOVE gt_tax_excpt_tab-zuserch        to lw_update_tax_excpt-zuserch.
    MOVE gt_tax_excpt_tab-zdate_change   to lw_update_tax_excpt-zdate_change.
    MOVE gt_tax_excpt_tab-ztime_change   to lw_update_tax_excpt-ztime_change.
    Move the text for Add,Change,Display
      Move text-019 To lv_insert.
      Move text-020 To lv_change.
      Move text-021 To lv_display.
      Move text-023 To lv_delete.
    Now see which button / menu option user has selected
      case lv_ucomm.
        when lc_view.               "Display a single entry
          lv_mode    = lv_display.
          lv_key     = lc_hide_field.     "hide key fields
          lv_non_key = lc_hide_field.     "hide non key fields
          perform procFindKeyFields
                         using lw_update_tax_excpt lv_mode lv_insert lv_delete
                               lv_change lv_display lv_key lv_non_key lw_selfield.
        when lc_update .          "Update a single entry (show non-key fields)
          lv_mode    = lv_change.
          lv_key     = lc_hide_field.    "hide key fields
          lv_non_key = lc_show_field.    "show non-key fields
          perform procFindKeyFields
                         using lw_update_tax_excpt lv_mode lv_insert lv_delete
                               lv_change lv_display lv_key lv_non_key lw_selfield.
        when lc_new. "Add a single new entry (show all fields)
          lv_mode    = lv_insert.
          lv_key     = lc_show_field.
          lv_non_key = lc_show_field.
          clear lw_update_tax_excpt.  "Empty structure to give new entry.
          perform procFindKeyFields
                         using lw_update_tax_excpt lv_mode lv_insert lv_delete
                               lv_change lv_display lv_key lv_non_key lw_selfield.
        WHEN lc_delete.               " Delete current entry
          lv_mode   = lv_delete.
          lv_key    = lc_hide_field.
          lv_non_key = lc_hide_field.
         perform procFindKeyFields
                         using lw_update_tax_excpt lv_mode lv_insert lv_delete
                               lv_change lv_display lv_key lv_non_key lw_selfield.
      endcase.
    endform.                    "user_command
          FORM procFindKeyFields                                        *
    -->  lw_tax_excpt                                                  *
    -->  lw_update_tax_excpt                                           *
    -->  lv_ret                                                        *
    form procFindKeyFields  using  lw_update_tax_excpt structure  ztbrap_tax_excpt
                                   lv_mode
                                   lv_insert
                                   lv_delete
                                   lv_change
                                   lv_display
                                   lv_key
                                   lv_non_key
                                   lw_selfield type slis_selfield.
    Work area
      DATA:lw_key_table         TYPE    dfies occurs 0 with header line,      "Work area for for key fields
           lw_tax_excpt         TYPE    sval  occurs 0 with header line.      "Work area for tax exceptions data
    Variables
      DATA: lv_ret              TYPE    char1,                                "Return parameter
            lv_title            TYPE    text60,                               "Popup title
            lv_excpt_type       TYPE    ZEBRAP_EXCTYPE,                       "Exception type
            lv_entry            TYPE    ablnv,                                "Popup text
            lv_vendor           TYPE    lifnr,                                "Vendor
            lv_vendor_no        TYPE    lifnr,                                "Vendor
            lv_co_code          TYPE    bukrs,                                "Company code
            lv_comp_code        TYPE    bukrs,                                "Company code
            lv_answer           TYPE    aavis.                                "Return parameter
    Constants
      CONSTANTS:
            lc_ref_tab          TYPE    ablnv VALUE 'T001',                   "Reference table
            lc_ref_fld          TYPE    ablnv VALUE 'WAERS',                  "Reference field
            lc_hide_fld         TYPE    abkrs VALUE '04',                     "Hide field
            lc_client           TYPE    amert VALUE 'MANDT',                  "Client
            lc_user             TYPE    amert VALUE 'ZUSERCH',                "User
            lc_date             TYPE    amert VALUE 'ZDATE_CHANGE',           "Date
            lc_time             TYPE    amert VALUE 'ZTIME_CHANGE',           "Time
            lc_taxno            TYPE    amert VALUE 'ZSTCD1',                 "Tax Number
            lc_vendor           TYPE    amert VALUE 'ZLIFNR',                 "Vendor
            lc_exception_typ    TYPE    amert VALUE 'ZEXCTYPE',               "Exception type
            lc_clearing_dt      TYPE    amert VALUE 'ZAUGDT_OTHER',           "Clearing date
            lc_period           TYPE    amert VALUE 'ZMONAT',                 "Period
            lc_co_code          TYPE    amert VALUE 'ZBUKRS',                 "Company code
            lc_gross_amt        TYPE    amert VALUE 'ZDMBTR',                 "Gross amount
            lc_excpt_amt        TYPE    amert VALUE 'ZWHTINSSCA',             "Exception amount
            lc_period_def       TYPE    abkrs VALUE '00',                     "Default value for period
            lc_amount_def       TYPE    amert VALUE '0.00',                   "Default value for amount
            lc_date_def         TYPE    amert VALUE '00000000',               "Default value for date
            lc_exctype_mf       TYPE    abkrs VALUE 'MF',                     "Exception type value
            lc_exctype_gr       TYPE    abkrs VALUE 'GR',                     "Exception type value
            lc_field_obl        TYPE    aavis VALUE 'X',                      "Obligatory
            lc_cancel           TYPE    aavis VALUE 'X',                      "Obligatory
            lc_return           TYPE    aavis VALUE 'A',                      "Return parameter
            lc_mandatory        TYPE    aavis VALUE '?',                      "Mandatory
            lc_space            TYPE    abkrs VALUE ' ',                      "Space
            lc_notsupported     TYPE    agitt VALUE 1,                        "Exception for FM
            lc_others           TYPE    agitt VALUE 2,                        "Exception for FM
            lc_error            TYPE    agitt VALUE 1,                        "Exception for FM
            lc_confirm          TYPE    agitt VALUE 1,                        "Exception for FM
            lc_text             TYPE    agitt VALUE 1,                        "Exception for FM
            lc_start_column     TYPE    abkrs VALUE '50',                     "Start column
            lc_start_row        TYPE    aavis VALUE '7',                      "Start column
            lc_tabname          TYPE    amert VALUE 'ZTBRAP_TAX_EXCPT',       "Table name,
            lc_column           TYPE    SY-CUCOL VALUE 25,                    "Start column
            lc_row              TYPE    SY-CUROW VALUE 6.                     "Start row
    Clear Local Work Area
      CLEAR :
           lw_tax_excpt,
           lw_key_table .
    Clear Local Variables
      CLEAR :
            lv_ret,
            lv_title,
            lv_excpt_type,
            lv_vendor,
            lv_vendor_no,
            lv_co_code,
            lv_comp_code,
            lv_answer.
    Field symbol
      field-symbols:            <lf_tax_excpt>,                                         "Tax exceptions values
                                <lf_tax_excpt_value>.
    Move the text for entry
      Move text-022 To lv_entry.
      REFRESH lw_tax_excpt.
      lw_tax_excpt-field_obl = lc_field_obl.
      lw_tax_excpt-tabname =   lc_tabname.
    Determine which are key fields in the table. This is necessary to
    control which fields are available for display
      call function 'GET_KEY_FIELDS_OF_TABLE'
        EXPORTING
          tabname       = lw_tax_excpt-tabname
          mandt_needed  = lc_field_obl
        TABLES
          key_fieldtab  = lw_key_table
        EXCEPTIONS
          not_supported = lc_notsupported
          others        = lc_others.
      if sy-subrc is not initial.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        exit.
      endif.
      loop at gt_fieldcat.
        case gt_fieldcat-fieldname.
    Supress fields you don't want to show
          when lc_client or  lc_user or lc_date or lc_time.
          when OTHERS.
            READ TABLE lw_key_table with key fieldname = gt_fieldcat-fieldname.
            if sy-subrc is initial.
              lw_tax_excpt-field_attr = lv_key.
              lw_tax_excpt-field_obl = lc_field_obl.
            else.
              lw_tax_excpt-field_attr = lv_non_key.
              lw_tax_excpt-field_obl = lc_space.
            endif.
            lw_tax_excpt-fieldname = gt_fieldcat-fieldname.
            assign component lw_tax_excpt-fieldname of
                            structure lw_update_tax_excpt to <lf_tax_excpt>.
            lw_tax_excpt-value =    <lf_tax_excpt>.
            lw_tax_excpt-fieldtext = gt_fieldcat-seltext_l.
    Remove the condition obligatory
            IF lw_tax_excpt-fieldname = lc_taxno.
              lw_tax_excpt-field_obl = lc_space.
            ENDIF.
            append lw_tax_excpt.
        endcase.
      endloop  .
    Appending the reference table and field for amount field
      if lv_mode = lv_insert.
        lw_tax_excpt-tabname    = lc_ref_tab.
        lw_tax_excpt-fieldname  = lc_ref_fld.
        lw_tax_excpt-field_attr = lc_hide_fld.
        append lw_tax_excpt.
      endif.
    IF lv_mode  NE lv_delete.
    Show selected entry
      CONCATENATE lv_mode lv_entry INTO lv_title SEPARATED BY space.
      do.
        call function 'POPUP_GET_VALUES'
          EXPORTING
            popup_title     = lv_title
            start_column    = lc_start_column
            start_row       = lc_start_row
          IMPORTING
            returncode      = lv_ret
          TABLES
            fields          = lw_tax_excpt
          EXCEPTIONS
            error_in_fields = lc_error
            others          = lc_others.
    Exit if Error, Display or Delete
        if sy-subrc is not initial or lv_ret = lc_return
                                   or lv_mode = lv_display
                                   or lv_mode = lv_delete..
          exit.
        endif.
    Validate fields involved in ADDING NEW ENTRY
        IF lv_mode  = lv_insert .         "ADD new Entry
    Validate the field Period
          READ TABLE lw_tax_excpt with key fieldname = lc_period.
          IF lw_tax_excpt-value EQ lc_period_def.
            PERFORM procWarnuser USING  text-001 text-003 .
            CONTINUE.
          ENDIF.
    Validate the field Company code
          READ TABLE lw_tax_excpt with key fieldname = lc_co_code.
          lv_co_code = lw_tax_excpt-value.
          select single bukrs from t001 into lv_comp_code
          where bukrs = lv_co_code.
          IF sy-subrc is not initial.
            PERFORM procWarnuser USING  text-001 text-028 .
            CONTINUE.
          ENDIF.
    Validate the field Vendor
          READ TABLE lw_tax_excpt with key fieldname = lc_vendor.
          lv_vendor = lw_tax_excpt-value.
          select single lifnr from lfa1 into lv_vendor_no
          where lifnr = lv_vendor.
          IF sy-subrc is not initial.
            PERFORM procWarnuser USING  text-001 text-024 .
            CONTINUE.
          ENDIF.
    Store the value of exception type in a variable
          READ TABLE lw_tax_excpt with key fieldname = lc_exception_typ.
          lv_excpt_type = lw_tax_excpt-value.
    Validate the field Tax number1 other entities
          READ TABLE lw_tax_excpt with key fieldname = lc_taxno.
          IF lv_excpt_type EQ lc_exctype_mf or  lv_excpt_type EQ lc_exctype_gr.
            IF lw_tax_excpt-value EQ space.
              PERFORM procWarnuser USING  text-001 text-002 .
              CONTINUE.
            ENDIF.
          ENDIF.
    Validate the field Clearing date
          READ TABLE lw_tax_excpt with key fieldname = lc_clearing_dt.
          IF lw_tax_excpt-value EQ lc_date_def.
            PERFORM procWarnuser USING  text-001 text-004.
            CONTINUE.
          ENDIF.
    Validate the field Gross amount
          READ TABLE lw_tax_excpt with key fieldname = lc_gross_amt.
          condense lw_tax_excpt-value no-gaps.
          IF lw_tax_excpt-value EQ lc_amount_def OR
             lw_tax_excpt-value EQ space.
            PERFORM procWarnuser USING  text-001 text-005.
            CONTINUE.
          ENDIF.
    Validate the field Exception amount
          READ TABLE lw_tax_excpt with key fieldname = lc_excpt_amt.
          condense lw_tax_excpt-value no-gaps.
          IF lw_tax_excpt-value EQ lc_amount_def OR
             lw_tax_excpt-value EQ space.
            PERFORM procWarnuser USING  text-001 text-006.
            CONTINUE.
          ENDIF.
          delete lw_tax_excpt index 10.
        ENDIF.
      all checks successful !!!!
        exit.
      enddo.
    endif.
    IF lv_mode  EQ  lv_delete.
    CONCATENATE lv_mode lv_entry INTO lv_title SEPARATED BY space.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
           TITLEBAR                    = lv_title
           text_question               = text-025
           TEXT_BUTTON_1               = text-026
           TEXT_BUTTON_2               = text-027
           DISPLAY_CANCEL_BUTTON       = lc_space
           START_COLUMN                = lc_column
           START_ROW                   = lc_row
         IMPORTING
           ANSWER                      = lv_answer
         EXCEPTIONS
           TEXT_NOT_FOUND              = lc_text
           OTHERS                      = lc_others
        IF sy-subrc is not initial.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    ENDIF.
    Need to pop-out of the sub if "cancel" was selected
      if lv_ret = lc_return or lv_mode = lv_display.
        exit.
      endif.
    copy contents of pop-up back into structure
      loop at lw_tax_excpt.
        check lw_tax_excpt-value <> lc_mandatory.
        assign component lw_tax_excpt-fieldname
                         of structure lw_update_tax_excpt to <lf_tax_excpt_value>.
        <lf_tax_excpt_value> = lw_tax_excpt-value.
      endloop.
    update the database accordingly.
      case lv_mode.
        when lv_insert.           "Insert
    Give other required field values
          lw_update_tax_excpt-mandt        = sy-mandt.   "Client
          lw_update_tax_excpt-zuserch      = sy-uname.   "User
          lw_update_tax_excpt-zdate_change = sy-datum.   "Date
          lw_update_tax_excpt-ztime_change = sy-uzeit.   "Time
          INSERT into ztbrap_tax_excpt values lw_update_tax_excpt.
          message s036(zmbrap).
        WHEN lv_change.            "Change
    Give other required field values
          lw_update_tax_excpt-mandt        = sy-mandt.   "Client
          lw_update_tax_excpt-zuserch      = sy-uname.   "User
          lw_update_tax_excpt-zdate_change = sy-datum.   "Date
          lw_update_tax_excpt-ztime_change = sy-uzeit.   "Time
          MODIFY ztbrap_tax_excpt FROM lw_update_tax_excpt.  "Update record
          message s037(zmbrap).
        WHEN lv_delete.             "Delete
          IF lv_answer = lc_confirm.
          DELETE FROM ztbrap_tax_excpt WHERE
                  zmonat       =   lw_update_tax_excpt-zmonat       AND
                  zbukrs       =   lw_update_tax_excpt-zbukrs       AND
                  zlifnr       =   lw_update_tax_excpt-zlifnr       AND
                  zexctype     =   lw_update_tax_excpt-zexctype     AND
                  zstcd1       =   lw_update_tax_excpt-zstcd1       AND
                  zaugdt_other =   lw_update_tax_excpt-zaugdt_other AND
                  zdmbtr       =   lw_update_tax_excpt-zdmbtr       AND
                  zwhtinssca   =   lw_update_tax_excpt-zwhtinssca.
          message s038(zmbrap).
          ENDIF.
      endcase.
    Now do refresh ...
      if sy-subrc is not initial.
        rollback work.
        message e033(zmbrap).
      else.
        perform procGetTaxExceptionsData.
        commit work.
        perform procGetTaxExceptionsData.
        lw_selfield-refresh    = lc_field_obl.
        lw_selfield-col_stable = lc_field_obl.
        lw_selfield-row_stable = lc_field_obl.
      endif.
    endform.                    "procFindKeyFields
          FORM procDisplayTaxExceptionsData                             *
    Produce ALV report                                                  *
    form procDisplayTaxExceptionsData.
    Variables
      DATA: lv_layout         TYPE       slis_layout_alv,                                 "Layout
            lv_dispvariant    TYPE       disvariant,                                      "For display
            lv_events         TYPE       slis_t_event,                                    "Events
            lv_grid_settings  TYPE       lvc_s_glay,                                      "Grid settings
            lv_event          TYPE       slis_alv_event.                                  "Events
    Constants
      CONSTANTS:
            lc_user_command   TYPE       slis_formname VALUE 'USER_COMMAND',              "User command
            lc_pf_status      TYPE       slis_formname VALUE 'PF_STATUS_SET_SHOW_LIST',   "Pf status
            lc_top_of_page    TYPE       slis_formname VALUE 'TOP_OF_PAGE',               "Top of page
            lc_tab_name       TYPE       tabname       VALUE  'ZTBRAP_TAX_EXCPT',         "Table name
            lc_stripes        TYPE       aavis         VALUE 'X',                         "Stripes
            lc_save           TYPE       aavis         VALUE 'A',                         "Save
            lc_repid          TYPE       sy-repid      VALUE sy-repid,                    "Program name
            lc_inconsistent   TYPE       agitt         VALUE 1,                           "Exception for FM
            lc_program        TYPE       agitt         VALUE 2,                           "Exception for FM
            lc_others         TYPE       agitt         VALUE 3.                           "Exception for FM
    Clear Local Variables
      CLEAR:
            lv_layout,
            lv_dispvariant,
            lv_events,
            lv_grid_settings,
            lv_event.
    *Set up ALV structures
      lv_dispvariant-report   = lc_repid.
    gv_repid = sy-repid.
      lv_dispvariant-username = sy-uname.
    *Set alternate stripes for ALV report
      lv_layout-zebra = lc_stripes .
      lv_grid_settings-coll_top_p = lc_stripes .
    *Set up exit structure for top of coverpage
      lv_event-name = slis_ev_top_of_coverpage.
      lv_event-form = slis_ev_top_of_coverpage.
      append  lv_event to lv_events.
    *Set up exit for top of page
      lv_event-name = slis_ev_top_of_page.
      lv_event-form = slis_ev_top_of_page.
      append  lv_event to lv_events.
    *Build field catalog for List Viewer
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = lc_repid
          i_inclname             = lc_repid
          i_structure_name       = lc_tab_name
        CHANGING
          ct_fieldcat            = gt_fieldcat[]
        EXCEPTIONS
          inconsistent_interface = lc_inconsistent
          program_error          = lc_program
          others                 = lc_others.
    field controls
      PERFORM procBuildFieldcat.
    Call ABAP/4 List Viewer
      check not gt_fieldcat[] is initial.
      call function 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = lc_repid
          i_callback_user_command  = lc_user_command
          i_callback_pf_status_set = lc_pf_status
          i_callback_top_of_page   = lc_top_of_page
          is_variant               = lv_dispvariant
          i_grid_settings          = lv_grid_settings
          is_layout                = lv_layout
          it_fieldcat              = gt_fieldcat[]
          it_events                = lv_events
          i_save                   = lc_save  " A = All => Standard & User
        TABLES
          t_outtab                 = gt_tax_excpt_tab.
    endform.                    "procDisplayTaxExceptionsData
    **&      Form  PF_STATUS_SET_SHOW_LIST
          Set modified standard status for list
    form pf_status_set_show_list
                     using lw_excpt_tab TYPE slis_t_extab.
    Workarea
      DATA : lw_tax_tab       TYPE       slis_extab.                                      "Type group Slis
    Constants
      DATA : lc_pfstat        TYPE       amert    VALUE 'ZTAX_EXCEPTION',                 "Pf status
             lc_prog          TYPE       sy-repid VALUE sy-repid,                         "Program name
             lc_fcode         TYPE       gui_code VALUE 'SELI'.                           "Function code
    Clear Workarea
      CLEAR :lw_tax_tab.
      lw_tax_tab-fcode = lc_fcode.
      append lw_tax_tab to lw_excpt_tab.
      set pf-status lc_pfstat of program lc_prog excluding lw_excpt_tab.
    endform.                               "PF_STATUS_SET_SHOW_LIST
    **&      Form  procBuildFieldcat
          text
    -->  p1        text
    <--  p2        text
    form procBuildFieldcat .
    Constants
      CONSTANTS :
            lc_co_code          TYPE    amert VALUE 'ZBUKRS',                             "Company code
            lc_vendor           TYPE    amert VALUE 'ZLIFNR',                             "Vendor
            lc_docu_no          TYPE    amert VALUE 'ZBELNR',                             "Document Number
            lc_user             TYPE    amert VALUE 'ZUSERCH',                            "User
            lc_date             TYPE    amert VALUE 'ZDATE_CHANGE',                       "Date
            lc_time             TYPE    amert VALUE 'ZTIME_CHANGE',                       "Time
            lc_taxno            TYPE    amert VALUE 'ZSTCD1',                             "Tax Number
            lc_exception_typ    TYPE    amert VALUE 'ZEXCTYPE',                           "Exception type
            lc_clearing_dt      TYPE    amert VALUE 'ZAUGDT_OTHER',                       "Clearing date
            lc_period           TYPE    amert VALUE 'ZMONAT',                             "Period
            lc_gross_amt        TYPE    amert VALUE 'ZDMBTR',                             "Gross amount
            lc_excpt_amt        TYPE    amert VALUE 'ZWHTINSSCA'.                         "Exception amount
    Set the Fieldtext for the Dictionary fields
      LOOP AT gt_fieldcat.
        gt_fieldcat-key = space.
        CASE gt_fieldcat-fieldname.
          WHEN lc_period.
            gt_fieldcat-seltext_l = text-007.
            MODIFY gt_fieldcat.
          WHEN lc_co_code.
            gt_fieldcat-seltext_l = text-008.
            MODIFY gt_fieldcat.
          WHEN lc_vendor.
            gt_fieldcat-seltext_l = text-009.
            MODIFY gt_fieldcat.
          WHEN lc_exception_typ.
            gt_fieldcat-seltext_l = text-010.
            MODIFY gt_fieldcat.
          WHEN lc_taxno.
            gt_fieldcat-seltext_l = text-011.
            MODIFY gt_fieldcat.
          WHEN lc_clearing_dt.
            gt_fieldcat-seltext_l = text-012.
            MODIFY gt_fieldcat.
          WHEN lc_docu_no.
            gt_fieldcat-seltext_l = text-013.
            MODIFY gt_fieldcat.
          WHEN lc_gross_amt.
            gt_fieldcat-seltext_l = text-014.
            gt_fieldcat-outputlen = 12.
            MODIFY gt_fieldcat.
          WHEN lc_excpt_amt.
            gt_fieldcat-seltext_l = text-015.
            MODIFY gt_fieldcat.
          WHEN lc_user.
            gt_fieldcat-seltext_l = text-016.
            MODIFY gt_fieldcat.
          WHEN lc_date.
            gt_fieldcat-seltext_l = text-017.
            MODIFY gt_fieldcat.
          WHEN lc_time.
            gt_fieldcat-seltext_l = text-018.
            MODIFY gt_fieldcat.
        ENDCASE.
      ENDLOOP.
    endform.                    " procBuildFieldcat
    *&      Form  procWarnuser
          Warn User - Give error message
         -->P_TEXT      text
         -->P_TEXT      text
         -->P_lw_tax_excpt_VALUE  text
    FORM procWarnuser  USING    uv_title TYPE itex132
                                uv_text1 TYPE itex132.
    Constants
      CONSTANTS :
            lc_start_column       TYPE    SY-CUCOL VALUE 25,                             "Start column
            lc_start_row          TYPE    SY-CUROW VALUE 15.                             "Start row

  • F1 help on a field in module pool programming

    I want to create f1 help on a field in module pool programming. How to use POH event. where should i write the help documentation. Before using this f1 help on a field i have to set some properties on GUI interface Editor. Please clearly mention the steps i have to follow.

    PROCESS ON HELP-REQUEST.
    FIELD P_LFA1 MODULE HELP_F1_LIFNR.
    MODULE HELP_F1_LIFNR INPUT.
    PERFORM SHOW_HELP_F1 USING 'ZFAG_DOC1'.
    ENDMODULE. " help_f1_lifnr INPUT
    FORM SHOW_HELP_F1 USING P_OBJECT.
    Dati testo help
    DATA: T_LINE LIKE TLINE OCCURS 0,
    XHEAD LIKE THEAD,
    HELP_INFO LIKE HELP_INFO,
    TEXC LIKE SY-UCOMM OCCURS 0,
    V_OBJECT LIKE DOKHL-OBJECT.
    Costante
    DATA: PREF_SIMG(4) VALUE 'SIMG',
    DOCID_HY LIKE DOKHL-ID VALUE 'HY'.
    Testo
    CONCATENATE PREF_SIMG P_OBJECT INTO V_OBJECT.
    Estrazione testo
    CALL FUNCTION 'DOCU_GET_FOR_F1HELP'
    EXPORTING
    ID = DOCID_HY
    LANGU = SY-LANGU
    OBJECT = V_OBJECT
    IMPORTING
    HEAD = XHEAD
    TABLES
    LINE = T_LINE
    EXCEPTIONS
    RET_CODE = 1
    OTHERS = 2.
    CASE SY-SUBRC .
    WHEN 0.
    Visualizzazione testo
    GET CURSOR FIELD HELP_INFO-DYNPROFLD.
    HELP_INFO-DOCUID = DOCID_HY.
    HELP_INFO-DOCUOBJECT = V_OBJECT.
    HELP_INFO-SPRAS = SY-LANGU.
    HELP_INFO-PROGRAM = SY-REPID.
    HELP_INFO-DYNPRO = SY-DYNNR.
    HELP_INFO-DYNPPROG = SY-REPID.
    HELP_INFO-PFKEY = SY-PFKEY.
    HELP_INFO-FIELDNAME = HELP_INFO-DYNPROFLD.
    CALL FUNCTION 'HELP_DOCULINES_SHOW'
    EXPORTING
    HELP_INFOS = HELP_INFO
    OVERLAY_HEADER = XHEAD
    TABLES
    EXCLUDEFUN = TEXC
    HELPLINES = T_LINE.
    WHEN OTHERS. MESSAGE S720(SH).
    ENDCASE.
    ENDFORM. " SHOW_HELP_F1

  • How to insert Logo in module pool programming

    Plz any one can explain me that  how we will inseart Logo on screens by using module pool programming (in GUI programming) .

    Hello.
    I'll give you an example of inserting a personal photo in UI programming. Hope it helps you.
    First of all, in your screen (painter), insert a custom control and give it a name (PHOTO in my example).
    Then, in your screen PBO, insert a coding like this:
    CLEAR handle.
    CALL FUNCTION 'HR_IMAGE_INIT'
        EXPORTING
          p_pernr        = pernr
          p_tclas        = 'A'
          container      = 'PHOTO'
        IMPORTING
          handle         = handle
        EXCEPTIONS
          no_document    = 1
          internal_error = 2
          OTHERS         = 3.
      CALL FUNCTION 'HR_IMAGE_SHOW'
        EXPORTING
          p_pernr        = pernr
          p_tclas        = 'A'
          handle         = handle
        EXCEPTIONS
          invalid_handle = 1
          no_document    = 2
          internal_error = 3
          OTHERS         = 4.
    Regards.
    Valter Oliveira.

  • Problem in Screen field position ( Module pool )

    Hi Experts,
    We changed the screen field position ( GUI ) of SAP standard module pool program.  we had taken the access key from SAP and modified the layout.
    Our Problem :   We had transported  these change request to Quality and Pre Production. The changes are transferred correctly in Quality .  when coming to Pre Production the changes are not visible on  the screen.
    Checks Performed :  1. We had analyzed the Transport request - They are imported correctly.
                                        2. We had rechecked the layout that we had changed its good and correct.
    Can you experts help me out in identify the exact solution for this problem.
    - Best Regards,
    Sudhakar Puppala
    Edited by: CRM Sudhakar on Sep 16, 2010 11:25 AM

    Hi, no idea can be given without having a look..
    but just check the screen layout in the pre-production itself..instead checking transport..

  • At Selection Screen in Module Pool

    Hi,
       I am doing an Module pool which has 2 screens.
    First screen has a table control.
    When user double clicks any record in the table control I have to process further with value of the clicked record.
    Can anyone let me know how the At Line Selection works in Module pool.
    Thanks & Regards,
    Sandeep

    hi
    u have to make field of table control <b>respond to double click</b> in attributes of that field.
    make one button 'PICK' and assign recommended key 'F2' in GUI Status (Its Compulsary to give 'F2')
    now in User_command of PAI
    case sy-ucomm.
    when 'PICK'.
    endcase.
    Message was edited by:
            Dhwani shah

  • Plz provide tutorial to learn the Module pool programing?

    Hello,
    Please provide me with the Tutorials which will be helpful to learn Module Pool Programming.
    If any one can provide me with the screen shots then it would be great!
    ANy help would be appreciated......
    Thank You!
    Krishna Chaitanya

    Hi,
    Screens are the most general type of user dialog that you can use in ABAP programs. You do not define them in ABAP programs, but instead in the Screen Painter. A screen consists of the input/output mask and the flow logic. You can define screens for any program with type 1, M, or F.
    The screens in a single ABAP program can be combined to form screen sequences. You can call single screens or screen sequences either using a transaction code from outside the ABAP program, or by using the CALL SCREEN statement in the corresponding ABAP program. When you call a screen or screen sequence, the screen flow logic takes control of the ABAP program execution. You can define screen sequences dynamically by setting the next screen attribute for a screen dynamically in the ABAP program.
    A screen consists of the input/output mask and the flow logic. The screen flow logic is divided into the Process Before Output (PBO) event, which is processed before the screen is displayed, and the Process After Input (PAI) event, which is processed after a user action on the screen.
    The following diagram shows the place of screens between the GUI status and the ABAP program:
    The screen flow logic calls dialog modules in the ABAP program, either to prepare the screen for display (PBO event) or to process the user's entries (PAI event). Screens are dynamic programs, and have their own data objects, called screen fields. These are linked to the input/output fields that appear on the screen itself. When the screen is displayed, and when it finishes processing, the system passes data between the screen fields and data objects in the ABAP program. Data is copied between identically-named fields.
    Each screen has a GUI status, containing a menu bar, standard toolbar, and an application toolbar. Like screens, GUI statuses are independent components of the ABAP program. You create them in the ABAP Workbench using the Menu Painter. You assign GUI statuses to screens dynamically in your ABAP programs. Each screen is linked to the current GUI status by a special screen field into which the corresponding function code is placed whenever the user chooses a function. The screen passes the function code to the ABAP program just like any other screen field. You can then read it in the program.
    Screen Attributes
    Like all objects in the R/3 Repository, screens have attributes that both describe them and determine how they behave at runtime. Important screen attributes for ABAP programming:
    Program
    The name of the ABAP program (type 1, M, or F) to which the screen belongs.
    Screen number
    A four-digit number, unique within the ABAP program, that identifies the screen within the program. If your program contains selection screens, remember that selection screens and Screen Painter screens use the same namespace. For example, if you have a program with a standard selection screen, you may not contain any further screens with the number 1000. Lists, on the other hand, have their own namespace.
    Screen type
    A normal screen occupies a whole GUI window. Modal dialog boxes only cover a part of a GUI window. Their interface elements are also arranged differently. Selection screens are generated automatically from the definition in the ABAP program. You may not define them using the Screen Painter. A subscreen is a screen that you can display in a subscreen area on a different screen in the same ABAP program.
    Next screen
    Statically-defined screen number, specifying the next screen in the sequence. If you enter zero or leave the field blank, you define the current screen as the last in the chain. If the next screen is the same as the current screen, the screen will keep on calling itself. You can override the statically-defined next screen in the ABAP program.
    Cursor position
    Static definition of the screen element on which the cursor is positioned when the screen is displayed. By default, the cursor appears on the first input field. You can overwrite the static cursor position dynamically in your ABAP program.
    Screen group
    Four-character ID, placed in the system field SY-DYNGR while the screen is being processed. This allows you to assign several screens to a common screen group. You can use this, for example, to modify all of the screens in the group in a uniform way. Screen groups are stored in table TFAWT.
    Hold data
    If the user calls the screen more than once during a terminal session, he or she can retain changed data as default values by choosing System ® User profile ® Hold data.
    Screen Attributes
    Like all objects in the R/3 Repository, screens have attributes that both describe them and determine how they behave at runtime. Important screen attributes for ABAP programming:
    Program
    The name of the ABAP program (type 1, M, or F) to which the screen belongs.
    Screen number
    A four-digit number, unique within the ABAP program, that identifies the screen within the program. If your program contains selection screens, remember that selection screens and Screen Painter screens use the same namespace. For example, if you have a program with a standard selection screen, you may not contain any further screens with the number 1000. Lists, on the other hand, have their own namespace.
    Screen type
    A normal screen occupies a whole GUI window. Modal dialog boxes only cover a part of a GUI window. Their interface elements are also arranged differently. Selection screens are generated automatically from the definition in the ABAP program. You may not define them using the Screen Painter. A subscreen is a screen that you can display in a subscreen area on a different screen in the same ABAP program.
    Next screen
    Statically-defined screen number, specifying the next screen in the sequence. If you enter zero or leave the field blank, you define the current screen as the last in the chain. If the next screen is the same as the current screen, the screen will keep on calling itself. You can override the statically-defined next screen in the ABAP program.
    Cursor position
    Static definition of the screen element on which the cursor is positioned when the screen is displayed. By default, the cursor appears on the first input field. You can overwrite the static cursor position dynamically in your ABAP program.
    Screen group
    Four-character ID, placed in the system field SY-DYNGR while the screen is being processed. This allows you to assign several screens to a common screen group. You can use this, for example, to modify all of the screens in the group in a uniform way. Screen groups are stored in table TFAWT.
    Hold data
    If the user calls the screen more than once during a terminal session, he or she can retain changed data as default values by choosing System ® User profile ® Hold data.
    Check the below link:
    http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
    http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
    You can also check the transaction ABAPDOCU which gives you lot of sample programs.
    Regards
    Kiran Sure

Maybe you are looking for