Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
patrick_winkler
Product and Topic Expert
Product and Topic Expert
756

Introduction

If you use the ADT wizard to generate a business configuration maintenance object, the transport selection bar for SAP Fiori elements is enabled by default as of release 2408.Transport Selection BarTransport Selection Bar

 Compared to the previous transport selection mode, there are three advantages:

  • The transport request selection action is only displayed in edit mode.
  • The transport request information is displayed in the header toolbar.
  • If the save action is executed without a selected transport request and the transport request is mandatory, the action to select a transport request is triggered automatically. After selecting a transport, the save action continues.

This blog shows you how to migrate an existing maintenance object to the new transport selection mode. If you prefer the previous transport selection mode, you can simply deselect the option "Enable Transport Selection Strip" in the wizard when generating a new maintenance object.

This blog is relevant for

Further reading:

Migration steps in ADT

Enable transport selection strip for the maintenance object

Set the option “Show Transport Selection Strip” to “Yes”.Show Transport Selection Strip flagShow Transport Selection Strip flag

Remove action button "Select Transport"

In the metadata extension object of the singleton entity, remove the #FOR_ACTION annotation object from the TransportRequestID field.

 

  @ui.identification: [ {
    position: 2 , 
    importance: #HIGH
  }
  // , 
  // {
  //  type: #FOR_ACTION, 
  //  dataAction: 'SelectCustomizingTransptReq', 
  //  label: 'Select Transport'
  // } 
  ]
  TransportRequestID;

 

Adapt the "SelectCustomizingTransptReq" Implementation

In the behavior implementation class, modify the MODIFY ENTITIES statement in the SelectCustomizingTransptReq method. Remove both usages of the field "HideTransport".

 

MODIFY ENTITIES OF ZI_Cubco1_S IN LOCAL MODE
      ENTITY Cubco1All
        UPDATE FIELDS ( TransportRequestID 
                        " HideTransport 
                      )
        WITH VALUE #( FOR key IN keys
                        ( %TKY               = key-%TKY
                          TransportRequestID = key-%PARAM-transportrequestid
                         " HideTransport      = abap_false 
                         ) ).

 

Define mandatory status for the TransportRequestID field

In the singleton entity, annotate the field TransportRequestID with "features : instance" and, if necessary, remove the annotation "readonly".

 

field ( features : instance )
   TransportRequestID;

 

In the implementation of method GET_INSTANCE_FEATURES of the singleton entity, add the following to the result statement:

 

%field-transportrequestid = COND #( WHEN lhc_rap_tdat_cts=>get( )->is_transport_mandatory( ) = abap_false THEN if_abap_behv=>fc-f-unrestricted ELSE if_abap_behv=>fc-f-mandatory ).

 

If the method IS_TRANSPORT_MANDATORY is not available because you do not use a transport object, use the following source code instead. Prior to release 2402, the ADT wizard did not generate a transport object by default.

 

%field-transportrequestid = if_abap_behv=>fc-f-mandatory.

 

Add transport request description

Add association to I_ABAPTransportRequestText in the CDS definition of the entity where the Transport Request field is defined:

association [0..*] to I_ABAPTransportRequestText as _ABAPTransportRequestText on $projection.TransportRequestID = _ABAPTransportRequestText.TransportRequestID

If you have a projection layer, use the following annotation for the Transport Request field in the projection CDS view:

@ObjectModel.text.element: [ 'TransportRequestDescription' ]
TransportRequestID,
@UI.hidden: true
_ABAPTransportRequestText.TransportRequestDescription : localized,

 If you don't have a projection layer, use the following annotation for the Transport Request field in the CDS view:

@ObjectModel.text.association: '_ABAPTransportRequestText'
cast( '' as sxco_transport) as TransportRequestID,

 

5 Comments