1

I have a task to add selected rows from alv grid to the transport request.

At this moment I already have:

  1. Name of transport request

  2. Selected rows (I put them in a table because I don't know what the type they should be if I want to put them into the transport request):

First I get indexes:

call method grid->get_selected_rows                        
  importing
    et_index_rows = lt_rows.

Second I get rows that I need and put them into a new table:

    if lt_rows is not initial.                           
      loop at lt_rows into ls_row.
        read table lt_variable index ls_row into ls_variable.         
        append ls_variable to lt_variable_changed.
      endloop.
    endif.
  1. As I understand I need to use all of this in the function TR_OBJECTS_INSERT, but unfortunately I didn't get any information that could help me to understand that I did it correctly.
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
letronas
  • 145
  • 1
  • 13
  • Does this answer your question? [Add table rows to the transport request](https://stackoverflow.com/questions/51672657/add-table-rows-to-the-transport-request) – Suncatcher Jun 01 '20 at 14:52

1 Answers1

0

What is the critical need of transporting data in runtime? It is unstable and not recommended.

Just create customizing table in Data Dictionary and insert necessary ALV grid rows to it in runtime.

Then use transport with object type R3TR-TABU to move that customizing table to another system. Do it in batches, not by pieces of 2 or 3 rows like you want.

enter image description here

Here is the full tutorial.

But it's a bad practice to do like this. Replicating data across the landscape in a regular manner is a BASIS task and should be done by BASIS, not by developer.

And replicating rows of business data in runtime is a horrible practice.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • In any case i need to do this task and i don't know how to do it with several lines of the table. Thanks a lot for tutorial, but it'll be go if you wi'll give me some links for a bad practice code that can help me to solve this problem that my mentor gives by (i'll read your link ofc). Maybe you know ways how do to this in real time? Thanks! – letronas Aug 01 '18 at 17:07
  • 1
    I've never done it such way I do not recommend you too. And run away from such mentor. – Suncatcher Aug 02 '18 at 06:26