官术网_书友最值得收藏!

Introduction

This chapter explores recipes related to the ALV displays. We will start with a simple requirement with basic ALV displays. We will then enhance the basic ALV program by hiding few columns from display as well as from the initial layout. We will then see a recipe showing how to save user-specific layouts. Adding buttons to standard ALV toolbars will be shown, along with checkboxes and hotspots displayed within ALV columns.

For this chapter, I assume that the reader has basic knowledge of the ABAP objects, the ALV object model, and is familiar with basic ALV creation using CL_SALV_TABLE. Also, the reader should have knowledge of creating and changing of GUI status, and should have knowledge of Ranges and Select-Options.

For the sake of this chapter, we will make a simple example that will display data into an ALV format. This will be used in all the recipes mentioned in this chapter.

Introduction

In this example, we declared a data structure type containing simple important fields of table PA0008. We then declared an internal table and a work area based on this type.

We selected 15 rows from the table PA0008 and stored them in the internal table.

The factory method is then called of the class CL_SALV_TABLE for instantiating the ALV object. The GET_COLUMNS method is called in order to get the columns object of the ALV. The SET_OPTIMIZE method of the columns object is used to optimize the column width.

Likewise, the GET_FUNCTIONS method provides access to the ALV's functions' objects. We then set all the functions using SET_ALL method. Finally, ALV is displayed using the DISPLAY method.

Introduction

Note that until this point, the ALV toolbar does not have a layout save button. No fields are defined as keys (no blue colour). The Amount column displays 0.00 and not blank in case the value is initial. No hotspots or checkboxes are enabled in the columns. In the next set of recipes, we will see systematically how each of these options may be added.

主站蜘蛛池模板: 天柱县| 珠海市| 乌鲁木齐县| 林州市| 福州市| 沙坪坝区| 永善县| 澄迈县| 建阳市| 武宁县| 家居| 怀柔区| 夏津县| 胶州市| 梁平县| 安义县| 思茅市| 延边| 盱眙县| 龙川县| 会泽县| 天峨县| 常州市| 昭苏县| 瑞安市| 远安县| 江达县| 大宁县| 宁武县| 英吉沙县| 锡林浩特市| 五常市| 吕梁市| 定陶县| 德安县| 乡宁县| 开鲁县| 彭水| 客服| 吴忠市| 苍梧县|