# Load records from SAP table with multiple keys??

**URL:** <https://forum.servoy.com/t/load-records-from-sap-table-with-multiple-keys/18032>\
**Category:** Classic Servoy\
**Created:** [June 19, 2014, 6:47am UTC](https://forum.servoy.com/t/load-records-from-sap-table-with-multiple-keys/18032 "2014-06-19T06:47:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abeermann](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@abeermann](https://forum.servoy.com/u/abeermann)\
**Post date:** [June 19, 2014, 6:47am UTC](https://forum.servoy.com/t/load-records-from-sap-table-with-multiple-keys/18032/1 "2014-06-19T06:47:08Z")

</div>

Hello Everybody

I need to load records from a SAP table via PK-Dataset into a Servoy Form?  
The SAP table definition shows 5 columns as pk and i don’t know how to handle this???

For testing i tried an easy example:  
In a tableview form (datasource = SAP table xxx)

var rec = foundset.getSelectedRecord();

if(rec)  
{  
scopes.SapTeileinfo.navfs = databaseManager.createEmptyDataSet();  
//the 5 key columns  
scopes.SapTeileinfo.navfs.addRow([rec.mandt,rec.stlty,rec.stlnr,rec.stlkn,rec.stpoz]);

//the second form to show the wanted record from table xxx  
forms.Stueckliste.controller.loadRecords(scopes.SapTeileinfo.navfs);  
application.createWindow(forms.Stueckliste.controller.getName(), JSWindow.MODAL\_DIALOG).show(forms.Stueckliste);  
}

No sucess? The form Stueckliste shows no record?  
I know that i can show one record in a second form based on the same datasource much easier, but the real problem is, that i have to fill  
the navfs with n records sorted in a special way to show structured part-lists.  
level1  
level2  
level3  
level2  
level1  
level2  
level3  
level4  
…

I have done this with tables that have one pk but i don’t know how to do this with tables with n pk’s.  
What do i miss?  
Any help welcomed

Best regards  
Albert

---

<div class="post-metadata">

**Author:** ![abeermann](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@abeermann](https://forum.servoy.com/u/abeermann)\
**Post date:** [June 19, 2014, 3:01pm UTC](https://forum.servoy.com/t/load-records-from-sap-table-with-multiple-keys/18032/2 "2014-06-19T15:01:57Z")

</div>

Hello

Problem solved! I used the table columns order, but Servoy needs the keys in aphabetic order !!!

Sorry for bothering you.

Regards  
Albert
