on 08-13-2018 12:52 PM
As the title already suggests, I'd like to autoincrement the primary key of a Dictionary Object during CRUD Operations, triggered by an UI5 Application. Just like I'm used to do it in the MySQL World using the keyword autoincrement.
BOPF elements are generated out of CDS Views, enabling basic CRUD functionality. The Consumption-Views are accessed by an OData Service, used by an UI5 App. As far as I understand, auto-increment can be realized using Number-Ranges. I also know how to create these Number-Ranges in the SNRO but I don't see, how I can use them in my generated BOPF elements. Or is there any other CDS or OData related way I am not aware of, to increment the key for every new Entry.
My System is on S/4 NW 7.51
I'd be grateful for help.
data: lr_data type ref to bopf_structure.
LOOP AT it_key INTO data(ls_key).
create data lr_data.
call function 'number_get_next'
...
importing
number = lv_new_number
...
lr_data->number = lv_new_number.
io_modify->update(
EXPORTING
iv_node = bopf_interface=>sc_node-bopf_node
iv_key = ls_key-key
is_data = lr_data
it_changed_fields = value #( ( 'NUMBER' ) ) "--> should be the name of the number field in bopf
).
endloop.
Something like that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could create a determination for the BOPF node, which is triggered on create during "Before save (Draw Numbers)". The determination draws a new number from the number ranges and writes it into the key field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for this advice. Look like this is the way to go.
Nevertheless, I was not able to figure out how to implement the execute method. As you know, the only thing I want to do is to change the key value, but how can I do that. How can I set the value of the Evaluation Timepoint Draw Number?
An answer would be really great.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
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.