on ‎2024 Sep 04 6:08 PM
Hi,
from yesterday I have a problem during ChangeSet offline call.
The app return this error: "Error: Attempt to get length of null array"
In the Mobile Client Log Upload i have this:
commit change set error Params: {"serviceUrl":"https://xxxxxxxxxx.hana.ondemand.com/s4-backend-odata/sap/opu/odata/sap/ZSERVICE","offlineEnabled":true} Error: Attempt to get length of null array
The previous week I can call ChangeSet without problem.
I checked every change I made and all seems ok. I do not understand what's the problem.
I checked all the rules and actions and all seems ok.
I checked also all the arrays in the rules with some alerts and all of them has correct length.
The error seems to come from the Framework.
Someone experienced the same issue ? Any idea ?
ChangeSet action code:
Thank you,
Angelo.
Request clarification before answering.
When an entity like your Item entity
<EntityType Name="Item" m:HasStream="true" sap:content-version="1">
is defined as HasStream true this indicates that is is a media entity. Media entities must have media in order to create a record in the entity set. The properties are actually secondary to the storage of the media.
In order to create a record in a Media entity set you use CreateMedia instead of CreateEntity which is consistent with your update.
If not every Item will have media you might want to redesign your service to leave the Item entity set without the HasStream true and create a linked ItemAttachment entity set as a media entity to store the attachment when needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update:
after the deactivation of Media property(in SEGW) in the Entity Item I'm able to use CreateEntity action.
Seems like that when an Entity is configured to transfer a Stream you cannot use CreateEntity but you can only use a createMedia.
I do not know if this is a standard OData behavior but it seems to be the case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Item actually do not have any link to Head.
<EntityType Name="Item" m:HasStream="true" sap:content-version="1"> <Key> <PropertyRef Name="OrderS"/> <PropertyRef Name="Posnr"/> </Key> <Property Name="Discount" Type="Edm.Decimal" Nullable="false" Precision="3" Scale="1" sap:unicode="false" sap:label="Cliente" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="OrderS" Type="Edm.String" Nullable="false" MaxLength="10" sap:unicode="false" sap:label="Doc. commerc." sap:creatable="false" sap:updatable="false" sap:sortable="false"/> <Property Name="Posnr" Type="Edm.String" Nullable="false" MaxLength="6" sap:unicode="false" sap:label="Posizione" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="Matnr" Type="Edm.String" Nullable="false" MaxLength="40" sap:unicode="false" sap:label="Materiale" sap:creatable="false" sap:updatable="false" sap:sortable="false"/> <Property Name="EAN" Type="Edm.String" Nullable="false" MaxLength="18" sap:unicode="false" sap:label="Cd. EAN/UPC" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="CustMaterial" Type="Edm.String" Nullable="false" MaxLength="35" sap:unicode="false" sap:label="Mat. cliente" sap:creatable="false" sap:updatable="false" sap:sortable="false"/> <Property Name="ShipTo" Type="Edm.String" Nullable="false" MaxLength="10" sap:unicode="false" sap:label="Cliente" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="Qty" Type="Edm.Decimal" Nullable="false" Precision="13" Scale="13" sap:unicode="false" sap:unit="UM" sap:label="Qtà prevista" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="UM" Type="Edm.String" Nullable="false" MaxLength="3" sap:unicode="false" sap:label="Unità mis. base" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" sap:semantics="unit-of-measure"/> <Property Name="DataCons" Type="Edm.DateTime" Precision="0" sap:unicode="false" sap:label="Data" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="Tester" Type="Edm.String" Nullable="false" MaxLength="1" sap:unicode="false" sap:label="Casella di spunta" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="Value" Type="Edm.String" Nullable="false" MaxLength="500" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="Url" Type="Edm.String" Nullable="false" MaxLength="500" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="Storage" Type="Edm.String" Nullable="false" MaxLength="4" sap:unicode="false" sap:label="Magazzino" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="TypePos" Type="Edm.String" Nullable="false" MaxLength="4" sap:unicode="false" sap:label="Cat. pos." sap:creatable="false" sap:updatable="false" sap:sortable="false"/> <Property Name="Plant" Type="Edm.String" Nullable="false" MaxLength="4" sap:unicode="false" sap:label="Divisione" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="DescriptionMat" Type="Edm.String" Nullable="false" MaxLength="40" sap:unicode="false" sap:label="Descrizione" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> </EntityType>
<EntitySet Name="ItemSet" EntityType="ZXXXXXSRV.Item" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:addressable="false" sap:content-version="1"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Without the full app it is hard to guess what might be the issue. If it was working previously I would also check the offline store to make sure it is initialized correctly. Could something have changed on the backend?
Are you doing any reads in before create/update?
You mentioned checking all your array references which would be my next suggestion as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
after some research I found some clues.
Premise:
I tried to switch the service completely Online and the error changed in:
"Error: Stream link for createMedia call in change set is missing inline data for entity type: Item"
In the ChangeSet call I do not have any createMedia request but I have sequentially this calls:
Based on Error message, why I need to set a createMedia call for Item Entity if I do not need to send a stream ?
The purpose of Stream in Item Entity is a separate functionality that manage an Excel file but, in the ChangeSet call I need only to send normal data to backend for Sales Order creation.
The problem seems linked to the Item creation.
This is the rule:
What am I missing ?
Thank you,
Angelo.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.