letronas
letronas

Reputation: 153

How to add a table data to transport request programmatically?

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.

Upvotes: 1

Views: 2998

Answers (1)

Suncatcher
Suncatcher

Reputation: 10621

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.

Upvotes: 0

Related Questions