Thursday, June 27, 2013

SAP ECC6.0 : LINE-SIZE and LINE-COUNT in any location.

I have to admit, these LINE-SIZE and LINE-COUNT has never come into my mind that one could put it anywhere in the coding but not at the REPORT syntax at the the first line. Nevertheless, the placement and its' way of usage had caught me by surprise. 

One of my assignments was to remove "Deleted" parts (line items) from a report. These parts, deleted, meaning no longer active or exist in the factory. All I had to do was to put in a line of code to remove this parts. That is simple. Unfortunately, this report did not properly optimized its' column width. The program was already coded in such a way it only use ALV fieldcat's output length to size its' own column. This is okay for me as long as the report work perfectly and beautifully but some of the columns were too tight. As a result of it, some values were chopped off by the ALV report. 

One way to lengthen this to display all the columns nicely is to increase the output length. Another way is to use back the DDIC structure's declared type's length (using "REUSE_ALV_FIELDCATALOG_MERGE" function module[1]). Both of these are fine way to adjust an ALV report column. However, both were not feasible at the moment. Why? There's only one reason to this and it is due to the LINE-SIZE that was initially declared in the REPORT heading. 

Generally, at one glance, one would assume, that this report does not use LINE-SIZE and LINE-COUNT too. This very report proved me wrong. W-R-O-N-G. The LINE-SIZE was strategically placed at a few locations because this is due to report types. Different report type sometimes prefer different type of LINE-SIZE. Here it goes. Now I know. I see. Mystery is solved. The LINE-SIZE was at another location.

Sources : 
[1]. For all SAP ALV Samples, go to SE80, select Package, and put "SLIS", and press Enter.

williamwilstroth... LINE-SIZE