Complex parameters in remote functions

images/thumbnail.jpg - Thumbnail

Remote function calls (by RFC) do not support parameters with complex structures (deep structures). In other words, if any of the parameters has a structure in which one of the fields is another structure or an internal table then, hard luck, it won’t work.

Do you give up? No, you don’t. Abapinho provides the solution: serialization.

F1 in the selection screen fields

images/thumbnail.jpg - Thumbnail

You have just produced a wonderful report headed by a selection screen crammed full of very interesting fields. But usually those running the report will not know, if it has some complexity, what each of the fields does. There are, of course, the technical and functional specifications for this. But are there? And even if there are, wouldn’t it be easier if you could press F1 on top of each field and find out there and then what it’s for?

I’ll show you two possible ways to give individualized information about the fields of a selection screen.

Finally ABAP knows Excel

images/thumbnail.jpg - Thumbnail

There are various ways of creating an Excel spreadsheet in ABAP. Some are more masochistic than others and some are certainly more lousy than others.

Happily jumping from line to line

images/thumbnail.jpg - Thumbnail

At the bottom right corner of ABAP editor, right in the status line, you can check in which line and column the cursor is. By double clicking over that information a dialog box is shown and you will be able to introduce a line number to it skip directly. The short key is CTRL-O. It’s very helpful. Thank you Fábio Branquinho for the tip. And thank you to juandesant for the photo.

Menu search

images/thumbnail.jpg - Thumbnail

Did you know that is possible to search in SAP menus? Probably yes. Well, I didn’t. I’ve spent years looking through menu S000 searching for the most random stuff imaginable. I’m sure that if I had done menu search I would have found most of them in seconds. Sometimes you just don´t think of the obvious. Thank you Sérgio Fraga for the tip. Greetings from Abapinho.

Dot and comma or comma and dot?

images/thumbnail.jpg - Thumbnail

Some numbers have dots, some numbers have commas and some numbers have dots and commas. The problem is that there are also numbers that have commas and dots. The thing is, there are commas that are dots and dots that are commas, depending on where you are from, in other words, depending on user’s configurations. When importing a file with decimal numbers, these numbers’ alpha-numeric fields must be converted into numeric fields.

More RANGEs, less SELECTs

images/thumbnail.jpg - Thumbnail

The dictionary has the following entry for “style”: “set of formal aspects and expressive resources that characterise a text.”

It is preferable to read a text with style than one without. If ABAP were a language, a program in ABAP would be a text. When it comes to style, there are programs that seem to have been written by the feet, while there are others that one would swear the quill that wrote them was guided by the pure hand of an eighteenth century lady plagued by the troubles of love. Fortunately, I think it’s not possible to write programs in ABAP as tacky as the last sentence.

The “style” label is used here in Abapinho to identify articles that talk about just that: style. These articles try to find ways to improve the style of ABAP programs. This is one of Abapinho’s favourite labels, as you can see here. And what you are reading is another of those articles.

Moving on.

Follow your fingers

images/thumbnail.jpg - Thumbnail

I have a number of friends working as managers, lawyers, marketers, programmers, etc., at very dynamic and competitive companies who are allegedly very busy and are always up to their eyeballs in work. They dedicated several years of their lives to their degrees in order to specialise in a particular field and some of them have put in the extra effort to get a postgraduate diploma in order to be better qualified and therefore able to do more both better and faster. However, the vast majority of them use two fingers when typing at a computer. Over a number of years they have acquired many skills that supposedly make them ultra efficient and yet they still type with two fingers.

<!--:pt-->Curso ABAP em São Paulo - 10% de desconto!<!--:-->

images/thumbnail.jpg - Thumbnail

(actualizado em 16 de Junho) Queres aprender ABAP e moras em São Paulo? Se sim, aqui está a tua oportunidade. ZTREINAMENTO vai realizar um curso de 8 6 semanas que custará R$1.200,00 R$750,00 e é adequado a pessoas sem qualquer conhecimento de ABAP. Serão abordados os seguintes temas: Entendendo alguns conceitos de ABAP Comandos básicos Data Dictionary Trabalhando com funções Trabalhando com module pool

Slash O

images/thumbnail.jpg - Thumbnail

Throughout all my “SAP life” I’ve used the command /olalala to initiate the lalala transaction in a new GUI window. Until now I had never tried just writing /o. I did today. The result was interesting. Meaning, it’s the same as going to SM04 and then choosing our user. But much easier. Greetings from Abapinho

Gregarious constants

images/thumbnail.jpg - Thumbnail

If you are one of those who insert the values directly in code instead of using constants, then read no more and go and stand over there in the corner on punishment for 1 hour to learn not to be lazy. If you’ve come back from punishment or you usually use constants, then please continue reading.

Your password has expired. Change it 5 times.

images/thumbnail.jpg - Thumbnail

It is not uncommon for us to be emotionally attached to our passwords. Therefore, it is always rather painful to receive those despicable threatening notices that say “your password is going to expire”. Soon followed by the blow we receive to our heart on the appearance of the inevitable vile invective that “your password has expired.” At such times, the hurt is so great that all the muses leave us, we have imagination cramp and remain stuck there, staring and drained, emptied of any idea to help us choose our next password.

Insert variables in standard texts

images/thumbnail.jpg - Thumbnail

Everyone uses standard texts. But did you know that standard texts can have dynamic fields in the middle? SAP calls them “text symbols”. The way to do it is identical to that of the old forms of the harmful SE71, in other words wrapping them in the & symbol. Thus: &KNA1-NAME1;&. It’s really handy. I’ll show you how it’s done.

Client or Customer?

images/thumbnail.jpg - Thumbnail

Wherever you use the data element KUNNR, its descriptions is “Client”. And what if we wanted to change this field description from “Client” to “Customer”? “Customer" is so much nicer! Or let’s suppose that the company you work for is trafficking in drugs and tells you that they want “Dealer” rather than “Supplier” to appear in the LIFNR field. Obviously we can label it as we wish on screens and Z reports but what about standard transactions?

Adding buttons to the selection screen

images/thumbnail.jpg - Thumbnail

Normally, when buttons must be generated for users to click, Screen Painter is used to create a screen which is then invoked by the report using CALL SCREEN. But, unless the screen being designed is already quite complex it is pointless creating a screen which will have no further use. Screens have always annoyed me.

I will demonstrate an example of using buttons on a completely normal selection screen resorting to a button called PUSHBUTTON and a very clever trick called ONLI.