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
For our SAP testautomation application, which is developed in ABAP based on eCATT, we needed a tiny add-on to combine different include SAP development objects in a single file. That's how I came up with the idea to develop an UI with Microsoft Forms to use it for this kind of requirement. I want to have a modern UI and a handy UI development environment. To realize this I use my approach with the combination of ABAP and PowerShell, which I described here. So I started to design an UI with Sapiens PowerShell Studio. The design (I know it is not nice) is done very rapidly. Four buttons, three fields, two list boxes and an editor.

 



 

The PowerShell Studio generates the whole source and it is possible to export that as one single PowerShell file. This single PowerShell file is stored as include development object in the SAP system. But before it is necessary to define a web interfaces, TAC SICF with a handler class, for the communication between the PowerShell application and the SAP backend system.

 



 

Here an example of the PowerShell code to get all includes of a pattern via a web request:
    $btnGetIncludes_Click={

$Pair = $txtUser.Text + ":" + $txtPassword.Text
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic " + $encodedCreds

$header = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$header.Add("cache-control", "no-cache")
$header.Add("authorization", $basicAuthValue)
$header.Add("accept", "*/*")
$header.Add("accept-encoding", "gzip, deflate")

$header.Add("operation", "get")
$header.Add("inclpattern", $txtPattern.Text)

$RequestURI = "http://nsp.mysystem.de:8000/z_handle_inc?sap-client=001"

Try {
$Result = Invoke-WebRequest -Uri $RequestURI -Method Get `
-Headers $header -ErrorVariable RestError
} Catch {
} Finally {
If ($Result.StatusCode -eq 200) {
$JSON = $Result.Content | ConvertFrom-Json
ForEach ($Line in $JSON) {
$AllIncludes.Items.Add($Line)
}
} Else {
Write-Host $RequestURI $RestError $Result.StatusCode
}
}

}

 

And here the method in the SAP backend - an easy select:
  METHOD get_incl."-----------------------------------------------------

AUTHORITY-CHECK OBJECT 'S_DEVELOP'
ID 'ACTVT' FIELD '03'.
IF sy-subrc <> 0.
RAISE not_authorized.
ENDIF.

CHECK iv_inclpattern IS NOT INITIAL.
SELECT name FROM trdir INTO TABLE rt_incl WHERE name LIKE iv_inclpattern AND
subc = 'I' AND appl = SPACE.

ENDMETHOD.

 

The call of this PowerShell script is a very easy and clear report.



 

After the execution of the report the PowerShell script starts and the dialog opens to pick the includes and to build one file.



 

It is very easy possible to combine the rapid and modern UI development of PowerShell Studio via my approach with ACTIVEXPOSHV3 with SAP ABAP and the SAP web interface. And if you're a gifted UI designer, not a dilettante like me, you can also create beautiful UIs. In the focus of my interest was on the one hand the basically possibility and on the other hand to create an ease of work.
Labels in this area