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: 

ALV Report Background Run (column-width)

Former Member
0 Kudos

Hi All,

I am having a problem with ALV report, I would like to know when i am running the report in the background can i adjust the column-width, I don't want to use the optimized column width.

When i run the report in the foreground also and select the printpreview the column with gets optimized even after i have a different width in my layout. I have to manually change the width again in the print preview and take a print. else my spool will have the optimized width.

Please suggest a solution at the earliest as it is a production issue.

I would highly appreciate you help.

Thank you,

Hamid.

11 REPLIES 11

Former Member
0 Kudos

I hope I have understood you right, "You do not want to optimize the column width!"

If so.....

<b>layout-colwidth_optimize = space.</b>

Rishi

0 Kudos

Hi Rishi,

Thank you for ur reply.

U have partly understood my problem, it is right that i don't want to optimize the column width, and have already done the layout description u mentioned, the issue is even after this declaration when i run my report in the background the column width gets optimized. All other settings of my layout like number of columns etc are coming good but the width of the column is getting optimized.

Even in the foreground when i print the displayed report (with column width maximized) it is giving me an optimized column in the print out. The only option i have is to go to print preview then change the columnwidth and then print.

I hope u have understood my problem more clearly,

Thank you once again

Hamid.

0 Kudos

Now I get it, You want to set the width (layout X_65_80) of the spool request.

Try 2 things.

1. Remove the LINE-SIZE parameter from the REPORT statement in the program.

2. Specify the layout (X_65_80, etc.)in the print parameters when creating the background job. (If the columnwidth_optimize option is not set in the layout, the Output has a fixed width)

Good Luck!

Rishi

0 Kudos

Hi Rishi,

Thank you for ur reply,

I have posted the solution to remove column-with optimizing for printing in background. You can check it out.

Thanks

Hamid.

Former Member
0 Kudos

Hi,

While running in background u cant adjust the width in the spool.The output in the background may not contain some columns too if u r having many number of columns.

This is because there is a <b>limit to display the output</b> in the spool.

I too have the same problem.

Thanks & Regards,

Judith.

0 Kudos

Hi Judith,

Thank you very much for the reply.

I guess you are right, the only doubt i have is that since i can change the column width in the print preview and get the desired width in the spool, am i not missing something.

Thank you,

Hamid.

0 Kudos

Hi,

It is not possible to change it in the spool.

Hope you got it.

Thanks & Regards,

Judith.

0 Kudos

Hi Judith,

Thank u for ur reply,

I have found the solution, you can change the column-width in the spool by removing the column-width optimizing for printing, you can do this as follows.

Declare a variable of type LVC_S_GLAY

Assign the variable with -NO_COLWOPT = 'X'.

Then assign variable to the field I_GRID_SETTINGS ln REUSE_ALV_GRID_DISPLAY FM.

Once u have done the above you will get the column-width u save in ur layout of the report. It works for both foreground and background printing, u don't have to manually change the column-with in the print preview.

Hope this will solve your problem too.

Thanks

Hamid.

0 Kudos

Dear Hamid,

I had issue with spool data getting truncated while being displayed correctly in ALV. Your solution of setting field I_GRID_SETTINGS worked perfectly for me.

You made my day.

Thanks,

Aspire

0 Kudos

hii Hamid,

good solution provided by u.

It helps a lot

Thanks & regards.

Syed

0 Kudos

Hi Hamid Jabri,

Thanks for your post..Its worked for me.

Regards,

Hiriyappa