cancel
Showing results for 
Search instead for 
Did you mean: 

Specialty of supply function and how can we use it efficiently?

Former Member
0 Kudos

Hi Experts,

I have one question.

What exactly the function of “Supply function” for a node.

Some says when ever lead change happens the “Supply function” triggers.

I put a break point in Supply function say “ZSupply” written code to populate the table.

It triggered only once to populate the table. If this is the functionality then I can write code in method and call it in modify view my checking it for first time why “supply function”.   I want to know what is its specialty, how can we use it efficiently?

Thanks

Gopal

Accepted Solutions (1)

Accepted Solutions (1)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check the example WDR_TEST_SUPPLY_FUNCTION. You can find out whenever we are changing the airline and do search, supply function will be triggered.

Check the below link in which I am explaining how the selected line in one ALV changes the other ALV using supply function.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/600729d2-d2c4-2d10-7ab5-d3f720908...

Answers (3)

Answers (3)

ramakrishnappa
Active Contributor
0 Kudos

Hi Gopal,

Please find the below help document which throws light on the use of supply function in WD context.

Supply function -  Web Dynpro ABAP - SAP Library

Hope this helps you.

Regards,

Rama

former_member210252
Contributor
0 Kudos

Hi Gopal,

You are correct even without supply function you can achieve the same functionality i.e when ever there is a change in HEADER the corresponding ITEM for the HEADER can be displayed.

But the idea of using SUPPLY Function is - the code written in the node i.e assume HEADER and ITEM relation gets executed as and when the node is instantiated in the run time where in there is no need us to handle it explicitly.

If not used SUPPLY Function then we need to handle the complete HEADER and ITEM relation explicitly.

Regards,

Mohammed

joao_sousa2
Active Contributor
0 Kudos

The supply function is quite usefull if your context has a hierarchy of nodes. Lets say ORDER, and a sub-node called ORDERITEM.

If you attribute a supply function to ORDERITEM that function will be called each time the ORDER lead selection changes, allowing you to update ORDERITEM with the correct value (assuming you choose to create ORDERITEM as a singleton).

There are other ways to update ORDERITEM on lead selection change, but this keeps things nice and tidy.