Thursday, 26 June 2014

How to create a new SU01 User Parameter ID...


How to create a new SU01 User Parameter ID...
The requirement was to have something against the User Master Record that we could use to differentiate between users when MIGOing stuff. I tried just entering the new value, but I needed to make an SM30 entry in table TPARA first!

Wednesday, 25 June 2014

QR Code Reader in an SAP Personas Screen


This was achieved by Personas calling using an HTML5 BSP with JavaScript library in which employed the camera on an HP Slate. Meanwhile, the Personas screen sent a call to a Web Enabled RFC, which waited for the response from the HTML5 page.

Tuesday, 17 June 2014

Printing a QR Code in a SMARTForm

Here's a great blog from a guy who's managed to get a QR Code output onto a SMARTForm.
Essentially, he:

  • uses a Google Charts API to generate the QR Code, 
  • reads the content of this in using the HTTP_CLASS. 
  • transfers this content to a nominal bitmap file on SAP
  • refers to this file in the SMARTForm

http://scn.sap.com/docs/DOC-47644

It's so pretty. Again, great work to the author.

Generic Object Services - Adding a URL Link to an SAP Document

In this case, a Finance Invoice visible in transaction MIR4.

http://subrc0.wordpress.com/2012/11/13/gos-adding-an-external-link-to-an-object/

Absolutely fantastic work by the author, props.
Nothing really to add to that, the use case is described excellently at the link.

Monday, 2 June 2014

Using CSS in SAP UI5

Okay, so it's been a while; as usual! In this post, I explain how to use CSS to affect the screen elements in your UI5 application.

If you're new to UI5, the tutorials here are absolutely invaluable. After much boshing around, I found this one to be the one that I refer back to the most. The "create a ui5 app in 20 seconds" claim is a bit of misdirection in my eyes; true, you are referring to the UI5 library, but you're not talking to a backend, you're not even deploying it anywhere useful (unless you put it in your dropbox folder or some-such). The step between that and the actual application is a little big, and I could have done with a bit more hand-holding, but got there in the end.

I've now developed a few UI5 applications that "do stuff"  in SAP.

So, what did I solve today? I'd used the responsive layout container  but found that a dropdown in the layout kept on overflowing over the end of where I wanted it to be.




In order not to disrupt the flow of the program, I added in the CSS at the top of the HTML, where one would normally put it in... instead of with the JS declaration.

new sap.ui.layout.form.FormElement({
      label: "Status : ",
     fields: [ oDropdownBox2 = new sap.ui.commons.DropdownBox({layoutData: new sap.ui.layout.ResponsiveFlowLayoutData({weight: 1}),
         id: "DropdownBox2",})],

 layoutData: new sap.ui.layout.ResponsiveFlowLayoutData({linebreak: true, margin: false})

})

The above is the JS declaration of the screen object. I've highlighted the id, because that gets used in the CSS...

<style type="text/css">
#DropdownBox2 {
width: 100%;
max-width: 200px;
min-width: 60px;

}
          </style>

And hey-presto, the dropdown is behaving itself again:


Now I'm sure that there are better ways, but since this works, for now I'll use it until someone corrects me and tells me otherwise! Before anyone asks, I did try changing the weight of the responsiveFlowLayoutData and putting in CSS against the actual declaration, but none of those appeared to have any effect. Try it for yourself!

Tuesday, 6 August 2013

Coding for the Editor?

Note the title. Not Coding IN the Editor, Coding FOR the Editor.
Alright, I'm sorry. You're used to high-grade, good quality tutorial stuff. This is more of a musing / comment.

I find myself doing same-same stuff all the time - tidying up code so it lines up nicely ( a pretty printer that works, anyone? ). 

It'd be super awesome if the editor had some kind of development framework so you could record macros, and then edit the code those macros created... Kind of like VBScript?

An obvious example would be you paste a list of fields from a data dictionary structure. A popup could come along and ask what the WorkArea field was, and prefix the fields; then all you'd need to do would be populate the fields... saving you literally minutes every time you do it!