# Can't use Natural Subprograms with object data area

**URL:** <https://techcommunity.softwareag.com/t/cant-use-natural-subprograms-with-object-data-area/92284>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Remote-Procedure-Call-RPC\
**Created:** [December 2, 2009, 7:10pm UTC](https://techcommunity.softwareag.com/t/cant-use-natural-subprograms-with-object-data-area/92284 "2009-12-02T19:10:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rudolf3](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@Rudolf3](https://techcommunity.softwareag.com/u/Rudolf3)\
**Post date:** [December 2, 2009, 7:10pm UTC](https://techcommunity.softwareag.com/t/cant-use-natural-subprograms-with-object-data-area/92284/1 "2009-12-02T19:10:08Z")

</div>

I also posted this question on Application Modernization forum.

I’m unable to disclose a method from a class (which is basically a subprogram with object state) for Natural RPC (when it contains an object data area). Is this a known issue. Why is it not possible to directly use a method of a class?

Kind regards,  
Rudolf

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [December 2, 2009, 7:35pm UTC](https://techcommunity.softwareag.com/t/cant-use-natural-subprograms-with-object-data-area/92284/2 "2009-12-02T19:35:09Z")

</div>

Without having investigated further…  
But I would say that it is pretty obvious that you would have to instantiate a new object instance before being able to acces the objects data (i.e. the context).  
In other words you will have to create a new shell subprogram which then instatiates and calls the objects.method.

Unless of course it is a static class (which I off the top of my head do not remember that Natural supports)

Did I understand your scenario correctly ?

Finn

---

<div class="post-metadata">

**Author:** ![Rudolf3](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@Rudolf3](https://techcommunity.softwareag.com/u/Rudolf3)\
**Post date:** [December 2, 2009, 7:50pm UTC](https://techcommunity.softwareag.com/t/cant-use-natural-subprograms-with-object-data-area/92284/3 "2009-12-02T19:50:38Z")

</div>

Hi Finn,

Agreed, that’s clear.

But I was hoping that I could disclose methods from a class very much like you can disclose methods from a Java class using JAX-WS. I do understand that you need an infrastructure in place, so why not extend SYSRPC so that it also supports calling methods from a class (it is ‘your’ job to make our lives (developers) easier ;-).

I am only asking this question from an architectural point of view: what are the architectural consequences if the company I’m working for would move to a more object based development approach (using interfaces and classes).

Kind regards,  
Rudolf

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [December 2, 2009, 8:41pm UTC](https://techcommunity.softwareag.com/t/cant-use-natural-subprograms-with-object-data-area/92284/4 "2009-12-02T20:41:46Z")

</div>

Hi Rudolf  
See your point 😉  
But I’m am sure there is a “little” development-effort in your suggestion.  
I definitely think you should make an enhancement proposal and bring it up for discussion at the next user-conference !

Finn

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:57pm UTC](https://techcommunity.softwareag.com/t/cant-use-natural-subprograms-with-object-data-area/92284/5 "2021-04-02T14:57:48Z")

</div>


