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

Clear a private variable.

selvakumar_mohan
Active Participant
0 Likes
438

Hi All,

lr_lcp_transaction =
  /scmtms/cl_lcp_factory_adapter=>get_lcp_transaction_handler( ).

I am calling the above statement in loop.

My requirement is this when the loop runs for second time, i need a new value into lr_lcp_transaction and not the value which was present in the previous run of the loop.

Is this possible.

The parameter 'ms_lcp_transaction' of the class /scmtms/cl_lcp_factory_adapter is responsible for the retaining of the previous value.

I cannot clear that variable from my program as that parameter is private. please help me in this..

Thanks,

Selvakumar M.

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
395

I don't have an SCM system to check on, so the following is necessarily generic.

Look at the class /scmtms/cl_lcp_factory_adapter and see if there is a method that allows the value of ms_lcp_transaction to be reset. You can do this be searching the class for that string.

If you know what you are doing, you could use the enhancement framework to create getter/setter methods in the class. Attributes are usually private for a reason, so enhancing the class in this way may lead to inconsistancies. So, I really mean it. If you don't know precisely the effects - don't do it.

matt

Edited by: Matt on May 29, 2009 10:15 AM

2 REPLIES 2
Read only

matt
Active Contributor
0 Likes
396

I don't have an SCM system to check on, so the following is necessarily generic.

Look at the class /scmtms/cl_lcp_factory_adapter and see if there is a method that allows the value of ms_lcp_transaction to be reset. You can do this be searching the class for that string.

If you know what you are doing, you could use the enhancement framework to create getter/setter methods in the class. Attributes are usually private for a reason, so enhancing the class in this way may lead to inconsistancies. So, I really mean it. If you don't know precisely the effects - don't do it.

matt

Edited by: Matt on May 29, 2009 10:15 AM

Read only

0 Likes
395

Hi Matt,

Found a method as u have suggested...

The method is named as cleanup_transaction.

Which clears the ms_lcp_transcation variable.

thanks for suggestion. found solution based on it.

thanks again.

Selvakumar M.