1 1 1 1 1 Rating 0% (0 Votes)

Round can be used for decimal fields that have no assigned QFIELDNAME or CFIELDNAME fields. Its purpose is to move decimal places left or right. If you want to move decimal places left, then you have to put there positive numbers, if you want to move decimal places right, then use negative numbers.

Example when you use 0 as round, you’ll get the normal full numbers, the display of the field hasn’t changed.

 

  

Figure 29 ZDEMO_AIN_CL12 Results using 0 as P_ROUND value

Now the same program is run with 3 that is inserted into ROUND. You can notice that instead of 2 571,25 you can see 2,5723, so the comma sign was moved left by 3 positions.

 

Figure 30 ZDEMO_AIN_CL12 Results with 3 as P_ROUND value

Also changed output is visible when you use negative values. This time -5 was used. You can see on image below that instead of 2 571,25 you can see 275 225 000.

 

Figure 31 ZDEMO_AIN_CL12 Results with -5 as P_ROUND value

In each case the value in the internal table was the same 2 571,25.


Add a comment

1 1 1 1 1 Rating 0% (0 Votes)

QFIELDNAME has the same meaning for quantity fields, like CFIELDNAME for amount fields. This means that we can setup in which column of internal table the information about unit of measure is kept. On the base of that information, data can be displayed differently in each row, as in comparison to QUANTITY the unit is not set for the whole column. In program ZDEMO_AIN_CL11 I’ve setup column DISTID to be used as QFIELDNAME for DISTANCE.

 

Figure 27 ZDEMO_AIN_CL11 FCAT with QFIELDNAME

As you can see in the Figure 27, the quantity is displayed differently on first and second row. This means that our field catalog setting is working correctly.

 

Figure 28 ZDEMO_AIN_CL11 Results using QFIELDNAME


Add a comment

1 1 1 1 1 Rating 0% (0 Votes)

This field is used to setup exponent number display for floating point decimals (F) fields. Although it’s not that commonly used field type for display, then it’s important to know that you can manipulate how the field is displayed in ALV grid.

For example, the picture below, shows the results of the ALV output when EXPONENT field was set to 2.

 

Figure 32 ZDEMON_AIN_CL13 Results with P_EXP parameter value set to 2

 

On next picture the results of the ALV output when EXPONENT field was set to 3.

 

Figure 33 ZDEMO_AIN_CL13 Results with P_EXP parameter value set to 3

As you have noticed the value 2 572,25 that you can find in the internal table, will be shown differently but it’s showing exact the same number.

 


 

Add a comment

1 1 1 1 1 Rating 0% (0 Votes)

If you want to setup current field as a key one, you need to fill KEY with ‘X’. When you’ll do this then the field will have blue background and during horizontal scrolling the column will be fixed.

 

Figure 34 ZDEMO_AIN_CL14 Results with CARRID field set as key one

 


 

Add a comment

1 1 1 1 1 Rating 0% (0 Votes)

The description of this fields claims that if you put ‘X’ inside then current field will became a key field that can be hidden, but in fact it has no effect here, as standard key field can always be hidden. As you can see also in the picture bellow, it doesn’t even mark field as a key one.

 


Figure 35 ZDEMO_AIN_CL15 No effect after setting KEY_SEL to 'X'

 


 

Add a comment

1 1 1 1 1 Rating 0% (0 Votes)

If you want to display an icon inside the cell, then you need to setup a value of this field to ‘X’ and additionally you need to put an icon from type-pool ICON into the corresponding field of your internal table. The corresponding field should be an CHAR4 field. You can use of course the domain ICON_D as well. In my example I’ve filled all rows with the same icon (ICON_ABAP) during the selection of data into internal table, but in productive programs, you’ll probably do this during the loop over internal table, as probably you’ll want to setup different icons for a row, depending on the content of other field.

 


Figure 36 ZDEMO_AIN_CL16 Select with ICON_ABAP

 

Figure 37 ZDEMO_AIN_CL16 Results with ICON

To visualize all available icons, it’s enough to go to SE16 or SE16N and display the content of a table ICON. You’ll see then how icons looks in your current SAP GUI theme.

 

Figure 38 Content of ICON table

 


 

Add a comment

1 1 1 1 1 Rating 0% (0 Votes)

This field has similar functionality like ICON but instead of better looking icons, you can choose to display old-style ASCII symbols from type-pool SYM. Like in an example of ICON you have to setup the fieldcatalog value for field SYMBOL to ‘X’ and in the corresponding field of your internal table, you have put the value of the symbol. The corresponding field should be CHAR1 field.

 

Figure 39 ZDEMO_AIN_CL17 ALV with symbols

 

You can check the available symbols on your system, but I doubt they vary between old and new releases.

Figure 40 Possible symbols in ALV Grid

 


 

Add a comment

1 1 1 1 1 Rating 0% (0 Votes)

The name of this field says almost everything about it. If you put an ‘X’ in it, then the column will be displayed as checkbox. The type of the field which is used as checkbox should be set to ABAP_BOOL or any other CHAR(1) type.

If you use editable grid then once the checkbox is checked, the cell of the table behind it will be filled with value ‘X’.

 


Figure 41 ZDEMO_AIN_CL18 Checkbox on editable grid

 


 

 

Add a comment