[go: up one dir, main page]

0% found this document useful (0 votes)
74 views50 pages

DBM Enhancement VehicleData

Uploaded by

Ganesh Sawnt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views50 pages

DBM Enhancement VehicleData

Uploaded by

Ganesh Sawnt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Dealer Business Management

Enhancing Vehicle Data Structures

Date: March 2006

Release: DBM 5.00


Vehicles @ Dealer Dealer Business Management: Enhancements

Table of Contents:

1 Introduction ....................................................................................................................4
1.1 Purpose of this Document .........................................................................................................................4

1.2 Prerequisites ...............................................................................................................................................4

1.3 Required Skills ............................................................................................................................................4

2 General Concept Overview............................................................................................4

3 Usage of Individual Objects in DBM .............................................................................5


3.1 Concept Overview.......................................................................................................................................5

3.2 Additional Information................................................................................................................................8

3.3 Limitations ...................................................................................................................................................8

4 Vehicle Data Enhancement Example ............................................................................9


4.1 Example Data.............................................................................................................................................10
4.1.1 Single-Line Extension ZSTH_TY_MAIN ................................................................................................10
4.1.1.1 Usage ..................................................................................................................................................10
4.1.1.2 Attributes .............................................................................................................................................10
4.1.2 Multi-line Extension ZSTH_TY_ITEM ....................................................................................................10
4.1.2.1 Usage ..................................................................................................................................................10
4.1.2.2 Attributes .............................................................................................................................................10

4.2 Implementation Steps...............................................................................................................................10


4.2.1 Attribute Creation ...................................................................................................................................10
4.2.2 Single-Line Extension Definition ZSTH_TY_MAIN ................................................................................15
4.2.3 Multi-Line Extension Definition ZSTH_TY_ITEM ...................................................................................18
4.2.4 Define Category ZSTH_VEHICLE .........................................................................................................21
4.2.5 Assign Number Range to the New Category .........................................................................................24
4.2.6 Enhance Individual Object API Structure ...............................................................................................27
4.2.6.1 Create Workbench Transport Request ...............................................................................................27
4.2.6.2 Create Customizing Transport Request..............................................................................................27
4.2.6.3 Create Package...................................................................................................................................28
4.2.6.4 API Enhancements and Object Transport ..........................................................................................28
4.2.7 Enhance «Internal» DBM Vehicle API Structures..................................................................................30
4.2.7.1 Enhancement for Single-Line Extension ZSTH_TY_MAIN.................................................................30
4.2.7.2 Enhancement for Multi-Line Extension ZSTH_TY_ITEM....................................................................31
4.2.8 Enhance «External» DBM Vehicle API Structures.................................................................................33
4.2.8.1 Enhancement for Single-Line Extension ZSTH_TY_MAIN.................................................................33
4.2.8.2 Enhancement for Multi-Line Extension ZSTH_TY_ITEM....................................................................34
4.2.9 Map External and Internal DBM Vehicle API Structures........................................................................35
4.2.10 Function Group Creation for Subscreen .........................................................................................38
4.2.11 Subscreen Creation ........................................................................................................................39

Page 2
Vehicles @ Dealer Dealer Business Management: Enhancements

4.3 Customizing Settings ...............................................................................................................................43


4.3.1 Define New View Node for /DBM/VM.....................................................................................................43
4.3.2 Define New User Interface Profile for /DBM/VM ....................................................................................45
4.3.3 Assign Subscreens to New User Profile ................................................................................................46
4.3.4 Assign Profile to Category......................................................................................................................47

4.4 Check Result .............................................................................................................................................49

Page 3
Vehicles @ Dealer Dealer Business Management: Enhancements

1 Introduction

1.1 Purpose of this Document


This document provides you with a description of the enhancement concept for vehicle data in DBM. It
provides an example of how you can include new screens and new fields in DBM vehicles by using the
concept of individual objects.

1.2 Prerequisites
• Vehicle process using standard SAP setup with standard SAP settings is up and running. This
includes the VMS action matrix for the standard vehicle processes and the categories and
extensions for standard vehicle data structures
• Authorization objects COM_ASET, COM_HIER and COM_PRD are assigned to your user
• Read the complete document before starting to implement enhancements

1.3 Required Skills


You require the following skills if you wish to implement enhancements in the DBM vehicle area successfully:
• Basic ABAP knowledge
• Ability to create ABAP screens using Screen Painter
• Knowledge of DBM Customizing

2 General Concept Overview


From a technical point of view, each DBM vehicle consists of two parts, a VMS vehicle and an individual
object. So for DBM vehicles, no new concept to model vehicles has been introduced. Instead two existing
concepts are used in parallel.

DBM Vehicle

VMS Individual
Vehicle Object

Page 4
Vehicles @ Dealer Dealer Business Management: Enhancements

The VMS vehicle was introduced with the Vehicle Management System which is part of the Automotive
industry solution. DBM reuses the VMS vehicle. The VMS vehicle in DBM is mainly used to provide flexibility
and enhancement possibilities regarding vehicle-related process design.
The individual object, which first was provided as part of SAP’s CRM solution, is used in DBM to provide a
flexible concept with regard to vehicle-related data design. Most of a vehicle’s data is stored in the individual
object part the DBM vehicle.
In order to introduce new fields, tables and screens to the DBM vehicle, it is important to understand the
concept of individual objects. In order to introduce new process steps in the vehicle are, it is important to
understand the VMS action concept.

3 Usage of Individual Objects in DBM

3.1 Concept Overview


The vehicle master transaction /DBM/VM provides a flexible framework into which subscreens can be
integrated to show the different attributes of a vehicle. On the left-hand side of the screen, you can select the
appropriate subscreen; this subscreen with its fields is then displayed on the right-hand.

Integrate
your own
screens Define your own fields

Country and brand-specific attributes are not provided in the SAP Standard. This means that there must be
the option of adding your own additional fields and tables to describe a DBM vehicle and creating additional
subscreens to display this data. You can reach this goal by using the individual object, which provides
flexible enhancement possibilities, for data storage.
The fields and tables contained in SAP’s standard DBM vehicle are also mainly stored in the individual object
part of the vehicle.
There are two different types of enhancements that you can use to store additional vehicle data:

Page 5
Vehicles @ Dealer Dealer Business Management: Enhancements

• If there is just one record of a data type per vehicle, a so called single-line extension is used. In the
SAP standard, this is the case for the model data subscreen (/DBM/SAPLVM07 0700) and the
vehicle data subscreen (/DBM/SAPLVM07 0800). These are the subscreens containing just fields.

Each field once per vehicle

• If there are several records of a certain data type needed per vehicle, a multi-line extension is used.
In the SAP standard, this is the case, for example, for the registrations subscreen (/DBM/SAPLVM07
0500), the warranty subscreen (/DBM/SAPLVM07 0400), and the keys subscreen (/DBM/SAPLVM07
0600). These are the subscreens that usually contain an ALV grid.

Page 6
Vehicles @ Dealer Dealer Business Management: Enhancements

Several records per vehicle

So, depending on the kind of data that you wish to integrate into DBM vehicles, you have to create either
single-line extensions or multi-line extensions.
You cannot change or enhance existing SAP individual object structures (single- and multi-line extensions).
Instead, you have to create new extensions.
The figure below shows how the different kinds of objects required to model vehicles using individual objects
are connected.

Page 7
Vehicles @ Dealer Dealer Business Management: Enhancements

Attribute 1

Attribute 2
Extension 1

Category 1 Attribute 3
Extension 2

Object Family 1 Attribute 4

Category 2 Extension 3
Attribute 5
...

Extension 4 Attribute 6

...
Attribute 7
Extension 5

Attribute 8

...
Attribute 9

...

3.2 Additional Information


This document does not contain all the important information on individual objects and their usage. Please
also refer to the following information sources:
• General SAP Library documentation on DBM
• Documentation on function group /DBM/VM01. You can access this function group as follows:
o Transaction SE80 in your development or test system
o Choose function group /DBM/VM01
o Choose /DBM/VM01 in the object name list
o In the dialog box, choose the function group documentation
Here you can find information on the main DBM vehicle function modules and on how individual
objects are used in DBM.

• General documentation on the individual objects concept can be found in SAP’s Knowledge
Warehouse (SAP Library) documentation at the following address: http://help.sap.com/ Æ
Documentation Æ SAP for Industries Æ SAP for Automotive Æ SAP ECC DIMP 5.0 Æ English.
Choose Search Documentation, SAP for Industries, Application: SAP for Discrete Industries,
Release: 5.0, Language: EN, enter the search term individual object, choose Search and then, in the
hit list, choose the first entry entitled Basic Data.
http://help.sap.com/saphelp_dimp50/helpdata/en/75/461e400191f72ee10000000a1550b0/frameset.
htm

3.3 Limitations
The DBM vehicle does not support the full functionality provided by individual objects. These are the known
restrictions:

Page 8
Vehicles @ Dealer Dealer Business Management: Enhancements

• No organization-dependent data
• No interlinkages
• No reference product
• No alternative IDs
• No real multiple-use set types (only single-line extensions and multi-line extensions)
• Only one category per iObject (but >1 category for one object family possible)
• When modelling individual objects, the system is able to generate most of the required coding and
DDIC objects. DBM does not provide this kind of generator. Additional manual steps are therefore
required to use individual objects in DBM vehicles.

4 Vehicle Data Enhancement Example


This chapter explains how you can add new fields and a new subscreen to the DBM vehicle using the
individual object concept.
The example includes the creation of a multi-line extension and a single-line extension.
As part of the example, a new subscreen for /DBM/VM is created that contains the fields of the single-line
extension as well as an ALV grid for the multi-line extension data.
So, unlike the SAP standard subscreens provided so far in DBM, single- and multi-line extension data are
both displayed on the same subscreen.
This is what the new subscreen looks like in /DBM/VM:

Page 9
Vehicles @ Dealer Dealer Business Management: Enhancements

4.1 Example Data


In this simple example, the data structures to store a vehicle’s tire information are created. A single-line
extension is created to store the information that is valid for all tires of a vehicle. A multi-line extension is
created to store data that differs for each of the individual tires of the vehicle.
This example is certainly too simple to enable real tire management processes. The purpose of this example
is merely to show the steps needed to enhance the DBM vehicle.

4.1.1 Single-Line Extension ZSTH_TY_MAIN


4.1.1.1 Usage
This extension is used to store tire information relevant for all the tires of the vehicle.
4.1.1.2 Attributes
• Manufacturer (for this attribute, a value range is defined)
• Model
• DOT tire identification number
• Size

4.1.2 Multi-line Extension ZSTH_TY_ITEM


4.1.2.1 Usage
This extension is used to store information for each individual tire of the vehicle.
4.1.2.2 Attributes
• Location
• Profile Depth

4.2 Implementation Steps


Only the straight forward process to implement the example is provided here. For background information,
please refer to the additional information sources mentioned earlier in this document.

4.2.1 Attribute Creation


You have to create an attribute for each of the new fields. This is the case for attributes to be used in single-
line extensions, as well as for attributes in multi-line extensions. An attribute can be used by more than one
extension.
Here are the steps to create attribute ZSTH_TY_MANUF (tire manufacturer):
• Transaction COMM_ATTRSET
• Enter attribute name ZSTH_TY_MANUF (manufacturer)

Page 10
Vehicles @ Dealer Dealer Business Management: Enhancements

• Choose Create
• Enter text in the required languages (DE: Reifenhersteller, EN: Tire Manufacturer)
• Chose the attribute type and length (CAHR 20)

Page 11
Vehicles @ Dealer Dealer Business Management: Enhancements

• Optional: enter possible values, for example:


CON … Continental
FLD … Fulda
GDY … Goodyear
PIR … Pirelli

Page 12
Vehicles @ Dealer Dealer Business Management: Enhancements

• Save the attribute (ZSTH_TY_MANUF)


Create the remaining attributes in the same way:
• ZSTH_TY_MODEL … tire model
• ZSTH_TY_DOT … DOT
• ZSTH_TY_SIZE … tire size
• ZSTH_TY_PROD … profile depth

Page 13
Vehicles @ Dealer Dealer Business Management: Enhancements

• ZSTH_TY_LOCA … location
For the attribute location, you should create the following possible values:
• VL (DE: vorne links / EN: front left)
• VR (DE: vorne rechts / EN front right)
• HL (DE: hinten links / EN: back left)
• HR (DE: hinten rechts / EN: back right)

Page 14
Vehicles @ Dealer Dealer Business Management: Enhancements

A data element and a domain is generated for each of the attributes. Value ranges result in domain fixed
values. Another way to define a value range is to assign a check table to the attribute.
You cannot reuse existing data elements or domains when you create attributes.

4.2.2 Single-Line Extension Definition ZSTH_TY_MAIN


• Transaction COMM_ATTRSET
• Enter the name of the extension in the Set Type field and choose Create

Page 15
Vehicles @ Dealer Dealer Business Management: Enhancements

• Steps on the Definition tab page:


o Choose the product type Material
o Enter text in the required languages
o Deactivate the Multiple Use flag
o Do not enter an object family

Page 16
Vehicles @ Dealer Dealer Business Management: Enhancements

• Assign attributes to the extension


o ZSTH_TY_MANUF
o ZSTH_TY_MODEL
o ZSTH_TY_SIZE
o ZSTH_TY_DOT
Make sure that no indicator is set for Field is Key and Configurable.

Page 17
Vehicles @ Dealer Dealer Business Management: Enhancements

• Save extension ZSTH_TY_MAIN. The system now generates most of the required coding and DDIC
objects.
• In SE11, two new database tables are generated: ZSTH_TY_MAIN and ZSTH_TY_MAINH.
• In SE80, two new function groups are generated: ZOM_ZSTH_TY_MAIN and
ZOM_ZSTH_TY_MAIN_UI. Both are currently in the user’s local objects.
Examples of SAP standard single-line extensions are DBM_V_IMODEL and DBM_V_IVEHICLE.

4.2.3 Multi-Line Extension Definition ZSTH_TY_ITEM


• Transaction COMM_ATTRSET
• Enter the name of the extension in the Set Type field and choose Create

Page 18
Vehicles @ Dealer Dealer Business Management: Enhancements

• Steps on the Definition tab page:


o Choose the product type Material
o Enter text in the required languages
o Remove the Multiple Use flag
o Do not enter an object family

Page 19
Vehicles @ Dealer Dealer Business Management: Enhancements

• Assign attributes and define the additional key field:


o ZSTH_TY_LOCA (set the Field is Key indicator for this attribute only)
o ZSTH_TY_PROD
Only if there’s an additional key field defined, multiple values can be maintained for the same
vehicle. Otherwise the extension is a single-line extension.
Make sure that no indicator is set for Configurable.

Page 20
Vehicles @ Dealer Dealer Business Management: Enhancements

• Save extension ZSTH_TY_ITEM. The system now generates most of the required coding and DDIC
objects.
• In SE11, two new database tables are generated: ZSTH_TY_ITEM and ZSTH_TY_ ITEM H.
• In SE80, two new function groups are generated: ZOM_ZSTH_TY_ ITEM and ZOM_ZSTH_TY_
ITEM _UI. Both are currently in the user’s local objects.
Examples of SAP standard multi-line extensions are DBM_V_IREGHIST and DBM_V_IKEYS.

4.2.4 Define Category ZSTH_VEHICLE


In order not to cause a negative impact the DBM standard example categories that already exist
(DBM_PASSENGERCAR, and so on), create a new category: ZSTH_VEHICLE.
• Transaction COMM_HIERARCHY
• Create category ZSTH_VEHICLE. This category should be created on the same level as, for
example, DBM_PASSENGERCAR within the existing hierarchy

Page 21
Vehicles @ Dealer Dealer Business Management: Enhancements

On the Category tab page, enter the required basic data:


o Product type is 01
o Object family is 0602 (unless you create your own object family)
o Set the Product/Object Assignment Possible indicator

Page 22
Vehicles @ Dealer Dealer Business Management: Enhancements

• On the SetTypes tab page, assign the standard SAP vehicle extensions as well as the two new
extensions to the category. When creating vehicles of category ZSTH_VEHICLE, data can be written
into the existing extensions as well as into the two new ones.
These are the extensions used in this example:
o SAP standard extensions
o DBM_V_IKEYS
o DBM_V_IMODEL
o DBM_V_IMODELT
o DBM_V_IOPTION
o DBM_V_IOPTIONT
o DBM_V_IPARTNER
o DBM_V_IREGHIST
o DBM_V_ISINT
o DBM_V_IVEHICLE
o DBM_V_IWTY
o Extensions specific to this example
o ZSTH_TY_ITEM
o ZSTH_TY_MAIN

Page 23
Vehicles @ Dealer Dealer Business Management: Enhancements

The View ID and Position column on the SetTypes tab page of transaction COMM_HIERARCHY are
not relevant.

4.2.5 Assign Number Range to the New Category


• Transaction SPRO --> Cross-Application Components --> SAP Product --> Settings for Product Type
--> Number Assignment --> Define Number Ranges for Materials

Page 24
Vehicles @ Dealer Dealer Business Management: Enhancements

• Choose the function for maintaining groups (F6)


• It is assumed that for the existing SAP standard example, categories have already been assigned to
a number range. Assign the new category to the existing group for vehicles:
o Choose the non-assigned category ZSTH_VEHICLE
o Choose Select Element (F2)
o Select the group to which the category should be assigned

Page 25
Vehicles @ Dealer Dealer Business Management: Enhancements

o Choose Element/Group (F5)


• Save

Page 26
Vehicles @ Dealer Dealer Business Management: Enhancements

4.2.6 Enhance Individual Object API Structure


4.2.6.1 Create Workbench Transport Request
• Enter transaction code SE09
• Choose Create (F6)
• In the diaog box, select Workbench request

• Enter a short text to describe the transport request


• Make a note of the transport request number as you will need to provide it later
4.2.6.2 Create Customizing Transport Request
• Enter transaction code SE09
• Chose Create (F6)

Page 27
Vehicles @ Dealer Dealer Business Management: Enhancements

• Select Customizing request

• Enter a short text desribing the transport request


• Make a note of the transport request number as you will need to provide it later
4.2.6.3 Create Package
• Enter transaction code SE80
• Create package “ZSTH_VEHICLE_ENHANCE_TEST_1”, for example, in the software component
HOME

• Make a note of the package name as you will need to provide it later
4.2.6.4 API Enhancements and Object Transport
• Transaction COMM_ATTRSET
• Menu: SetTypes/Attributes Æ Transport Æ Set Types
• Enter the names of your extensions (ZSTH_TY_MAIN, ZSTH_TYRE_ITEM) and set the indicator for
creating the API append.

Page 28
Vehicles @ Dealer Dealer Business Management: Enhancements

• Choose Include in transport request


• Select package ZSTH_VEHICLE_ENHANCE_TEST_1

• Select your transport requests. Check if a customizing request or a workbench request is asked for.
Here is an example for a workbench request.

• Several similar dialog boxes that require similar values to be entered are displayed.
• If it is not possible to enhance the API structure automatically using the procedure described above,
you can do it manually. Note: this approach cannot be used if the enhancements are to be
transported to another system. It is only an option if the enhancement is used exclusively in the
system you work in (for example, for testing reasons).
• Check structure COMT_PROD_MAT_MAINTAIN_API to make sure that the required API structure
enhancements have been generated. For each of the two extensions, an append structure is added
to COMT_PROD_MAT_MAINTAIN_API.

• In transaction SE09, you can see that a lot of objects have been added to the transport requests.

Page 29
Vehicles @ Dealer Dealer Business Management: Enhancements

4.2.7 Enhance «Internal» DBM Vehicle API Structures


The steps described so far have been performed using generic individual object functionality. As a result,
individual objects are ready to be used for this example. What is still missing are the steps needed to use our
example within DBM.
In this context, the term “internal” API structures refers to the structures used by function modules of function
group /DBM/VM02.
4.2.7.1 Enhancement for Single-Line Extension ZSTH_TY_MAIN
• Structure /DBM/IOBJ_DATA_SINGLE_TXT_S is the internal structure to be enhanced.

• Create append ZSTH_TY_MAIN_TXT. It only contains component ZSTH_TY_MAIN of type


ZSTH_TY_MAIN_DYNP_SV. Structure ZSTH_TY_MAIN_DYNP_SV was automatically generated
during extension generation.
• Save and activate the append structure.

Page 30
Vehicles @ Dealer Dealer Business Management: Enhancements

4.2.7.2 Enhancement for Multi-Line Extension ZSTH_TY_ITEM


Structure /DBM/IOBJ_DATA_MULTI_TXT_S is the internal structure to be enhanced.
4.2.7.2.1 Table type creation
A table type that is required within the vehicle API structures is not generated automatically. You therefore
have to create it manually.

• Enter transaction code SE11

• Enter the name of the table type (ZSTH_TY_ITEM_TXT_TAB) in the field Data type and choose
Create. Select Table type in the dialog box.

• Table type ZSTH_TY_ITEM_TXT_TAB has to be created of type ZSTH_TY_ITEM_DYNP_SV.


Structure ZSTH_TY_ITEM_DYNP_SV was automatically created during extension generation.

Page 31
Vehicles @ Dealer Dealer Business Management: Enhancements

• Save and activate the table type.


4.2.7.2.2 Structure Enhancement
• Structure /DBM/IOBJ_DATA_MULTI_TXT_S can be enhanced using table type
ZSTH_TY_ITEM_TXT_TAB.
• Create append ZSTH_TY_ITEM_TXT with component ZSTH_TY_ITEM of type
ZSTH_TY_ITEM_TXT_TAB.

• Save and activate the append structure.

Page 32
Vehicles @ Dealer Dealer Business Management: Enhancements

4.2.8 Enhance «External» DBM Vehicle API Structures


In this context, the term “external” API structures refers to the structures used by function modules of
function group /DBM/VM01.
If no special kind of conversion, data enhancement, or so on is required in the methods of BAdI
/DBM/VEHICLE_API, the same structures can be used here as well. If you want to use different structures
from the individual object’s extension structures “externally”, you can use your own structures in the
“external” API interface of function group /DBM/VM01.
In this example, this is not the case. So the same kind of structures are re-used.
An example in SAP standard where the “internal” and the “external” structures do not look the same is the
service intervals multi-line extension. The “external” structure contains, for example, an additional field for an
icon to be displayed on the UI which is set in BAdI /DBM/VEHICLE_API but does not exist in the database
structure of the multi-line extension.
4.2.8.1 Enhancement for Single-Line Extension ZSTH_TY_MAIN
• Structure /DBM/IOBJ_DATA_SINGLE_COM_S needs to be enhanced.
• Create append ZSTH_TY_MAIN_COM with component ZSTH_TY_MAIN of type ZSTH_TY_
MAIN_DYNP_SV.

Page 33
Vehicles @ Dealer Dealer Business Management: Enhancements

• Save and activate the append.

4.2.8.2 Enhancement for Multi-Line Extension ZSTH_TY_ITEM


• Structure /DBM/IOBJ_DATA_MULTI_COM_S needs to be enhanced.
• Create append ZSTH_TY_ITEM_COM with component ZSTH_TY_ITEM of type
ZSTH_TY_ITEM_TXT_TAB.

Page 34
Vehicles @ Dealer Dealer Business Management: Enhancements

• Save and activate the append.

4.2.9 Map External and Internal DBM Vehicle API Structures

• This mapping is done in methods of BAdI /DBM/VEHICLE_API. Please first read the documentation
for BAdI /DBM/VEHICLE_API before implementing it.
• Note: this BAdI has a fairly large default implementation. When you create an implementation on
your own, you should make sure that you process the default code as well, since you probably do
not want to replace it completely. In this example, it will not be replaced at all, as only additional data
is handled. The handling of the existing extension has not changed. It is therefore recommended that
you copy the default implementation coding into your BAdI implementation.

Page 35
Vehicles @ Dealer Dealer Business Management: Enhancements

• Enter transaction code SE19 and create an implementation of BAdI /DBM/VEHICLE_API.

• Assign the implementation to package ZSTH_VEHICLE_ENHANCE_TEST_1.


• Copy the default coding of all three methods into the methods of your implementation.
In order to access the default implementation, enter transaction code SE18, BAdI
/DBM/VEHICLE_API. In the transaction menu, choose GoTo Æ Default Code Æ Display.
• Add this coding to the SET method:
* ADDITIONAL CODING:

* Map multi-line extension ZSTH_TY_ITEM


cs_iobj_data_multi-zsth_ty_item[] =

Page 36
Vehicles @ Dealer Dealer Business Management: Enhancements

is_iobj_data_multi_com-zsth_ty_item[].

* Map single-line extension ZSTH_TY_MAIN


MOVE-CORRESPONDING is_iobj_data_single_com-zsth_ty_main
TO cs_iobj_data_single-zsth_ty_main.

This coding writes data contained in the external structure into the corresponding internal structure.
As the structures in this example are similar, the coding is simple.
• In this BAdI, additional functionality can of course be added as well. In this example, a few lines of
code are added that automatically add records to the multi-line extension for tires:
DATA: ls_tyre type ZSTH_TY_ITEM_DYNP_SV.
* Only for the test category ZSTH_VEHICLE, default
* values are added
IF ( cv_iobj_catid = 'ZSTH_VEHICLE' )
AND ( cs_iobj_data_multi-zsth_ty_item[] IS INITIAL ).
* Add four default records if the table is still empty
ls_tyre-zzk0010 = 'VL'.
APPEND ls_tyre TO cs_iobj_data_multi-zsth_ty_item[].
ls_tyre-zzk0010 = 'VR'.
APPEND ls_tyre TO cs_iobj_data_multi-zsth_ty_item[].
ls_tyre-zzk0010 = 'HL'.
APPEND ls_tyre TO cs_iobj_data_multi-zsth_ty_item[].
ls_tyre-zzk0010 = 'HR'.
APPEND ls_tyre TO cs_iobj_data_multi-zsth_ty_item[].
ENDIF.

• Add this coding to the GET method:


* ADDITIONAL CODING:

* Map multi-line extension ZSTH_TY_ITEM


cs_iobj_data_multi_com-zsth_ty_item[] =
cs_iobj_data_multi-zsth_ty_item[].

* Map single-line extension ZSTH_TY_MAIN


MOVE-CORRESPONDING cs_iobj_data_single-zsth_ty_main
TO cs_iobj_data_single_com-zsth_ty_main.
This coding writes data contained in the internal structures into the corresponding external structures
when vehicle data is read.
• This example does not require additional coding in the SAVE method.
• In order to make sure that the implementation coing is processed instead of the default coding, the
implementation needs to be activated (Ctrl + F3).

Page 37
Vehicles @ Dealer Dealer Business Management: Enhancements

At this point, the enhancements of the DBM vehicle API layer (function modules of function group
/DBM/VM01) are completed. The creation of the screen and the Customizing setup is still missing.

4.2.10 Function Group Creation for Subscreen


• Enter transaction code SE80
• Create function group ZSTH_VEHICLE_ENHANCE within the existing package
ZSTH_VEHICLE_ENHANCE_TEST_1. It will then be used for the subscreen which is integrated into
/DBM/VM (vehicle master).

• Some includes can be re-used to simplify the enhancement process. These need to be added to the
TOP include (LZSTH_VEHICLE_ENHANCETOP) of the function group. The following coding should
therefore be added to LZSTH_VEHICLE_ENHANCETOP:
*Constants definition
INCLUDE: /dbm/lvm08con.
*Init constants
INCLUDE: /dbm/lvm01ini.
*Type definition

Page 38
Vehicles @ Dealer Dealer Business Management: Enhancements

INCLUDE: /dbm/lvm08typ.
*Communication variables
INCLUDE: /dbm/lvm08var.
*Class definition/implementation for additional data table view
INCLUDE /dbm/lvm08cl1.
*Class definition/implementation for multi Iobject table
control
INCLUDE /dbm/lvm08cl2.
*Communication pbo/pai
INCLUDE /dbm/lvm08com.

4.2.11 Subscreen Creation

• Create a subscreen (0100) for your data within function group ZSTH_VEHICLE_ENHANCE. The
easiest way to do this is to copy an existing screen from function group /DBM/VM07, which contains
SAP’s standard screens for /DBM/VM.

Page 39
Vehicles @ Dealer Dealer Business Management: Enhancements

• A good example of multi-line extension screen is subscreen 0600 (keys). A good example for single-
line extensions is screen 0800 (general vehicle data).
• The PBO of the subscreens process flow should look like this:

PROCESS BEFORE OUTPUT.

*======================================

* Register the IObject multi control on the screen (new module)


MODULE m_iobj_multi_register_tyres.

* Get data from buffer to fill the fields of the subscreen


MODULE m_prepare_data.

* Find out which buttons / fields / ... should be visible


MODULE m_determine_layout.

* Show the IObject multi table control


MODULE m_iobj_multi_show.

* Set all required fields as mandatory on the screen


MODULE m_determine_obligatory_fields.

*======================================

• The PBO of the subscreens process flow should look like this:

PROCESS AFTER INPUT.

* Find out if all mandatory entry fields have been filled by the user
MODULE m_check_entry_fields_filled.

* Set data from IObject multi control to the global structure


MODULE m_iobj_multi_set.

* Fill data back to the buffer using the data entered on the subscreen
MODULE m_transfer_data.

* User command
MODULE m_user_command.

*======================================
• If the subscreen is copied, the name of the first PBO module needs to be changed to
m_iobj_multi_register_tyres. The remaining PBO / PAI coding should already be correct.
• Make sure that “m_iobj_multi_register_tyres” is called prior to “m_prepare_data”.
• Module “m_iobj_multi_register_tyres” is the only one that does not exist yet, so you have to create it.
(Simply double-click on the name of the module in PBO).

Page 40
Vehicles @ Dealer Dealer Business Management: Enhancements

• The coding should look like this:


*----------------------------------------------------------------------*
***INCLUDE LZSTH_VEHICLE_ENHANCEO01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module m_iobj_multi_register_tyres OUTPUT
*&---------------------------------------------------------------------*
* Used for the ALV of the multi-line extension ZSTH_TY_ITEM
*----------------------------------------------------------------------*
MODULE m_iobj_multi_register_tyres OUTPUT.

* Name of the control used on the screen: IOBJ_MULTI_ZSTH_TY_ITEM


* Name of the extension's UI structure: ZSTH_TY_ITEM_DYNP_SV
PERFORM f_iobj_multi_register USING 'IOBJ_MULTI_ZSTH_TY_ITEM'
'ZSTH_TY_ITEM_DYNP_SV'.

* Register the multi-line extension for generic text


* reading functionality of individual objects
* Name of the settype / extension used: ZSTH_TY_ITEM
PERFORM f_register_settypes USING 'ZSTH_TY_ITEM'.
ENDMODULE. " m_iobj_multi_register_tyres OUTPUT

The purpose of form “f_register_settypes” is to activate the individual object’s generic text reading
functionality for the extension provided to the form only. Without this form being called, the
descriptive texts for values “HL”, “VR”, etc. wouldn’t be displayed in the ALV. This functionality
requires notes 932953 and 931126. See these notes for further details. Generic text reading for ind.
objects isn’t needed for single-line extensions.

Page 41
Vehicles @ Dealer Dealer Business Management: Enhancements

• Screen Layout:
o On the layout of the screen, you need to provide a custom control called
IOBJ_MULTI_ZSTH_TY_ITEM. It contains the ALV grid for the multi-line extension. The
name of the custom control has to be the same as in module m_iobj_multi_register_tyres.
If subscreen 0100 was copied from /DBM/VM07 0600, the custom control is already
available and simply has to be renamed.
o You have to manually add the fields from single-line extension ZSTH_TY_MAIN to the
screen. You can use the Screen Painter to do this. The screens element list should contain
fields ZSTH_TY_MAIN-ZZ0010, ZSTH_TY_MAIN-ZZ0011, ZSTH_TY_MAIN-ZZ0012, and
ZSTH_TY_MAIN-ZZ0013 for the fields of single-line extension ZSTH_TY_MAIN.

In the Screen Painter, the subscreen should look remotely like this now:

Page 42
Vehicles @ Dealer Dealer Business Management: Enhancements

The screen is now complete. You have to maintain some Customizing settings before the screen can be
used by transaction /DBM/VM.

4.3 Customizing Settings

4.3.1 Define New View Node for /DBM/VM

• In Customizing for Dealer Business Management (DBM) Æ Vehicle Æ Navigation in Vehicle Master
Æ Define Nodes for Vehicle Master Navigation Tree

Page 43
Vehicles @ Dealer Dealer Business Management: Enhancements

• Create an entry for the tire screen. In this example, the node is called TYRE and the text is Tires.
The text maintained here is the one later on visible on the left side of /DBM/VM for subscreen
selection.

Page 44
Vehicles @ Dealer Dealer Business Management: Enhancements

4.3.2 Define New User Interface Profile for /DBM/VM

• In Customizing for DBM Æ Vehicle Æ Navigation in Vehicle Master Æ Define Navigation Profile

Page 45
Vehicles @ Dealer Dealer Business Management: Enhancements

• A new navigation profile is defined. The technical name is ZSTH_ENH, the description is Vehicle
Enhancement

4.3.3 Assign Subscreens to New User Profile

• In Customizing for Dealer Business Management (DBM) Æ Vehicle Æ Navigation in Vehicle Master
Æ Define Technical Settings for Naviation Tree
• Create entries for all the nodes which should be part of the new profile.
o In order to be able to re-use the SAP standard subscreens within your profile, you need to
create records like this:
ƒ Vehicle master navigation profile: ZSTH_ENH
ƒ Node: VM* (compare with standard profile)
ƒ Sequence: (compare with standard profile)

Page 46
Vehicles @ Dealer Dealer Business Management: Enhancements

ƒ Screen program name: /DBM/SAPLVM07 (compare with standard profile)


ƒ Screen number: (compare with standard profile)
ƒ Active flag: X
o The entries for the new tire screen are as follows:
ƒ Vehicle master navigation profile: ZSTH_ENH
ƒ Node: TYRE
ƒ Sequence: any free number
ƒ Screen program name: program name of ZSTH_VEHICLE_ENHANCE
ƒ Screen number: 0100
ƒ Active flag: X

• Now a new profile has been defined and the screens have been attached to the profile. We now
have to make sure that the new profile is used by the application.

4.3.4 Assign Profile to Category

• The new profile ZSTH_ENH should be used for category ZSTH_VEHICLE.


• In Customizing for Dealer Business Management (DBM) Æ Vehicle Æ Navigation in Vehicle Master
Æ Navigation Profile Determination Æ Assign Navigation Profile

Page 47
Vehicles @ Dealer Dealer Business Management: Enhancements

• Create an entry in condition table /DBM/VEHPRO_CTL2 that assigns category ID ZSTH_VEHICLE


to profile ZSTH_ENH.

Page 48
Vehicles @ Dealer Dealer Business Management: Enhancements

4.4 Check Result


• Customizing is now complete.
• Start transaction /DBM/VM to create a new vehicle.
• Fill the initial screen and select category ZSTH_VEHICLE.
• After you have chosen the return key, the text for the tire subscreen is in the list of subscreens the
user can select on the left-hand side.
• When selecting the subscreen, users can maintain tire data for the vehicle they are working on.

Page 49
Vehicles @ Dealer Dealer Business Management: Enhancements

Page 50

You might also like