# Deprecation of getTable()

**URL:** <https://techcommunity.softwareag.com/t/deprecation-of-gettable/171308>\
**Category:** Forum\
**Tags:** Mainframe-Integration, ApplinX\
**Created:** [May 31, 2013, 2:54pm UTC](https://techcommunity.softwareag.com/t/deprecation-of-gettable/171308 "2013-05-31T14:54:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeA](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@JoeA](https://techcommunity.softwareag.com/u/JoeA)\
**Post date:** [May 31, 2013, 2:54pm UTC](https://techcommunity.softwareag.com/t/deprecation-of-gettable/171308/1 "2013-05-31T14:54:41Z")

</div>

Bringing an application up from Applinx 5.2.5 to 8.2.2, I get a deprecation warning. (bunches, actually)  
Here is a code snippet:

package contexts;  
import com.sabratec.applinx.baseobject.table.\*;  
import com.sabratec.applinx.common.generate.GXTableSerializer;  
public class Chn\_excel extends GXBasicContext  
{  
public void gx\_onLoad() {  
super.gx\_onLoad() ;  
try{  
gx\_attach();  
GXITable gx\_table = null;  
/// Retrieving A table stored in the http session  
Object obj = getSession().getAttribute(EXCEL\_TABLE\_SESSION\_KEY);  
if (obj != null){  
gx\_table = (GXITable)obj;  
}  
else{  
gx\_table = getGXSession().getTable();  
}

How can I fix this easily? Any help will be appreciated.

---

<div class="post-metadata">

**Author:** ![Gadi](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/gadi/32/16051_2.png) [@Gadi](https://techcommunity.softwareag.com/u/Gadi)\
**Post date:** [June 2, 2013, 10:55am UTC](https://techcommunity.softwareag.com/t/deprecation-of-gettable/171308/2 "2013-06-02T10:55:17Z")

</div>

It is replaced by:

```auto
getSession().getScreen().getTables()[0]
```

---

<div class="post-metadata">

**Author:** ![JoeA](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@JoeA](https://techcommunity.softwareag.com/u/JoeA)\
**Post date:** [June 3, 2013, 3:24pm UTC](https://techcommunity.softwareag.com/t/deprecation-of-gettable/171308/3 "2013-06-03T15:24:25Z")

</div>

Can you tell me how it would fit into the attached?

[Chn\_excel.java](https://techcommunity.softwareag.com/uploads/short-url/sEmreavXAcQHwJDRMVP2OF2G8Oc.java) (5.62 KB)

---

<div class="post-metadata">

**Author:** ![Gadi](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/gadi/32/16051_2.png) [@Gadi](https://techcommunity.softwareag.com/u/Gadi)\
**Post date:** [June 3, 2013, 4:44pm UTC](https://techcommunity.softwareag.com/t/deprecation-of-gettable/171308/4 "2013-06-03T16:44:01Z")

</div>

It’s a little hard to look at the code without the context but basically it should be this, in the else caluse:  
gx\_table = getGXSession().getScreen().getTables()[0];

---

<div class="post-metadata">

**Author:** ![JoeA](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@JoeA](https://techcommunity.softwareag.com/u/JoeA)\
**Post date:** [June 3, 2013, 5:00pm UTC](https://techcommunity.softwareag.com/t/deprecation-of-gettable/171308/5 "2013-06-03T17:00:24Z")

</div>

Great! Thanks so much for your help, it works fine. Removes several hundred deprecation warnings for me.

---

<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, 3:28pm UTC](https://techcommunity.softwareag.com/t/deprecation-of-gettable/171308/6 "2021-04-02T15:28:53Z")

</div>


