Fiori Element- CDS View with BOPF CRUD(3)

light111Displaying Status Text from the Domain Fixed Value Text


This post is a continuation of the fiori element app described in the post  Fiori Elemnet- CDS View with BOPF CRUD(2) and   Fiori Element- CDS View with BOPF CRUD.

So far we display the order header status as the domain value which is 1 character but for the end user it’s not that meaningful but here we will try to show the relevant domain value text in stead of  domain fixed value. Let’s start-

The Domain fixed value and the language dependent text are stored in DD07L and DD07T tables. We can build a CDS view on these two tables and do the join.

But certainly we already have a database  view DD07V is already available that joins these two tables. So now we have just create a CDS view on the data base view DD07V.

Let’s have a look at the database view(in SE11)-

123

Display the content for the domain-

4

Now i have maintained DE- language for the domain values also.

5

Create below CDS view on the data base view-

6

Data Preview-  But we need to get only lang dependent texts.

7

Add the lang join condition.

8

CDS View Data Preview- 

9

Let’s open our list Report CDS view and make association to the above status text cds view and also expose the fields in the list cds view as shown below.

1011


@AbapCatalog.sqlViewName: ‘ZZ_L_ORDER_HDR’
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: ‘Oder’

@ObjectModel:{
semanticKey: [‘guid’],
transactionalProcessingDelegated: true,
// enable crud
createEnabled: true,
updateEnabled: true,
deleteEnabled: true
}

@UI.headerInfo: {typeName: ‘Order’, typeNamePlural: ‘Orders’, title: {value: ‘id’}}

@OData.publish: true

define view ZZ_ORDER_HDR_LIST
as select from ZZ_ORDER_HDR_TRANS
association [1..1] to ZZ_ORDER_STATUS as _Status on $projection.status = _Status.domvalue_l
{

@UI: {
lineItem: [{ type: #FOR_ACTION, position: 1,
dataAction: ‘BOPF:SET_STATUS_COMPLETE’,
label: ‘Set Complete’ }],
identification: [{type: #FOR_ACTION,
position: 1,
dataAction: ‘BOPF:SET_STATUS_COMPLETE’,
label: ‘Set Complete’ }]
}
//ZZ_ORDER_HDR_TRANS
@UI.hidden: true
key guid,

@UI: {
lineItem: [{ position: 10}],
identification: [{position: 10}],
fieldGroup: [{qualifier: ‘Basic’}]
}
@ObjectModel.mandatory: true
id,

@UI: {
lineItem: [{ position: 20}],
identification: [{position: 20}],
fieldGroup: [{qualifier: ‘Basic’}]
}
order_date,

@UI: {
lineItem: [{ position: 30}],
identification: [{position: 30}],
fieldGroup: [{qualifier: ‘Price’}]
}
@Semantics.amount.currencyCode: ‘Currency’
@Consumption.filter.hidden: true
price,

/
@Consumption.filter.hidden: true
/
currency,

@UI: {
lineItem: [{ position: 50}],
identification: [{position: 50}],
fieldGroup: [{qualifier: ‘Status’}]
}
@ObjectModel.readOnly: true
@ObjectModel.text.element: [‘status_text’]
@UI.textArrangement: #TEXT_ONLY
status,

@ObjectModel.readOnly: true
@UI.hidden: true
_Status.ddtext as status_text,

//Association
_Status
}


Run the app-[BY default Chrome lang-EN ]

Now we see the domain fixed value text appears instead of the domain fixed values.

12

Object Page-

13

Change the browser language to DE and run the app again.

14

Now the domain fixed value text appears in its relevant lang dependent texts. 

15


 

2 comments

  1. This series blogs are really helpful, thank you! I have read somewhere that we can call standard function moduls inside bopf action classes and post transactional documents in sap, but not sure about exact process, it would be very very helpful if you could post one blog on the same topic.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s