• Home
  • About me
  • FALV
  • ALV Grid in the nutshell
    • Basic Information
    • Field catalog
  • Articles
    • Tricks
    • FALV (Fast ALV Grid)
    • ALV Grid in the nutshell
    • Tips
    • How to...
    • For beginners
    • Thoughts
  • By Topic
    • ALV
    • ALV OO
    • SALV
    • GOS
    • Selection screen
    • Purchase Requisitions
    • Purchase Orders
    • Attachments
    • Others
    • Characteristics
    • Sample Programs
    • ZIP
    • OLE
    • Mails
    • Routings
    • EWB
    • Excel
  • Keywords
  • RSS
  • Download
  • Home

ALV Grid in the nutshell: Field catalog - emphasize

Details
Łukasz Pęgiel
ALV Grid in the nutshell
01 July 2019
Hits: 48960
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , EMPHASIZE , ALV GRID

EMPHASIZE allows you to change the colour of the whole column if there is such need.

This field can be filled with following values:

  • Space - this means you use the standard behaviour of ALV grid
  • ‘X’ – you use standard emphasize (default colour)
  • ‘Cxyz’ – where:
    •  ‘C’ is a character that notifies ALV grid that you will use specific colours
    • x – contains one of the following colour numbers:
      • 0 - background colour
      • 1 - blue
      • 2 - gray
      • 3 - yellow
      • 4 - blue/gray
      • 5 - green
      • 6 - red
      • 7 - orange  
    • y – is saying if the colours are intensified (‘1’) or not (‘0’)
    • z – is saying if the colours should be inverted (‘1’) or not (‘0’)

 

 

Figure 59 ZDEMO_AIN_CL25 Emphasize set for columns

 

 

Figure 60 ZDEMO_AIN_CL25 Results of column colouring

 

Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - edit_mask

Details
Łukasz Pęgiel
ALV Grid in the nutshell
28 June 2019
Hits: 16474
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , EDIT_MASK , ALV GRID

If you are familiar with the WRITE statement, then probably you know the EDIT_MASK addition which allows us to do formatting of the output in two different ways, you can apply the same to the EDIT_MASK of field catalog as well.

  1. Using Conversion-Exit, for example ‘==ALPHA’, where ‘==’ sings represents the information that we’re using conversion-exit, and the next 5 characters are reserved for the conversion-exit name.
     
  2. Using manual mask, where you can use following possibilities:
     
    1. Each underscore character (‘_’) in the mask will be replaced by the characters of the source field
       
    2. ‘LL’ on the beginning of the mask means that the underscore characters of the mask (“_”) will be replaced starting from left side, for example mask ‘LL__:__’ for value 123 will be displayed as ‘12:3 ’.
       
    3.  It’s also default setting for the mask so no need to use it in fact.
       
    4. ‘RR’ on the beginning of the mask means that the underscore characters of the mask will be replaced starting from the right side, for example mask ‘RR__:__’ for value 123 will be displayed as ‘ 1:23’.
       
    5. ‘V’ in case of quantity or amount fields is a place where the sign of the number should be displayed, for example mask ‘V__,__’ for number -1234 will be shown as ‘-12,34’.
       
    6. Any other characters will remain unchanged, means you can also build some extraordinary outputs, for example mask ‘Flight Number is: ____’ for the SFLIGHT-CONNID field will bring following result: ‘Flight Number is: 0017’.

Figure 53 ZDEMO_AIN_CL24 hardcoded edit_mask

Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - no_convext

Details
Łukasz Pęgiel
ALV Grid in the nutshell
27 June 2019
Hits: 4780
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , NO_COVEXT , ALV GRID

When you set this field to ‘X’ then data will be display without using convertion exit that is assigned to the reference field. This setting works when you have REF_FIELD and REF_TABLE filled in fieldcatalog or when CONVEXIT field is filled. This setting is useful when you want to display internal values that are stored in database.

 

Figure 51 ZDEMO_AIN_CL23 Language with Convertion Exit

 

Figure 52 ZDEMO_AIN_CL23 Language without Convertion Exit

 


 

 

Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - no_zero

Details
Łukasz Pęgiel
ALV Grid in the nutshell
27 June 2019
Hits: 7091
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , NO_ZERO , ALV GRID

This setting is usable when we don’t want to display values that are equal 0. It works for numeric fields. I use this setting for better visibility of data in the grid. To use it set value of this field to ‘X’.

 

Figure 49 ZDEMO_AIN_CL22 NO_ZERO field empty

 

Figure 50 ZDEMO_AIN_CL22 NO_ZERO field set to 'X'

 


Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - col_pos

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 7932
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , COL_POS , ALV GRID

This field is responsible for setting up columns in proper order while displaying the grid without using of saved layout. It may be useful if you don’t allow your users to save their own or global grid layouts, so then the grid looks always the same for them. Personally I leave this almost always empty, but if needed just simply use INTEGER values to setup correct sorting. The demo program that can be found in Figure 11 can be used to see the difference between standard sorting and own one. 

 

Figure 11 ZDEMO_AIN_CL05 COL_POS

 

Own sorting firstly takes care about positions of columns from field catalog, then it displays the rest. If I would not pass parameter I_STRUCTURE_NAME then only this fields which are in table FCAT would appear on the screen.

 

Figure 12 ZDEMO_AIN_CL05 Own Sequence

 

 

Figure 13  ZDEMO_AIN_CL05 Standard sequence


Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - fieldname

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 7524
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , FIELDNAME , ALV GRID

This field is one of the basic ones in field catalog. It contains the fieldname of internal table that will be used in our grid. Although LVC_T_FCAT is standard table, then this field should be treated as key field, as in fact it is. If you fill this field manually, then please remember to put the field names in UPPER CASE.

You have to also remember that if field catalog will not contain all fields from the table and you don’t pass the dictionary name to parameter I_STRUCTURE_NAME of SET_TABLE_FOR_FIRST_DISPLAY method, then it will only display this fields, which are in field catalog. 

In Figure 14 you can see that, the field catalog is created manually with only field names inside. I also do not pass I_STRUCTURE_NAME parameter, so then only field catalog will be used to prepare the display of internal table. As I haven’t filled anything in there beside the name of the field, the output will be really poor. We will have data displayed in our grid, but without any descriptions in header, without any formatting or search helps.

 

 

Figure 14 ZDEMO_AIN_CL06 Field catalog with only field names

 

Figure 15 ZDEMO_AI_CL06 Results


Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - tabname

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 5132
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , TABNAME , ALV GRID

The name of this field suggest to put here an internal table name, but it seems that it has no function at all. When SAP fills field catalog automatically, then value of this field is set to ‘1’. You can completely omit this field, as if you fill it then nothing will happen, even if you use different values for each field in field catalog.

Figure 16 ZDEMO_AIN_CL07 Tabname filled


Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - currency

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 9516
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , CURRENCY , ALV GRID

When you have a field that contains an amount, for example net value of an sales order, then in order to show it correctly in the grid you should fill or this field with an value of currency key (one of entries from TCURC table). You can leave this field of course empty and in many case you will, especially if you use CFIELDNAME instead. 

In many situations changing the of currency here will not make difference to the output, but there are some exceptions, for example JPY (Japanese Yen) don’t have decimal places. Figure 17 displays value of 42 294 whereas the internal value of field is 422,94. If we use ZDEMO_AIN_CL08 program with USD currency then as you seen in Figure 18, the value shown is equal to 422,94. Both outputs are correct as long as the currency of the corresponding line is the same as in field catalog.

 

Figure 17 ZDEMO_AIN_CL08 Output using JPY


Figure 18 ZDEMO_AIN_CL08 Output using USD

 

That’s why the CFIELDNAME is very handy to use in that situations where you have different currencies for different rows.


Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - ifieldname

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 2430
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , IFIELDNAME , ALV GRID

Although the SAP name of this field says: “Field name of internal table field”, then I haven’t found any usage of this field. It’s also not filled by SAP when you use SALV for creating field-catalogs. It may be that this field is not used at all.

Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - round

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 5829
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , ROUND , ALV GRID

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
Read more ...

ALV Grid in the nutshell: Field catalog - cfieldname

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 7299
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , CFIELDNAME , ALV GRID

CFIELDNAME can be read as currency field name. When you have in your internal table a field that represents the currency for the amount stored in a field kept under FIELDNAME in field catalog, then you should place its name here. The output of the cell will be then based on a currency key kept in the same row of the internal table, in the corresponding field. 

In the sample program ZDEMO_AIN_CL09 you can see that I passed to the filed catalog CFIELDNAME as ‘CURRENCY’ which is one of the columns of table SFLIGHT, that keeps currency key for field PRICE.

 

Figure 19 ZDEMO_AIN_CL09 CFIELDNAME filled

 As data in this table didn’t contained a line with JPY, I’ve changed in SE16 the currency key for one of the rows in order to show you the difference in output.

 

Figure 20 Changed entry of SFLIGHT table in SE16

 

As the output of the PRICE column depends now on the currency key stored in CURRENCY column, then you can see in the first row that the price is without decimal places, as it should be for Japanese Yen, and in the next rows as we have USD then we see two decimal places.

Figure 21 ZDEMO_AIN_CL09 results


Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - qfieldname

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 4973
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , QFIELDNAME , ALV GRID

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
Read more ...

ALV Grid in the nutshell: Field catalog - quantity

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 9803
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , QUANTITY , ALV GRID

QUANTITY field is very similar to CURRENCY. The difference here is that you don’t keep currency key here, but unit of measure, for example M for meters or KG for kilograms. Again to show you the difference in output I’ve modified a bit the table entries, this time field DISTANCE from SPFLI table, where I’ve included decimal places for first row.

 

Figure 22 Changed entries of SPFLI table in SE16

Now to see the differences, please run program ZDEMO_AIN_CL10 using following units: PMR, DEG, M & empty.

Figure 22 displays the values with three decimal places as PMR is setup to be displayed exactly like this.

 

Figure 23 ZDEMO_AIN_CL10 Results using PMR unit

Figure 23 shows the results when I used DEG unit which shows. In default this unit is set to have one decimal place. As you can see there everywhere where DISTANCE field has less or the same number of decimal places then it’s always shown with one decimal place (even, if after comma there is an 0). In case the quantity value contains more decimal places, like on the first row, then the value is displayed fully as written into internal table.

 

Figure 24 ZDEMO_AIN_CL10 Results using DEG unit

The same situation you can see if you use meters. No decimal places are visible in the rows for which the value doesn’t have any decimals, but if it’s the case then the full value is displayed.

 

Figure 25 ZDEMO_AIN_CL10 Results using M unit

At last I have run ZDEMO_AIN_CL10 without using any unit. As expected the internal value is displayed exactly like stored in internal table, so with four decimal places.

 

Figure 26 ZDEMO_AIN_CL10 Results without filling unit


Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - exponent

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 3365
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , EXPONENT , ALV GRID

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
Read more ...

More Articles ...

  1. ALV Grid in the nutshell: Field catalog - key
  2. ALV Grid in the nutshell: Field catalog - key_sel
  3. ALV Grid in the nutshell: Field catalog - symbol
  4. ALV Grid in the nutshell: Field catalog - icon
  5. ALV Grid in the nutshell: Field catalog - checkbox
  6. ALV Grid in the nutshell: Field catalog - just
  7. ALV Grid in the nutshell: Field catalog - lzero
  8. ALV Grid in the nutshell: Field catalog - no_sign
  9. ALV Grid in the nutshell: Field catalog
  10. ALV Grid in the nutshell
Page 2 of 11
  • Start
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • Next
  • End


Łukasz Pęgiel
ALV Grid in the nutshell Field catalog - rollname AiE LOAD COMPLEX TSK STARTING NEW TASK FIELDCATALOG ZIP a file using ABAP DYNAMIC GUI STATUS LVC FCAT AUTHORITY-CHECK AT SELECTION-SCREEN OUTPUT ECLIPSE APPEND USER SETTINGS SET TABLE FOR FIRST DISPLAY MS OUTLOOK OBJECTS BINARY RELATION CREATE EDIT MASK RELEASE ALLOWED RSBCS EXAMPLE EMAIL MEPO DOCUMENT SALV CONTROLLER METADATA GUI ALV GRID COL POS ALV GRID IN THE NUTSHELL SAPGUI PROGRESS INDICATOR VL473 IDENTITY CTMS DDB VALUE INTERNAL ESRUO F4 Help for external date FALV GOS - Link Business Documents from PR to PO How to teach ABAP Copying is not poss BAPI CHARACT GETDETAIL Use ABAP Extensions - Automatic Logon PURCHASE REQ FACTORY CHECKBOX SAVE RM07DOCS FIELDNAME CLASS READ Field catalog - Hotspot - ALV control SingleClick-sensitive Classifications - Part 2 - Get Object Details BATTLESHIPS Field catalog - key sel ALV GRID Field catalog - no convext REDISPATCH ABAP CMD API Load variant to single subscreen selection screen COMMIT KKB SELECTIONS SELECT Secure call of starting new task using RM FREE SESSION CHECK
  • Laserowe usuwanie blizn Tychy
  • Laserowe usuwanie zmarszczek Tychy
  • Salon Kosmetyczny Tychy
  • Trycholog Tychy
  • Wypadanie włosów Tychy
Tweets by abapblog

Eclipse Plugins for ABAP

ABAP Favorites

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

ABAP ADT Extensions

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

ABAP Quick Fixes

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

 

Latest Articles

  • ABAP in Eclipse - Install, Configure, Use, and Enhance Your ADT
  • ALV Grid in the nutshell: Field catalog - col_id - ALV control: Column ID
  • ALV Grid in the nutshell: Field catalog - dfieldname – Fieldname for column group
  • ALV Grid in the nutshell: Field catalog - Hotspot - ALV control: SingleClick-sensitive
  • ALV Grid in the nutshell: Field catalog - sp_group - Group key
  • ALV Grid in the nutshell: Field catalog - domname - Domain name
  • ALV Grid in the nutshell: Field catalog - reprep - ALV control: Value is selection criterion for rep./rep.intf.
  • ALV Grid in the nutshell: Field catalog - reptext – Heading
  • ALV Grid in the nutshell: Field catalog - lowercase - Lowercase letters allowed/not allowed
  • ALV Grid in the nutshell: Field catalog - intlen - Internal Length in Bytes
  • Downloading Exchange Rates from NBP (National Bank of Poland)
  • Downloading Exchange Rates from Central Bank of Turkey
  • ABAP Extensions - Automatic Logon
  • ALV Grid in the nutshell: Field catalog - inttype - ABAP data type (C,D,N,...)
  • ALV Grid in the nutshell: Field catalog - datatype

Most Read

  • Create XLSX/MHTML file from internal table in background
  • Refresh ALV GRID and keep position and current cell
  • Create XLSX file from internal table in background v2
  • FALV (Fast ALV Grid)
  • ATC Pseudo Comments list
  • Call standard F4 search help with customized parameters
  • Dynamic GUI STATUS & TITLE with ABAP code
  • Create fieldcatalog from internal table
  • Link Attachments of Purchase Requisition to Purchase Order
  • GOS - How to add business documents at creation of object
  • Endless loop in BADI ME_PROCESS_PO_CUST
  • Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 3 - Chart Data and render
  • How to access private or protected data and methods of CL_GUI_ALV_GRID
  • Subtotal lines of ALV GRID OO as content separator
  • Popup with multi-select ALV
feed-image Feed Entries

Latest Comments

ABAP code and articles provided on http://abapblog.com, if it is not statet otherwise, were created by Łukasz Pęgiel. You can use the code in your SAP instance for commercial and non-commercial use without any warranty from side of the author. You cannot sell the code as a full program or a part of it.
Replicating of the articles and code is prohibited unless the agreement of the author is given to you. 

Bootstrap is a front-end framework of Twitter, Inc. Code licensed under MIT License. Font Awesome font licensed under SIL OFL 1.1.