Showing posts with label Table Maintenance. Show all posts
Showing posts with label Table Maintenance. Show all posts

Oct 23, 2024

Steps to Create Table Maintenance in SAP FIORI

 

Step 1: Create an OData Service

  1. Open SEGW (Gateway Service Builder):

    • T-code: SEGW.
    • Create a new project for your table maintenance (e.g., Z_TABLE_MAINTENANCE).
  2. Create Entity Type:

    • In the Data Model section, right-click on Entity Types and choose Create.
    • Define the Entity Type based on your SAP table (e.g., MARA).
  3. Create Entity Set:

    • Right-click on Entity Sets and create an entity set that corresponds to the table (e.g., MaterialSet for MARA).
    • Map the entity type to the entity set.
  4. Generate Runtime Objects:

    • Once your data model is complete, right-click on the project and choose Generate Runtime Objects.
  5. Implement CRUD Operations in DPC_EXT:

    • Navigate to SE80 or SE24 to access the DPC_EXT class (Data Provider Class Extension).
    • Implement the CRUD methods like CREATE_ENTITY, UPDATE_ENTITY, DELETE_ENTITY, and GET_ENTITYSET to handle the operations for your SAP table.
  6. Register and Activate the OData Service:

    • Go to T-code /IWFND/MAINT_SERVICE to register and activate your OData service.
    • Test the service by accessing /sap/opu/odata/sap/<SERVICE_NAME>/ to verify that the service is working as expected.

Step 2: Create a Fiori Elements App (List Report App)

  1. Set up SAP Web IDE or Business Application Studio:

    • Open SAP Web IDE or SAP Business Application Studio (BAS) to create your app.
  2. Create a New Project:

    • From the welcome screen, select New Project from Template.
    • Choose SAP Fiori Elements – List Report Application template.
  3. Provide OData Service Information:

    • Select the system and service you created in SEGW (e.g., Z_TABLE_MAINTENANCE_SRV).
    • Select the Entity Set created for your table (e.g., MaterialSet for MARA).
  4. Configure the List Report and Object Page:

    • Define your list report settings like filters and table columns.
    • Configure the Object Page for detail views.

Step 3: Enable Editing (CRUD Operations)

  1. Edit the manifest.json:
    • Ensure that the app allows editing by setting the necessary flags in the manifest.json.
"sap.ui.generic.app": {
    "pages": {
        "ListReport|MaterialSet": {
            "entitySet": "MaterialSet",
            "component": {
                "name": "sap.suite.ui.generic.template.ListReport",
                "settings": {
                    "editable": true,
                    "defaultCreateEnabled": true,
                    "defaultDeleteEnabled": true,
                    "defaultUpdateEnabled": true
                }
            }
        },
        "ObjectPage|MaterialSet": {
            "entitySet": "MaterialSet",
            "component": {
                "name": "sap.suite.ui.generic.template.ObjectPage",
                "settings": {
                    "editableHeaderContent": true
                }
            }
        }
    }
}

  1. Configure the CDS View (if used):
    • If you are using a CDS view, ensure that you annotate the fields appropriately for editing using annotations like @UI.fieldGroup for forms and @UI.lineItem for table display.

Step 4: Deploy to SAP Fiori Launchpad

  1. Deploy the Fiori App to the ABAP Repository:

    • In SAP Web IDE or BAS, right-click on the project and select Deploy > Deploy to ABAP Repository.
    • Provide your SAP system details and select the package and transport request.
  2. Configure the Fiori Launchpad:

    • Access the Fiori Launchpad Designer using the T-code /UI2/FLPD_CUST.
    • Create a new Catalog and Group.
    • Define a new Tile for the app in the catalog.
    • Set up Target Mapping to link the tile to your deployed Fiori app by entering the Semantic Object and Action.
  3. Assign the Tile to a Role:

    • Use PFCG to create a new role or update an existing role.
    • Assign the catalog or tile to the user roles that will have access to the app.

Step 5: Assign Roles and Access in Fiori Launchpad

  1. Assign Roles to Users:
    • In PFCG, add the catalog or group to the role and assign the role to the relevant users.
    • Users assigned with the role will see the app tile in the Fiori Launchpad.

Step 6: Test and Use the App

  1. Test CRUD Operations:
    • Access the Fiori Launchpad as the user.
    • Click on the app tile and test the CRUD operations (Create, Update, Delete) for the SAP table.
    • Verify that you can maintain the SAP table's data directly from the Fiori UI.

By following these detailed steps, you will be able to create a Fiori app that allows users to maintain (Create, Update, Delete) data in an existing SAP table through the SAP Fiori Launchpad without using SE11 or SE80 directly.


Jun 10, 2018

Auto Update Fields in Table Maintenance Generator

Requirement:

In SM30 for table ZMMT_NIE, when there is an input, field username, current date, and time must be automatically filled. In order to do that, certain enhancement must be created.


Solution:
1. Check tab Delivery and Maintenance > Data browser/table view editing must be 'X' = 'Display Maintenance Allowed'.


2. Select Utilities > Table Maintenence Generator


This will take you to Maintenance screen.


3. Environment > Modification > Events


4. Create form routines:
  • ZBEFORE_SAVING. Type  '01' (will be called before saving)
  • ZNEW_ENTRY. Type '05' (Every new entry creation)

5. Click on the Editor button and you can create the routine to update the fields.


Result:



Related posts:

Jun 1, 2012

Transaction Code for Table Maintenance Generator

Transaction Code for Table Maintenance Generator

1. Call transaction 'SE93' (Create Transaction)



2. Input Transaction Name



3. Choose Radiobutton Transaction with Parameters



4. Fill up Transaction: SM30, Check 'Skip Initial Screen' and 'Inherit GUI Attributes'



5. Fill up Name of screen and value:
VIEWNAME and 'Table View Name'
UPDATE and 'X'



6. Save..




Ref: http://an-sap-consultant.blogspot.com/2010/12/abap-how-to-create-transaction-code-for.html