I have ALV layouts saved in a system where data was present but it is not possible to transport those variants from the testing system (system where test data is present). So I have to create same layout variants in development system which is not possible due to lack of test data. Please provide a way to achieve this.
As far as I know there's no standard way to do this. If there's not many variants I suggest you to copy brainless. (I think you can reproduce every layout options without any data) For many variants to copy you can write a program to upload to the DEV system for time-saving.
Please be careful with this because it modifies standard tables! The system version, ALV structure should be identical and previous records of variants should not be present, otherwise the result is unexpected!
SAP stores ALV variants in tables LTDX and LTDXT. LTDX contains the variant properties in RAW format. You can download the raw data with SE16 to a tab delimited file from the test system and upload with a developed program to the developer system.
Don't use this program to upload to productive or other systems, go with transporting, use program
RKKBALVI
. Always try the results after uploading to developer, always!
The LTDX-RELID is always 'LT' and the LTDX-REPORT is the program's name you are interested in. Don't forget to edit the file to suit your needs (for example remove the headers and mandant if needed). When you check the downloaded file you can see the raw hex dump of the CLUSTD field.
The concept comes from the idea that you can move HEX content easily from a string type to a binary type field. See this example taken from a little example program in debugger. ('41424150' in HEX = 'ABAP' in ASCII)
So you have to develop a program to upload the contents of the downloaded files to LTDX and LTDXT with cl_gui_frontend_services=>gui_upload
but defining the import structures's CLUSTD field as string first. When you imported the data you can move the contents to the real LTDX structure and update the table.