on 2022 Mar 11 12:26 AM
Hi All,
I have just tried to build an app using ABAPRestfull programming concept, I have managed to make the app work fine until now, but I have question related to like I mentioned in the title of this question.
I have tried to put code like:
managed; // implementation in class zbp_tj_i_xxx unique;
define behavior for ZTJ_I_xxx //alias <alias_name>
persistent table ztjt_xxx
lock master
//authorization master ( instance )
//etag master <field_name>
{
mapping for ztjt_xxx corresponding;
// mandatory fields that are required to create data
field ( mandatory : create, readonly : update ) team; //=> this does not work during creation
create; update; delete;
}
So the issue is, during creation of new data, the field are in readonly mode which I do not expect to happen, but during updating of existing data, the the fields are in readonly mode which I expect to happen.
If I code like this:
field ( mandatory : create ) team;
The field is editable during creation of new data which I expected.
But this also happend during updating of existing data, this field is editable which I dont want to happen.
I hope anybody can help me with this issue.
Thanks
TJ
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for late reply.
From my understanding it should work also. But not sure why it is not happening.
I will try again later, and will post it here if I can manage to make it work, and explain the reason too.
Hi Andre, can you use the option in the unmanaged application. when i am trying in the unmanaged app expected behaviour is not working. can you please let me know how we can achieve this in unmanaged app.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Managed to work it done by using this statement:
field ( feature : instant ) fieldname...
and also I need to create logic to control when that field should enabled / disabled
Thanks
TJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
managed;
with draft;
define behavior for ZI_Test_JONA alias Jonathan
implementation in class ZBP_I_Test_JONA unique
persistent table zrap_inven_jona
draft table ztestha00d_jona
etag master LastChangedAt
lock master total etag LastChangedAt
authorization master ( global )
{
field ( mandatory : create, readonly : update ) INventoryID;
field ( numbering : managed )
UUID;
create;
update;
delete;
draft action Edit;
draft action Activate;
draft action Discard;
draft action Resume;
draft determine action Prepare;
mapping for ZRAP_INVEN_JONA
{
UUID = UUID;
InventoryID = INVENTORY_ID;
ProductID = PRODUCT_ID;
Quantity = QUANTITY;
QuantityUnit = QUANTITY_UNIT;
Price = PRICE;
CurrencyCode = CURRENCY_CODE;
Remark = REMARK;
NotAvailable = NOT_AVAILABLE;
CreatedBy = CREATED_BY;
CreatedAt = CREATED_AT;
LastChangedBy = LAST_CHANGED_BY;
LastChangedAt = LAST_CHANGED_AT;
}
determination CalculateInventoryID on save { create; }
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
field ( readonly : update ) <field_name>;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for replying Andre.
I have tried That statement, it will make the field in READONLY mode during UPDATE process as well as during CREATE.
I am expecting that during UPDATE the fields will be in READONLY mode, but during CREATE the same fields will be in EDITABLE mode.
I have tried this:
field ( mandatory : create, readonly : update ) team;
but also did not work.
any idea?
User | Count |
---|---|
57 | |
10 | |
8 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.