Tag > segredo
Supported by
Supported by Inetum

How to sabotage tables

images/thumbnail.jpg - Thumbnail

Another article to help those who are into sneaky subversion Spies, take note on how to edit a table that cannot be (and probably shouldn’t be) edited. I’ll show you three techniques. The first stopped being useful a few years ago, the second is about to become obsolete and the third, well, we’ll just have to see for how long it will work. 1. SE16 /H OK_CODE EDIT The first technique dates back to the twentieth century and uses the old transaction SE16.

When an internal table is not structured

images/thumbnail.jpg - Thumbnail

When you want to select some lines in an internal table you normally do something like this: DATA: BEGIN OF itbl, campo1 TYPE c, campo2 TYPE c, END OF itbl. READ TABLE itbl WITH KEY campo1 = 'X' campo2 = 'Y'. LOOP AT itbl WHERE campo1 = 'X' and campo2 = 'Y'. COISO. ENDLOOP. But what if the table is not structured and you want to search on the line as a whole?

Create test variants within functions from the debugger

images/thumbnail.jpg - Thumbnail

Imagine that you are debugging a transaction, you enter into a function and find something interesting. So interesting that you have to debug it several times. The conventional way is to start the debug of the transaction again from the beginning. How tedious.

But there is a more direct route. When you are debugging a function you can create test data for this function directly from the debugger, using the values with which the function had been called at that time. For instance:

The SAPGui history does not work even when active?

images/thumbnail.jpg - Thumbnail

Has it ever happened to you that SAPGui does not store a history of values that you input to various fields even though the History option is actived in the settings?

Debugging while in modal dialogue boxes

images/thumbnail.jpg - Thumbnail

There are times when you can’t do /H to launch debugger. The most common one is when a pop-up window is open. However there is a simple, if Heath-Robinson, way to do it:

Global macros

images/thumbnail.jpg - Thumbnail

In a previous article we talked about macros, a relatively obscure and little used feature that can be both useful as well as create a huge mess. But these aren’t the only ABAP macros. There are others that are even more obscure and with even greater potential to mix up a system: the global macros. I don’t know if I should tell you this, as it’s so strange… But, I don’t think it’s a good idea to hide it… Therefore, I’ll tell all.

Start on the right footing

images/thumbnail.jpg - Thumbnail

Normally when you log on to SAP the SAP menu appears. But you can use the function module NAVIGATION_SET_START_TCODE to pre-set an initial transaction. Anyway, it’s better to know it’s there than not to know it’s there, and even better than knowing that it’s not there. Who knows – it could be good for some users. There’s also the function module NAVIGATION_GET_START_TCODE to see what is pre-set. Greetings from Abapinho.

Not even David Copperfield would do better

images/thumbnail.jpg - Thumbnail

Sometimes we want to access a transaction and we don’t have permission. That’s annoying. Luckily there’s the function module ALINK_CALL_TRANSACTION which makes things better. But use it with care or someone will get angry. Welcome to the dark side of Abapinho. If they say it was me that said it, I deny everything. Update: this function module will also do the trick: CALL_TRANSACTION_FROM_TABLE. New update: if all the above fail try this other function module: RS_HDSYS_CALL_TC_VARIANT (clearing flag AUTHORITY_CHECK).

<!--:pt-->Testar na SE37 não grava dados? Grava.<!--:-->

Uma forma prática de aprender a usar um módulo de funções ou verificar se este nos é útil é através da funcionalidade de teste da transacção SE37. Escolhe-se o módulo de função, faz-se F8 (Executar) e tem-se uma forma interactiva de testar uma função. Isto é óbvio. O que não será óbvio para toda a gente é que este teste não faz COMMIT à transacção e, por isso, qualquer alteração que a função possa fazer à base de dados - como gerar um documento por exemplo - não é gravada.

<!--:pt-->A transacção N<!--:-->

É intrigante o porquê de, nos dias que correm, a transacção SE16 continuar a ser tão utilizada, quando já existe há tantos anos uma muito melhor, a SE16N. A transacção SE16N tem mais: sainete: tem um interface mais dinâmico e sofisticado; simpatia: mostra em simultâneo a descrição funcional e o nome técnico dos campos; sabedoria: mostra em simultâneo o valor interno e externo dos campos com rotinas de conversão;