$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: false, vro: false, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content
0

Problem with generated oData service

Jan 28, 2017 at 01:35 PM

728

avatar image

Hi all,

I'm currently palying around with ABAP Programming Model for SAP Fiori. I particular I tried to follow the tutorial on how to build "Developing Transactional Apps from Scratch" (cf. https://help.sap.com/saphelp_nw75/helpdata/en/97/1e03cd952a47458e57f87fc566a8f3/content.htm): However, when running the generated Fiori app and trying to execute a search an error occurs:

The reason is the following error:

2017-01-28 14:11:31.957500 The following problem occurred: HTTP request failed500,Internal Server Error,{"error":{"code":"SY/530","message":{"lang":"en","value":"An exception was raised."},"innererror":{"application":{"component_id":"","service_namespace":"/SAP/","service_id":"ZCD_C_DEMO_SALESORDER_TX_CDS","service_version":"0001"},"transactionid":"485BE5E65227F14B80D200505684AC1C","timestamp":"20170128131131.8420000","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system (System Alias ) and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"},"errordetails":[{"code":"CX_SY_DYNAMIC_OSQL_SEMANTICS","message":"The parser produced the error: The database field or the result type of the aggregate function ZCD_C_DEMO_SALESORDER_TX~GROSSAMOUNT and the component \"GROSSAMOUNT\" of \"ET_DATA\" are not compatible.","propertyref":"","severity":"error","target":""},{"code":"/IWBEP/CX_MGW_TECH_EXCEPTION","message":"An exception was raised","propertyref":"","severity":"error","target":""}]}}}

I tried to investigate in some more detail. The error is raise in class CL_SADL_SQL_STATEMENT in line 1472. The root cause is the statement in line 1410

 SELECT (lv_select) FROM (lv_table)         "#EC CI_DYNTAB
                     WHERE (lv_where)                  "#EC CI_DYNWHERE
                     GROUP BY (lv_group_by)
                     ORDER BY (lv_order_by)
                     INTO CORRESPONDING FIELDS OF TABLE @et_data
                     UP TO @lv_limit ROWS
                     CONNECTION (lv_dbcon).

The select is performed from the consumption view. Here is the code of this view:

@AbapCatalog.sqlViewName: 'ZCD_C_SO'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Sales Order for transactional app'
                
@ObjectModel.semanticKey: 'SalesOrder'
                
@ObjectModel.transactionalProcessingDelegated: true
                
@ObjectModel.createEnabled: true
@ObjectModel.deleteEnabled: true
@ObjectModel.updateEnabled: true
              
@UI.headerInfo: { typeName: 'Sales Order', typeNamePlural: 'Sales Orders' }
                
@OData.publish: true          
define view Zcd_C_Demo_Salesorder_Tx                
        as select from ZCD_I_Demo_SalesOrder_TX as Document {
                
        @UI.lineItem.position: 10
        
        @UI.identification.position: 10
        @UI.lineItem: 
        [
            { type: #FOR_ACTION, position: 1, dataAction: 'BOPF:SET_TO_PAID', label: 'Set to Paid' }
        ]   
        key Document.SalesOrder,
                
        @UI.lineItem.position: 20                
        @UI.identification.position: 20
        Document.BusinessPartner,
                
        Document.CurrencyCode,
                
        @UI.lineItem.position: 50        
        @UI.identification.position: 50
        Document.GrossAmount,
                
        @UI.lineItem.position: 30
        @UI.selectionField.position: 30
        @UI.identification.position: 30
        Document.BillingStatus,
                
        @UI.lineItem.position: 40
        @UI.selectionField.position: 40
        @UI.identification.position: 40
        Document.OverallStatus,
                
        /* Exposing value via associations */ 
        @UI.lineItem:  { value: '.CompanyName', position: 15 }
        Document._BusinessPartner,
                
        Document._Currency,   
        Document._BillingStatus, 
        Document._OverallStatus                   
  }                        

For whatever reason the generate oData service expect a different data format as defined in the view. Furthermore, in the list view tutorial the same data type is used in the oData service for the gross amount. However, in this case no dump occurs.

Does anyone have an idea what the reason for this problem is or how to solve it?

Christian

ps.: I'm running this on NW 7.50 SP4

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Raed Abu Azab Mar 29, 2017 at 04:48 PM
1

Hello Christian,

Hope you doing well.

Looking through my german iphone to your question in the train i have just 1 idea: Maybe you have to Set the properties "Date-Time" as "nullable".(or you have to give them a value )

Hope it works for you.

Regards

Raed

Share
10 |10000 characters needed characters left characters exceeded
Ivo Vollrath
Mar 30, 2017 at 09:45 AM
0

Hi Christian,

My guess is that the type derived from the CDS view does not match the type on the DB.

Has there been any type-casting in the definition chain of GrossAmount from the consumption view down to the DB?

Kind Regards,

Ivo

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 31, 2017 at 07:12 AM
0

Hello All,

I am also facing the same issue.

I observed that it only happens after creating a new BOPF action. If we delete the created BOPF action and retry, it works fine.

When I tried to create the BOPF action using ADT (Eclipse), I got the error -

"A request to the ABAP back-end could not be processed, because your client installation of ABAP Development Tools is out of date".

However, when I clicked on "Update now" in ADT, there were no updates available.

So I created the BOPF action using BOBX transaction in the backend. And this is what is leading to the error due to mismatch of amount type. If I delete the action from BOBX and retry, it works fine.

Thanks,

Indrajit

Share
10 |10000 characters needed characters left characters exceeded