on 2024 Nov 18 7:45 PM
Hello All,
I usually use unmanaged numbering in managed RAP application.
When I do this, when I create a new entity, then in adjust_number method, I have the entity I just created :
However, in the unmanaged RAP application, MAPPED is empty :
This is the create by association method I'm using :
METHOD cba_Orders.
DATA n TYPE i VALUE 1.
LOOP AT entities_cba INTO DATA(ls_entity).
LOOP AT ls_entity-%target INTO DATA(ls_target).
APPEND VALUE #(
pid = n
product_id = ls_target-product_id
quantity = ls_target-quantity
) TO lhc_ZTEST_CUST_NORTHWIND=>mt_buffer_create.
APPEND VALUE #(
%cid = ls_target-%cid
%pid = n
product_id = ls_target-product_id ) TO mapped-ztest_cust_northwind_order.
n = n + 1.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
Am I doing something wrong ?
For now, I'm using a workaround : I store the PID in a buffer table with data created, and I use this buffer table to loop to PID generated in CREATE BY ASSOCIATION and use it in the ADJUST_NUMBER methode :
METHOD adjust_numbers.
LOOP AT lhc_ZTEST_CUST_NORTHWIND=>mt_buffer_create ASSIGNING FIELD-SYMBOL(<ls_buffer>).
SELECT MAX( order_id )
FROM ztest_cust_northwind_order
WHERE product_id = @<ls_buffer>-product_id
INTO @DATA(lv_orderid).
lv_orderid = lv_orderid + 1.
APPEND VALUE #(
%pid = <ls_buffer>-pid
%tmp = VALUE #( product_id = <ls_buffer>-product_id )
product_id = <ls_buffer>-product_id
order_id = lv_orderid ) TO mapped-ztest_cust_northwind_order.
<ls_buffer>-order_id = lv_orderid.
ENDLOOP.
ENDMETHOD.
But I don't understand why it is not coming natively in MAPPED structure ?
Thx in advance
Request clarification before answering.
User | Count |
---|---|
31 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.