Wednesday, 16 September 2015

Standing on the shoulders of giants.... [SAPLINK]

Okay, so halfway through looking for xlsx downloads, I came across the following : 

SAPLINK : A project / set of programs that allows users to upload+download vast swathes of code, dictionary objects etc outside of the traditional transport methodology:

http://wiki.scn.sap.com/wiki/display/ABAP/SAPlink+User+Documentation


Then once you've got SAPLINK working, you can load in the ZCL_EXCEL* classes, which will do all the Excel work for you...

https://github.com/ivanfemia/abap2xlsx/wiki/Installation-guide

Once again, I'm blown away by the generosity of the community in sharing their code, and generally making life better for their fellow developers! Good work all!



Monday, 14 September 2015

XSLT Pointer

This is as much for my own future reference as for anyone else's help... but it's been a while since I'd done any XSLT. Since all the examples had the same incoming XML tags as the outgoing mapped structures, it was confusing as to what referred to incoming, and what referred to outgoing : 



The rule of thumb I'm following (pragmatic until the last!) is that if it's in quotes and has "ss:" in it, then that's from the source, and any "xml:element" content refers to the outgoing data.

Trying to access the "Attributes" in the source XML is simply a matter of using the "@" symbol.



So the above takes the following xml:

 <row r="2" x14ac:dyDescent="0.25" spans="1:5">
  <c r="A2" t="s"><v>5</v></c>
  <c r="B2" t="s"><v>6</v></c>
  <c r="C2" t="s"><v>7</v></c>
  <c r="D2" t="s"><v>8</v></c>
  <c r="E2" t="s"><v>9</v></c>
 </row>

and spits out xml tags without attributes... the "r" attributes have been chucked into "C1" tags:

<sheetData>
  <row>
    <c>
      <c1>A1</c1>
      <v>0</v>
    </c>
    <c>
      <c1>B1</c1>
      <v>1</v>
    </c>
    <c>




Thursday, 10 September 2015

XLSX Upload using XSLT

Having been tasked with an upload of xlsx (as well as xls, but hey, there's a quarter-dozen ways of doing that and we all know what they are!) I came across this:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6026d7c0-c716-3010-c8be-ea771ff9d783?QuickLink=index&overridelayout=true&57720065492913

You need to use the XSLT to do the transformation. SAP could really do with writing this into a standardised method, but I daresay someone else might beat them to it!

Good work Manu!

For me, the really interesting thing about this is the way that the xlsx files are structured. I was astonished at the way the shared string file works, but the amount of disk space that gets saved off the back of that could be massive.

Another thing to mention is that the XSLT transformations ARE CASE SENSITVE.
I just spent a cuppla hours having transformations fail on me because I'd not translated to upper case. Eugh. What a day.

Thursday, 6 August 2015

How to find which function a UI5 service is calling...

Recently I was asked to investigate why some UI5 transactions were running slowly. Ordinarily, I'd be able to link services seen in the F12 Developer tools in Internet Explorer (in IE tap F12, switch on Network Logging, then do the UI5 f/e transaction, see what services are being called ) to the services defined in SEGW.

For some reason (if I find it, I'll blog it!) there weren't any services defined in SEGW. They were all present and correct in /IWFND/MAINT_SERVICE, but because that doesn't tell you the backend ABAP to look at, it doesn't help here.

What I was able to do was do a search on "odata" in SICF transaction. The odata node has a handler class /IWFND/CL_SODATA_HTTP_HANDLER.


An external breakpoint in the constructor method of this class will be hit every time ANY odata service is called. From here, a "Breakpoint on Statement : call function" will eventually (about 30 functions later) reach a statement:

call function mv_rfc_name DESTINATION mv_destination


mv_rfc_name will have the name of the function that the service is actually calling.

******************

Okay subsequent EDIT - Just stick the breakpoint in the Constructor of /IWFND/CL_BEC_BOP_COMMON_RFC

This is the constructor of the superclass that all the oData services inherit from.
Should save you about 30 seconds every time you search!

ATB. P.

******************
Another subsequent Edit : 07.09.2017 : 
/IWBEP/CL_MGW_BOP_COMMON_RFC also good for this in S4H

Tuesday, 21 July 2015

UI5 / Gateway Troubleshooting

Brilliant overview of things to do when your UI5 App goes wrong, or you've got to go and fix someone else's, and you don't know where to start:

http://scn.sap.com/community/gateway/blog/2013/08/09/frequent-problems-encountered-in-netweaver-gateway-service-development

Good work Krishna!

Tuesday, 30 June 2015

ABAP Push Channel

Usual left-field nonsense here... smiley emoji...


Using a combination of the ABAP Push Channel, which sends realtime messages super quick from place to place on your ABAP system, and the Phaser Game Library, I get some realtime graph updates based on what the little dudes on the right hand side are doing.

Just built this as a demo because creating sales orders and sending messages is a bit slow, and I wanted to see how much traffic I could throw at the channel before it started to snarl up.

I can't prove it, but I think it's the graph that's struggling here, not the messaging channel.

SAP have a PONG version, now shipped as standard, with 
/sap/bc/apc_test/ping_pong/game
/sap/bc/apc_test/ping_pong/player

One day, I could imagine having 2 terminals, one for each player, which updates a third terminal.

Sorry about the video quality, I guess Youtube are running out of space, but you can basically see what's going on!

Thursday, 18 June 2015

PI Java Editor - Security Refusal

Ah, security, eh... doing a great job of preventing malicious parties doing stuff to your system. Throwing the baby out with the bathwater, they also prevent ABAP Heroes, such as ABAPGirl and OSSBoy and Mr SMARTForms from doing their thing...

When trying to access the PI Development environment ( Java ) we recently encountered this:

"Your Security Settings have blocked a self-signed application from running"





Which was fixed by lowering security settings (the cavalier approach) or adding the PI server to the exceptions list (the RIGHT way!).

This is done by going to Control Panel - > Java -> Security



Nice and easy!