Server Modules: automatically included routines and statements
Posted: Fri Sep 26, 2025 5:30 pm
Hi everybody,
we are using server modules on IBMi for providing data to be shown on web pages.
To be able to test everything without touching the production data we have written a reusable part to set up the correct library list.
This reusable part we call in a method routine in our server modules like ths:
Mthroutine Name(m_SetLibraryList)
* =====================================
* Definition: ReusableParts
* =====================================
Define_Com Class(#Retrieve_DTAARA_SMHRUNTIME) Name(#Retrieve_DTAARA_SMHRUNTIME)
* =====================================
* Bibliotheksliste setzen
* =====================================
#Retrieve_DTAARA_SMHRUNTIME.m_ADDLIBL I_Fibu("J") I_Lansa("J") I_Wws("J") I_OnlyFiles("N") I_Environment("TEST")
Endroutine
And then we call this method routine in every server routine like this:
Srvroutine Name(FindArtikelumsatz)
Field_Map For(*INPUT) Field(#SMHMANDAN)
List_Map For(*OUTPUT) List(#l_Artikelumsatz)
List_Map For(*OUTPUT) List(#l_Filialen)
* Bibliotheksliste setzen
#COM_SELF.m_SetLibraryList
Is there a way to let this be done automatically by VL when creating a server module?
Something like a server routine template that VL uses for creating that can be adapted?
Or a change in the #PRIM_SRVM definitions?
Many thanks in advance, Jörg
we are using server modules on IBMi for providing data to be shown on web pages.
To be able to test everything without touching the production data we have written a reusable part to set up the correct library list.
This reusable part we call in a method routine in our server modules like ths:
Mthroutine Name(m_SetLibraryList)
* =====================================
* Definition: ReusableParts
* =====================================
Define_Com Class(#Retrieve_DTAARA_SMHRUNTIME) Name(#Retrieve_DTAARA_SMHRUNTIME)
* =====================================
* Bibliotheksliste setzen
* =====================================
#Retrieve_DTAARA_SMHRUNTIME.m_ADDLIBL I_Fibu("J") I_Lansa("J") I_Wws("J") I_OnlyFiles("N") I_Environment("TEST")
Endroutine
And then we call this method routine in every server routine like this:
Srvroutine Name(FindArtikelumsatz)
Field_Map For(*INPUT) Field(#SMHMANDAN)
List_Map For(*OUTPUT) List(#l_Artikelumsatz)
List_Map For(*OUTPUT) List(#l_Filialen)
* Bibliotheksliste setzen
#COM_SELF.m_SetLibraryList
Is there a way to let this be done automatically by VL when creating a server module?
Something like a server routine template that VL uses for creating that can be adapted?
Or a change in the #PRIM_SRVM definitions?
Many thanks in advance, Jörg