Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BOPF - io_modify->create

fabio_bellocchio
Participant
0 Likes
4,383

Dear BOPF experts.

I could not find solution for this issue by searching in this community

I am creating a sub-node in the Yard Order application. The record is child of Yard Order root record. Creation is made by means of CREATE method of the /BOBF/IF_FRW_MODIFY class, implemented in the /BOBF/IF_FRW_ACTION~EXECUTE method of my custom BOPF Action.

CALL METHOD io_modify->create

EXPORTING iv_node = /sapyl/if_yard_order_c=>sc_node-reference
iv_key = <lfs_ref_data>-key
is_data = lo_ref_data
iv_assoc_key = /sapyl/if_yard_order_c=>sc_association-reference-to_parent
iv_source_node_key = is_ctx-node_key
iv_source_key = ls_key-key
iv_root_key = is_ctx-root_node_key

IMPORTING
ev_key = lv_key.

Apparently, the creation works well.

However, I can not figure out why the registry is written in read-only (dimmed) mode. When a line is created manually by pressing the "Create" button on the screen, the new line is activated for changes. But when I do this with the implementation, it comes in read only mode. I tried many things, but nothing worked.

Please, can someone give me a tip on what could be happening here?

Thank you.

1 ACCEPTED SOLUTION
Read only

gabriel_candrian
Explorer
0 Likes
2,313

Hi Fabio

As i can see in your code sample, you pass the root node key (is_ctx-root_node_key) of your BOPF object model instead of the root key of the corresponding entity you are working on int the action (in your case this probably should be ls_key-root_key instead). Maybe this is the cause of your problem.

Regards
Gabriel

2 REPLIES 2
Read only

gabriel_candrian
Explorer
0 Likes
2,314

Hi Fabio

As i can see in your code sample, you pass the root node key (is_ctx-root_node_key) of your BOPF object model instead of the root key of the corresponding entity you are working on int the action (in your case this probably should be ls_key-root_key instead). Maybe this is the cause of your problem.

Regards
Gabriel

Read only

0 Likes
2,313

Thank you Gabriel.

Actually your answer is the closest to the solution it could get.

Based on this post:

https://answers.sap.com/questions/149370/problem-updating-new-values-to-a-node-in-runtime-i.html

"If we set the wrong root_key, the instance is not properly attached to its parent and will be lost in space". This is exactly what happened.

I commented out the parameter, and the issue is fixed.

Thank you very much for your analysis and guidance.