Professional Documents
Culture Documents
Steal Data From A SALV
Steal Data From A SALV
"
Supported by
A friend of a friend of a friend said that a friend of his knew a friend who explained to him in a shady club bar in the docks
area of Lisbon how to steal data from a SALV.
Let’s assume there already exists a programme that displays your results in a SALV and they ask you to do something
more to those data. Such as saving them in a file, or whatever. Until a short while ago, I thought I would have to change
that programme and add some code to it before it presented the ALV, then get the data and do what I wanted with them.
But imagine it’s a standard programme that cannot be changed. What do I do? Make a copy of the standard? That’s
something to always be avoided.
The trick is to manipulate the environment around the ALV to ensure it is not displayed and then, without the SALV even
noticing, go and get the results from the memory. It’s farfetched, but nothing complicated. I’ll teach you how it’s done:
The first deception is to run a very special command that causes the data of the SALV not to be displayed.
cl_salv_bs_runtime_info=> set(
display = abap_false
metadata = abap_false
data = abap_true ).
Now that the environment is controlled you can order any programme to run that displays a SALV. Only, it won’t be
displayed. So, you can do something like this:
This report usually ends with a SALV. But not this time. This time it ends in silence.
Finally, to obtain the SALV data you need a second deception, a genuine sleight of hand:
http://abapinho.com/en/2013/10/roubarsalv/#more2444 1/4
7/3/2015 Abapinho » Arquivo » Steal data from a SALV
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = ls_data ).
ENDTRY.
And hey presto! The data of the SALV are in your possession. Now you can use them as you see fit:
Note that the GET_DATA_REF() method launches the exception CX_SALV_BS_SC_RUNTIME_INFO if something
fails, so it would be convenient to wrap your call in a TRY CATCH block.
Thank you Luís Rocha for sharing the information from your friend’s friend of a friend of a friend.
Like 11 people like this. Sign Up to see what your friends like.
Obrigado Adriano! Era um problema de HTML que impedia mostrar os fieldsymbols. Agora, espero eu, já está ok.
Muito bom!
Mas acho que seria uma boa ideia executar o método: cl_salv_bs_runtime_info=>clear( ) depois desse roubo, para
não deixar rastros! Concorda?
:D
Caso contrario o usuário não vai poder executar nenhum ALV nesse ambiente até que seja feito um novo login.
http://abapinho.com/en/2013/10/roubarsalv/#more2444 2/4
7/3/2015 Abapinho » Arquivo » Steal data from a SALV
Deixe um comentário
Nome (Obrigatório)
Página pessoal
Submeter comentário
Categories
Articles
Best practices
Código
Tips & Tricks
Stories
Notícias
Archives
Archives Select Month
Links
ABAP Ninja
ABAP Zombie
jobserve
OnSAP
Pedro Lima
SAP Notes Search
SAP Sites Updates
SDN
Pesquisa
ok
Português English
http://abapinho.com/en/2013/10/roubarsalv/#more2444 3/4
7/3/2015 Abapinho » Arquivo » Steal data from a SALV
About Abapinho
Abapinho runs on WordPress
Articles (RSS) e Comments (RSS).
http://abapinho.com/en/2013/10/roubarsalv/#more2444 4/4