cancel
Showing results for 
Search instead for 
Did you mean: 

S4HC - CBO Child Node Data Update

former_member438902
Discoverer
0 Kudos

Dear Experts,

I have a CBO requirement in which I have 2 nodes and One Custom Action Button to Refresh Item Data.

> Header Node - contains Customer data

> Item Node - Customer related Material Data

When I click on Refresh action/Button, the Material Qty should be updated with current available Qty. I am using API to get the Qty value and I am able to collect final data that needs to be updated in CBO,

I am reading

> Header data using LO_NODE = write->get_root

> Item Data using association->to_child_data( )

I am unable to update the existing Item records for the customer with Qty from Internal Table.

Thanks in Advance.

Regards,

-Pravin

TamasFodor
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

We helped you to accept the answer, since there were no updates after a few days. You can unaccept it anytime if you have further questions.

Kind regards,

Tamas

SAP Community Topic Expert

Accepted Solutions (1)

Accepted Solutions (1)

AndreaBasalo
Advisor
Advisor
0 Kudos

Hello Pravin,

You can use the get_children method.

DATA lv_botest_key TYPE yy1_kr_botest.

lv_botest_key = '4'.

DATA(lo_botest) = write->get_root(

business_object_id = 'YY1_BOTEST'

key = lv_botest_key

).

DATA(lt_children) = lo_botest->get_children( node_id = 'bochild' ).

DATA lo_child LIKE LINE OF lt_children.

DATA ls_bochild TYPE yy1_bochild_botest.

LOOP AT lt_children INTO lo_child.

lo_child->get( IMPORTING data = ls_bochild ).

ls_bochild-field1 = 'update'.

lo_child->update(

CHANGING data = ls_bochild

).

ENDLOOP.

Fore more information, please check Code Samples to Write Data from Determinations or Actions to Custom Business Objects

Thank you,

Andrea

Answers (0)