cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to get a list of company database sysids?

Former Member
0 Kudos

I am new to SAP and am using the B1IF. I would like to create a scenario step that returns a list of Company Names and their DB sysids. That way I can create another scenario step that allows me to update the same table in any of our companies by accepting a sysid as a parameter. What is the best way to do this?

I read about an SRGC table in the SBO-COMMON database that returns a list of companies and respective database names, but no SysIds.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Matthijs,

welcome to B1i - the following gives you the required list

<B1List>

<xsl:for-each select="document('/com.sap.b1i.system.sld.directory/RoutingTree.xml/RoutingTree')/sim:RoutingTree/sim:ParticipantNode/sim:ParticipantNode"> <xsl:variable name="sysid" select="./@SysId"/> <xsl:variable name="sdoc" select="document(concat('/com.sap.b1i.system.sld.directory/SysId.xml/',$sysid,'(Id)'))"/> <xsl:if test="starts-with($sdoc/sim:SysId/@SysTypeId,'B1')"> <b1system sysid="{$sysid}" company="{$sdoc/sim:SysId/sim:ConnectivityList/sim:Connectivity[./@ConnectivityTypeId='B1DI']/sim:Parameter[./@Key='company']/@Value}"/> </xsl:if> </xsl:for-each>

</B1List>

best - Heinz

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks Heinz! That works great.

Yesterday I also found a way to do it with a sqlCall atom using SBO-COMMON tables I saw referenced in other articles/questions. This is the SQL I came up with:

#SELECT SRGC."cmpName" AS "CmpName", SRGC."dbName" AS "DbName", 
SLSPP."ParamValue" AS "SysId" FROM SRGC INNER JOIN SLSP ON SRGC."dbName"
 = SLSP."CompIdent" INNER JOIN SLSPP ON SLSP."CompID" = SLSPP."CompID" 
WHERE SLSPP."ParamKey" = 'identifier'

The XSLT approach probably performs better than a select with 2 joins though.