diff --git a/src-modules/module/rpta/schluesseltabellen/fm_templates.unl b/src-modules/module/rpta/schluesseltabellen/fm_templates.unl
index bc571b3..ef173e7 100644
--- a/src-modules/module/rpta/schluesseltabellen/fm_templates.unl
+++ b/src-modules/module/rpta/schluesseltabellen/fm_templates.unl
@@ -312,9 +312,9 @@ select '${removeEmptyLines}';\
<#elseif column.coltype=="logicalColumn">\
null::varchar(255) as ${column.targetfieldname},\
<#elseif column.coltype=="preparingColumn">\
- ${column.colfunction} as ${column.targetfieldname},\
+ ${parseRepoVars(column.colfunction)} as ${column.targetfieldname},\
<#elseif column.coltype=="lookupColumn">\
- (${column.colfunction}) as ${column.targetfieldname},\
+ (${parseRepoVars(column.colfunction)}) as ${column.targetfieldname},\
<#elseif column.coltype=="computedColumn" || column.coltype=="processingColumn">\
null::decimal(19,6) as ${column.targetfieldname},\
#if>\
diff --git a/src-modules/module/rpta/schluesseltabellen/rpta_column_layout_studienstiftung_rangliste.sql b/src-modules/module/rpta/schluesseltabellen/rpta_column_layout_studienstiftung_rangliste.sql
new file mode 100644
index 0000000..35a9720
--- /dev/null
+++ b/src-modules/module/rpta/schluesseltabellen/rpta_column_layout_studienstiftung_rangliste.sql
@@ -0,0 +1,73 @@
+--freemarker template
+<#include "RPTA-Makros"/>
+
+
+select count(*) from rpta_resultset where uniquename='rpta_lm_ects_soll_ist';
+
+
+<#assign rpta_column_layout = {"uniquename":"rpta_lm_ects_soll_ist_studienstiftung_rangliste",
+"caption":"Studienstiftung Rangliste",
+"rpta_resultset":"rpta_lm_ects_soll_ist",
+"whereclause":"1=1
+ -- and (lehr_eigen=lehr_dienst or (lehr_eigen is null and lehr_dienst is null)) and aktiv=1
+ and ((fach_sem_zahl_max_student = 3 and ects_ist >= 40)
+ or (fach_sem_zahl_max_student = 4 and ects_ist >= 60))",
+"description":"",
+"sortclause":"ects_ist/ects_soll desc,note_elementnr_30,note_pnr_30"
+}
+ />
+
+<#assign rpta_columns = [
+
+{"uniquename":"matrikel_nr",
+"caption_in_ergebnistabelle":"Matrikelnummer",
+"is_visible":"1",
+"format_code":"INT_NO_SEP",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"surname_sos_stud_d",
+"caption_in_ergebnistabelle":"Nachname",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"fach_sem_zahl_max_student",
+"caption_in_ergebnistabelle":"Fachsemester",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"ects_soll",
+"caption_in_ergebnistabelle":"Soll-ECTS",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"ects_ist",
+"caption_in_ergebnistabelle":"Ist-ECTS",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"note_elementnr_30",
+"caption_in_ergebnistabelle":"Note (EXA)",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"note_pnr_30",
+"caption_in_ergebnistabelle":"Note (POS)",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+}
+]
+ />
+<@rpta_column2layout_fuellen />
diff --git a/src-modules/module/rpta/schluesseltabellen/rpta_column_layout_studienstiftung_rangliste_diagnose.sql b/src-modules/module/rpta/schluesseltabellen/rpta_column_layout_studienstiftung_rangliste_diagnose.sql
new file mode 100644
index 0000000..6a0e7d3
--- /dev/null
+++ b/src-modules/module/rpta/schluesseltabellen/rpta_column_layout_studienstiftung_rangliste_diagnose.sql
@@ -0,0 +1,94 @@
+--freemarker template
+<#include "RPTA-Makros"/>
+
+
+select count(*) from rpta_resultset where uniquename='rpta_lm_ects_soll_ist';
+
+
+<#assign rpta_column_layout = {"uniquename":"rpta_lm_ects_soll_ist_studienstiftung_rangliste_diagnose",
+"caption":"Studienstiftung Rangliste (Diagnose)",
+"rpta_resultset":"rpta_lm_ects_soll_ist",
+"whereclause":"1=1
+ -- and (lehr_eigen=lehr_dienst or (lehr_eigen is null and lehr_dienst is null)) and aktiv=1
+ and ((fach_sem_zahl_max_student = 3 and ects_ist >= 40)
+ or (fach_sem_zahl_max_student = 4 and ects_ist >= 60))",
+"description":"",
+"sortclause":"ects_ist/ects_soll desc,note_elementnr_30,note_pnr_30"
+}
+ />
+
+<#assign rpta_columns = [
+
+{"uniquename":"matrikel_nr",
+"caption_in_ergebnistabelle":"Matrikelnummer",
+"is_visible":"1",
+"format_code":"INT_NO_SEP",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"surname",
+"caption_in_ergebnistabelle":"Nachname",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"fach_sem_zahl_max_student",
+"caption_in_ergebnistabelle":"Fachsemester",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"ects_soll",
+"caption_in_ergebnistabelle":"Soll-ECTS",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"ects_ist",
+"caption_in_ergebnistabelle":"Ist-ECTS",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"dim_studiengang_abschluss",
+"caption_in_ergebnistabelle":"Abschluss",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"dim_studiengang_stg",
+"caption_in_ergebnistabelle":"Fach",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"dim_studiengang_pversion_uniquename",
+"caption_in_ergebnistabelle":"PO-Version",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"note_elementnr_30",
+"caption_in_ergebnistabelle":"Note (EXA)",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+},
+{"uniquename":"note_pnr_30",
+"caption_in_ergebnistabelle":"Note (POS)",
+"is_visible":"1",
+"format_code":"",
+"visible_size":"5",
+"description_in_ergebnistabelle":""
+}
+]
+ />
+<@rpta_column2layout_fuellen />
diff --git a/src-modules/module/rpta/schluesseltabellen/rpta_column_rpta_lm_ects_soll_ist_fuellen.sql b/src-modules/module/rpta/schluesseltabellen/rpta_column_rpta_lm_ects_soll_ist_fuellen.sql
index 299c63a..c0c6281 100644
--- a/src-modules/module/rpta/schluesseltabellen/rpta_column_rpta_lm_ects_soll_ist_fuellen.sql
+++ b/src-modules/module/rpta/schluesseltabellen/rpta_column_rpta_lm_ects_soll_ist_fuellen.sql
@@ -164,16 +164,41 @@ select count(*) from rpta_resultset where uniquename='rpta_lm_ects_soll_ist';
"is_aggregate":"1",
"description_der_spalte":"Anteil der Ist-ECTS and den Soll-ECTS"
},
-{"uniquename":"surname",
+{"uniquename":"note_elementnr_30",
+"caption_der_spalte":"SWF Note PK30 (elementnr)",
+"srcfieldname":"",
+"targetfieldname":"note_elementnr_30",
+"column_type":"lookupColumn",
+"col_function":"select max(note) from lm_exam_unit E
+ where tmp_rpta_lm_ects_soll_ist.matrikel_nr=E.matrikel_nr
+ and tmp_rpta_lm_ects_soll_ist.dim_studiengang_abschluss=E.ch35_ang_abschluss
+ and tmp_rpta_lm_ects_soll_ist.dim_studiengang_stg=E.ch30_fach
+ and ${'${'}LM_Notenkonto}",
+"is_aggregate":0,
+"description_der_spalte":""},
+
+{"uniquename":"note_pnr_30",
+"caption_der_spalte":"SWF Note PK30 (pnr)",
+"srcfieldname":"",
+"targetfieldname":"note_pnr_30",
+"column_type":"lookupColumn",
+"col_function":"select max(note) from sos_lab_pord E
+ where tmp_rpta_lm_ects_soll_ist.matrikel_nr=E.matrikel_nr
+ and tmp_rpta_lm_ects_soll_ist.dim_studiengang_abschluss=E.ch35_ang_abschluss
+ and tmp_rpta_lm_ects_soll_ist.dim_studiengang_stg=E.ch30_fach
+ and ${'${'}SOS_Notenkonto}",
+"is_aggregate":0,
+"description_der_spalte":""},
+
+{"uniquename":"surname_sos_stud_d",
"caption_der_spalte":"Nachname",
"srcfieldname":"",
-"targetfieldname":"surname",
+"targetfieldname":"surname_sos_stud_d",
"column_type":"lookupColumn",
-"col_function":"select surname from sos_stud_address A
+"col_function":"select nachname from sos_stud_d A
where tmp_rpta_lm_ects_soll_ist.matrikel_nr=A.matrikel_nr",
"is_aggregate":0,
-"description_der_spalte":""
-}
+"description_der_spalte":""}
]
/>