Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Copy User Specific ALV Display Variants

Former Member
0 Kudos

Does anyone know if it is possible to copy one user's ALV display variant (that has been saved as a user-specific variant) for a particular program (in this case VA05) to another user?

1 ACCEPTED SOLUTION

0 Kudos

Hi,

Try This Program

report copy_layout.
data : lt_ltdx like ltdx occurs 0 with header line.
data : lt_ltdxt like ltdxt occurs 0 with header line.
parameters report like ltdx-report obligatory.
parameters report2 like ltdx-report obligatory.
"copy layout of report to report2.

start-of-selection.
  select * into table lt_ltdx from ltdx
                where report = report.
  select * into table lt_ltdxt from ltdxt
                where report = report.
  loop at lt_ltdx.
    lt_ltdx-report = report2.
    modify ltdx from lt_ltdx..
  endloop.
  loop at lt_ltdxt.
    lt_ltdxt-report = report2.
    modify ltdxt from lt_ltdxt..
  endloop.
  message 'Copy Complete.' type 'I'.

4 REPLIES 4

Former Member
0 Kudos

Hi Eric,

I'm a bit busy now and I cannot give you a complete solution, but sure can give you some c(l)ue. Just see if you have some success. If you do not, then i wuill get back to you later.

Refer to the follwoing SAP Tables and see if you have some luck.

==========================================================

LTDX --> Generic storage of display variants

LTDXD --> Default display variants

LTDXS --> SAP Default Display Variants

LTDXT --> Display variant texts

==========================================================

The idea is to try and manipulate the table entries for various users.

Regards,

Anand Mandalika.

0 Kudos

Hi,

Try This Program

report copy_layout.
data : lt_ltdx like ltdx occurs 0 with header line.
data : lt_ltdxt like ltdxt occurs 0 with header line.
parameters report like ltdx-report obligatory.
parameters report2 like ltdx-report obligatory.
"copy layout of report to report2.

start-of-selection.
  select * into table lt_ltdx from ltdx
                where report = report.
  select * into table lt_ltdxt from ltdxt
                where report = report.
  loop at lt_ltdx.
    lt_ltdx-report = report2.
    modify ltdx from lt_ltdx..
  endloop.
  loop at lt_ltdxt.
    lt_ltdxt-report = report2.
    modify ltdxt from lt_ltdxt..
  endloop.
  message 'Copy Complete.' type 'I'.

0 Kudos

Thanks Mehmet,

Your program has worked for me

0 Kudos

Thanks, this program work fine.