Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
stefan_schnell
Active Contributor
0 Kudos
Here a tiny example how to use SAP HANA ABAP Source Search via PowerShell. After my question here, in the ABAP in Eclipse forum, I see how easy it is to use the ABAP Source Search from outside an SAP system. After the activation of the business function SRIS_SOURCE_SEARCH is it also possible with only one http get request to use it.
#-Begin-----------------------------------------------------------------

$User = "BCUSER"
$Password = Read-Host -Prompt "Passwort" -AsSecureString
$Cred = New-Object System.Management.Automation.PSCredential($User, $Password)

$System = "http://nsp.mysystem.de:8650/"
$TextSearch = "sap/bc/adt/repository/informationsystem/textsearch"
$SearchString = "?searchString=Record"
$Params = "&searchFromIndex=1&searchToIndex=10"

$RequestURI = $System + $TextSearch + $SearchString + $Params
[XML]$SearchResult = Invoke-RestMethod -Uri $RequestURI -Credential $Cred -Method Get

$Cnt = $SearchResult.textSearchResult.textSearchObjects.textSearchObject.Count
For ($i = 0; $i -lt $Cnt; $i++ ) {
$Obj = $SearchResult.textSearchResult.textSearchObjects.textSearchObject[$i]
Write-Host $Obj.adtMainObject.description " - " $Obj.adtMainObject.name
}

#-End-------------------------------------------------------------------

In my example I search the word Record with a maximum of 10 hits.



 
2 Comments
Labels in this area