SlideShare a Scribd company logo
Generated by Jive on 2014-05-13+02:00
1
Lakhs Crores Indian Comma Separation in
number ->SAP ABAP, Flex/AIR & Excel
Acknowledgements: I owe a lot to many posts in STACKOVERFLOW & SCN
__________________________________________________________________________________
Common requirement in India is Indian comma separation
Unfortunately Excel, SAP, Flex etc offer only Thousand separator
COBOL had great flexibility in offering choice
SDN has many messages and some solutions on this very issue;
My solution(s) combines Indian preference + leading sign.
Indians think lakhs and crores; 10 lakhs = 1 million 1 crore = 10 million
Indians write cheques in this convention and top management always complain about the extra mental effort
to read the figures esp in INR. Top management need to feel figures as they prefer.
SAP has a lot to say on "ergonomics"; hopefully this may find place in Standard SAP
where all reports like FBL3N FBL1N FBL5N etc speak crores and lakhs for the very large Indian SAP user
base.
I faced need from senior managers in a Flex Application and later implemented in ABAP
with EDIT MASK for amounts in Indian Style with BONUS leading sign
Even total comes in crores lakhs and leading minus
If ABAPers use edit mask '==ZLAKH' in any field catalog even WRITE you will see that it works 100%
ABAPers try YJNCTEST76 and try -1234567898.9 as input
The conversion exit needs very good understanding of regular expression
https://help.sap.com/abapdocu_70/en/ABENREGULAR_EXPRESSIONS.htm
ABAP Code
1. Create a dummy domain ZLAKHS copy of WERT13N but with conv exit ZLAKH
The edit mask ==ZLAKH will for any type 0,1,2 or 3 decimals
2. Input conversion is dummy
FUNCTION conversion_exit_zlakh_input.
Lakhs Crores Indian Comma Separation in number ->SAP ABAP, Flex/AIR & Excel
Generated by Jive on 2014-05-13+02:00
2
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"----------------------------------------------------------------------
MOVE input TO output.
ENDFUNCTION.
3, This is the real code! Can be used for Integer, Quanity & Values
Hidden assumption User is NON-EURO - that is . is decimal and , thousand separator
FUNCTION conversion_exit_zlakh_output.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"----------------------------------------------------------------------
* https://help.sap.com/abapdocu_70/en/ABENREGULAR_EXPRESSIONS.htm
WRITE input TO output LEFT-JUSTIFIED.
REPLACE ALL OCCURRENCES OF ',' IN output WITH ''.
FIND '-' IN output.
IF sy-subrc = 0.
REPLACE ALL OCCURRENCES OF '-' IN output WITH ''.
CONCATENATE '-' output INTO output.
ENDIF.
REPLACE REGEX '(d+)(d{3}.*)$' IN output WITH '$1,$2'.
DO.
FIND REGEX 'd{3,},.+' IN output.
Lakhs Crores Indian Comma Separation in number ->SAP ABAP, Flex/AIR & Excel
Generated by Jive on 2014-05-13+02:00
3
IF sy-subrc <> 0.
EXIT.
ENDIF.
REPLACE REGEX '(d+)(d{2},.+)' IN output WITH '$1,$2'.
ENDDO.
ENDFUNCTION.
4. Usage in WRITE
REPORT yjnctest76 MESSAGE-ID zmsgs.
DATA: p_nrm(20) TYPE c,
p_ind(20) TYPE c.
PARAMETERS: p_input TYPE salk3.
START-OF-SELECTION.
WRITE p_input TO p_nrm LEFT-JUSTIFIED..
WRITE p_input TO p_ind LEFT-JUSTIFIED USING EDIT MASK '==ZLAKH'.
WRITE: /, p_nrm, p_ind.
5. Usage in SALV ABAP (any ALV method supports EDIT MASK)
zjnc_tblr_column->set_edit_mask( '==ZLAKH' ).
__________________________________________________________________________________
Flex/AIR is where this innovation of Indian comma separation started
This is done by custom item rendering; Adapted from Java
See code below for AS3(Flex/AIR that can be adapted) (it does Right justify as well)
Right justify a "missing" feature in Flex DataGrid
AS3 Flex/AIR Code where all the above originated ( I needed 0 decimals but Desi convention)
Lakhs Crores Indian Comma Separation in number ->SAP ABAP, Flex/AIR & Excel
Generated by Jive on 2014-05-13+02:00
4
<s:GridColumn id="dmbtr" headerText="Amt (INR)" dataField="dmbtr" >
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer>
<s:Label id="MyText" top="9" left="7" alpha="1"
text="{bizpopGlobals.instance.leftPad(data.dmbtr,10)}"
fontFamily="Lucida Console" textAlign="right"/>
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:GridColumn>
public function leftPad(inp:Number,size:int):String {
var lstr:String=Math.round(inp).toString();
var pat3:RegExp = /(d+)(d{3})$/;
lstr = lstr.replace(pat3, "$1,$2");
var pat2:RegExp = /(d+)(d{2},.+)/;
var pat1:RegExp = /d{3,},.+/;
while(lstr.match(pat1))
lstr = lstr.replace(pat2, "$1,$2");
var strLen:int = lstr.length;
var padLen:int = size - strLen;
if (padLen <= 0)
return lstr;
var myspaces:String=" "; // 20 OK
return myspaces.substring(0,padLen)+lstr;
}
__________________________________________________________________________________
To keep Excel download consistent I searched Indian comma separation and found
http://exertia.wordpress.com/2006/04/23/displaying-lakhs-and-crores-in-excel/
Lakhs Crores Indian Comma Separation in number ->SAP ABAP, Flex/AIR & Excel
Generated by Jive on 2014-05-13+02:00
5
The lakhs part which is what is mostly needed and 1 custom format is BOTH +ve and –ve friendly
with NO decimals
[>99999]##,##,##0;[<-99999.99]-##,##,##0;##,##0
With 2 decimals
[>99999]##,##,##0.00;[<-99999.99]-##,##,##0.00;##,##0.00
Please use when needed for INR figures in PHPEXCEL2007 and ABAP2XLSX and DOI
__________________________________________________________________________________

More Related Content

What's hot

Treinamento pricing
Treinamento pricingTreinamento pricing
Treinamento pricing
lgiordani
 
Formato nivel de aprendizaje
Formato nivel de aprendizajeFormato nivel de aprendizaje
Formato nivel de aprendizaje
Karen Lagos
 
Automatic batch determination based on shelf life
Automatic batch determination based on shelf lifeAutomatic batch determination based on shelf life
Automatic batch determination based on shelf life
Mauricio Beltran
 
Conferencia Comercio Electronico - Implementación de tiendas virtuales
Conferencia Comercio Electronico - Implementación de tiendas virtualesConferencia Comercio Electronico - Implementación de tiendas virtuales
Conferencia Comercio Electronico - Implementación de tiendas virtuales
Pedro Pachas Suárez
 
Proceso de producción
Proceso de producciónProceso de producción
Proceso de producción
Héctor Luna
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basics
vamshimahi
 
Plan de inventario
Plan de inventarioPlan de inventario
Plan de inventario
JoseJchm16
 
Breve Historia De La Producción
Breve Historia De La ProducciónBreve Historia De La Producción
Breve Historia De La Producción
dalejo0920
 
Justo a Tiempo
Justo a TiempoJusto a Tiempo
Justo a Tiempo
Juan Carlos Fernandez
 
Sistema de información de calidad
Sistema de información de calidadSistema de información de calidad
Sistema de información de calidad
Adriana Soto
 

What's hot (10)

Treinamento pricing
Treinamento pricingTreinamento pricing
Treinamento pricing
 
Formato nivel de aprendizaje
Formato nivel de aprendizajeFormato nivel de aprendizaje
Formato nivel de aprendizaje
 
Automatic batch determination based on shelf life
Automatic batch determination based on shelf lifeAutomatic batch determination based on shelf life
Automatic batch determination based on shelf life
 
Conferencia Comercio Electronico - Implementación de tiendas virtuales
Conferencia Comercio Electronico - Implementación de tiendas virtualesConferencia Comercio Electronico - Implementación de tiendas virtuales
Conferencia Comercio Electronico - Implementación de tiendas virtuales
 
Proceso de producción
Proceso de producciónProceso de producción
Proceso de producción
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basics
 
Plan de inventario
Plan de inventarioPlan de inventario
Plan de inventario
 
Breve Historia De La Producción
Breve Historia De La ProducciónBreve Historia De La Producción
Breve Historia De La Producción
 
Justo a Tiempo
Justo a TiempoJusto a Tiempo
Justo a Tiempo
 
Sistema de información de calidad
Sistema de información de calidadSistema de información de calidad
Sistema de información de calidad
 

Viewers also liked

資訊行為報告 淑貞
資訊行為報告 淑貞資訊行為報告 淑貞
資訊行為報告 淑貞twinme
 
HfC15 Sponsors
HfC15 Sponsors HfC15 Sponsors
HfC15 Sponsors
Paul Gilligan
 
Balam
BalamBalam
Balamralw
 
Writing
WritingWriting
Writingtwinme
 
HFC 19 Event Sponsors
HFC 19 Event SponsorsHFC 19 Event Sponsors
HFC 19 Event Sponsors
Paul Gilligan
 
Globalization Eye Opener Repatriation.Dk
Globalization   Eye Opener Repatriation.DkGlobalization   Eye Opener Repatriation.Dk
Globalization Eye Opener Repatriation.Dk
Repatriation_Denmark
 
Mtw Presentation
Mtw PresentationMtw Presentation
Mtw Presentation
sjhernan
 
2008 Hs Me Lecture1
2008 Hs Me Lecture12008 Hs Me Lecture1
2008 Hs Me Lecture1
sjhernan
 
資訊行為報告 淑貞
資訊行為報告 淑貞資訊行為報告 淑貞
資訊行為報告 淑貞twinme
 
Portes obertes abril_2016
Portes obertes abril_2016Portes obertes abril_2016
Portes obertes abril_2016
tonimune
 
Writing
WritingWriting
Writingtwinme
 
Ruta2diesbtt2016
Ruta2diesbtt2016Ruta2diesbtt2016
Ruta2diesbtt2016
tonimune
 
Immunotec Presentation Updated 24 11 09
Immunotec Presentation Updated 24 11 09Immunotec Presentation Updated 24 11 09
Immunotec Presentation Updated 24 11 09
jpounder
 

Viewers also liked (17)

資訊行為報告 淑貞
資訊行為報告 淑貞資訊行為報告 淑貞
資訊行為報告 淑貞
 
HfC15 Sponsors
HfC15 Sponsors HfC15 Sponsors
HfC15 Sponsors
 
Krt Borrelnood 150x100
Krt Borrelnood 150x100Krt Borrelnood 150x100
Krt Borrelnood 150x100
 
Balam
BalamBalam
Balam
 
Writing
WritingWriting
Writing
 
HFC 19 Event Sponsors
HFC 19 Event SponsorsHFC 19 Event Sponsors
HFC 19 Event Sponsors
 
Fld Talens Bts
Fld Talens BtsFld Talens Bts
Fld Talens Bts
 
Banieren Liberty 100x225
Banieren Liberty 100x225Banieren Liberty 100x225
Banieren Liberty 100x225
 
Globalization Eye Opener Repatriation.Dk
Globalization   Eye Opener Repatriation.DkGlobalization   Eye Opener Repatriation.Dk
Globalization Eye Opener Repatriation.Dk
 
Mtw Presentation
Mtw PresentationMtw Presentation
Mtw Presentation
 
2008 Hs Me Lecture1
2008 Hs Me Lecture12008 Hs Me Lecture1
2008 Hs Me Lecture1
 
資訊行為報告 淑貞
資訊行為報告 淑貞資訊行為報告 淑貞
資訊行為報告 淑貞
 
Portes obertes abril_2016
Portes obertes abril_2016Portes obertes abril_2016
Portes obertes abril_2016
 
Btl Bomenboekje 171208b
Btl Bomenboekje 171208bBtl Bomenboekje 171208b
Btl Bomenboekje 171208b
 
Writing
WritingWriting
Writing
 
Ruta2diesbtt2016
Ruta2diesbtt2016Ruta2diesbtt2016
Ruta2diesbtt2016
 
Immunotec Presentation Updated 24 11 09
Immunotec Presentation Updated 24 11 09Immunotec Presentation Updated 24 11 09
Immunotec Presentation Updated 24 11 09
 

Similar to Lakhs crores indian comma separation in ABAP Flex Excel

SAP Integration with Excel - Basic Guide
SAP Integration with Excel - Basic GuideSAP Integration with Excel - Basic Guide
SAP Integration with Excel - Basic Guide
Benedict Yong (杨腾翔)
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Alex Zaballa
 
SAP Integration With Excel - Advanced Guide
SAP Integration With Excel - Advanced GuideSAP Integration With Excel - Advanced Guide
SAP Integration With Excel - Advanced Guide
Benedict Yong (杨腾翔)
 
Exploit techniques - a quick review
Exploit techniques - a quick reviewExploit techniques - a quick review
Exploit techniques - a quick review
Ce.Se.N.A. Security
 
ABAP Coding Standards Reference Guide
ABAP Coding Standards Reference GuideABAP Coding Standards Reference Guide
ABAP Coding Standards Reference Guide
Stacy Taylor
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8
Frederic Descamps
 
MySQL 5.5
MySQL 5.5MySQL 5.5
MySQL 5.5
Ligaya Turmelle
 
Sql interview questions
Sql interview questionsSql interview questions
Sql interview questions
nagesh Rao
 
Sap alv excel inplace with macro recording sapignite
Sap alv excel inplace with macro recording sapigniteSap alv excel inplace with macro recording sapignite
Sap alv excel inplace with macro recording sapignite
Aromal Raveendran
 
Compiler Design and Construction COSC 5353Project Instructions -
Compiler Design and Construction COSC 5353Project Instructions -Compiler Design and Construction COSC 5353Project Instructions -
Compiler Design and Construction COSC 5353Project Instructions -
LynellBull52
 
Unit 3
Unit 3Unit 3
Unit 3
Abha Damani
 
Drizzles Approach To Improving Performance Of The Server
Drizzles  Approach To  Improving  Performance Of The  ServerDrizzles  Approach To  Improving  Performance Of The  Server
Drizzles Approach To Improving Performance Of The Server
PerconaPerformance
 
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Coupa Software
 
JCL FOR FRESHERS
JCL FOR FRESHERSJCL FOR FRESHERS
JCL FOR FRESHERS
Nirmal Pati
 
News in abap concepts to further increase the power of abap development 2
News in abap   concepts to further increase the power of abap development  2News in abap   concepts to further increase the power of abap development  2
News in abap concepts to further increase the power of abap development 2
Alexander Talac
 
News in abap concepts to further increase the power of abap development
News in abap  concepts to further increase the power of abap developmentNews in abap  concepts to further increase the power of abap development
News in abap concepts to further increase the power of abap development
Alexander Talac
 
SQL Performance Solutions: Refactor Mercilessly, Index Wisely
SQL Performance Solutions: Refactor Mercilessly, Index WiselySQL Performance Solutions: Refactor Mercilessly, Index Wisely
SQL Performance Solutions: Refactor Mercilessly, Index Wisely
Enkitec
 
Firebird 3 Windows Functions
Firebird 3 Windows  FunctionsFirebird 3 Windows  Functions
Firebird 3 Windows Functions
Mind The Firebird
 
Z abap coding_standards_v2_0_t
Z abap coding_standards_v2_0_tZ abap coding_standards_v2_0_t
Z abap coding_standards_v2_0_t
Rasika Jayawardana
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatterns
Chul Ju Hong
 

Similar to Lakhs crores indian comma separation in ABAP Flex Excel (20)

SAP Integration with Excel - Basic Guide
SAP Integration with Excel - Basic GuideSAP Integration with Excel - Basic Guide
SAP Integration with Excel - Basic Guide
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
SAP Integration With Excel - Advanced Guide
SAP Integration With Excel - Advanced GuideSAP Integration With Excel - Advanced Guide
SAP Integration With Excel - Advanced Guide
 
Exploit techniques - a quick review
Exploit techniques - a quick reviewExploit techniques - a quick review
Exploit techniques - a quick review
 
ABAP Coding Standards Reference Guide
ABAP Coding Standards Reference GuideABAP Coding Standards Reference Guide
ABAP Coding Standards Reference Guide
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8
 
MySQL 5.5
MySQL 5.5MySQL 5.5
MySQL 5.5
 
Sql interview questions
Sql interview questionsSql interview questions
Sql interview questions
 
Sap alv excel inplace with macro recording sapignite
Sap alv excel inplace with macro recording sapigniteSap alv excel inplace with macro recording sapignite
Sap alv excel inplace with macro recording sapignite
 
Compiler Design and Construction COSC 5353Project Instructions -
Compiler Design and Construction COSC 5353Project Instructions -Compiler Design and Construction COSC 5353Project Instructions -
Compiler Design and Construction COSC 5353Project Instructions -
 
Unit 3
Unit 3Unit 3
Unit 3
 
Drizzles Approach To Improving Performance Of The Server
Drizzles  Approach To  Improving  Performance Of The  ServerDrizzles  Approach To  Improving  Performance Of The  Server
Drizzles Approach To Improving Performance Of The Server
 
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
 
JCL FOR FRESHERS
JCL FOR FRESHERSJCL FOR FRESHERS
JCL FOR FRESHERS
 
News in abap concepts to further increase the power of abap development 2
News in abap   concepts to further increase the power of abap development  2News in abap   concepts to further increase the power of abap development  2
News in abap concepts to further increase the power of abap development 2
 
News in abap concepts to further increase the power of abap development
News in abap  concepts to further increase the power of abap developmentNews in abap  concepts to further increase the power of abap development
News in abap concepts to further increase the power of abap development
 
SQL Performance Solutions: Refactor Mercilessly, Index Wisely
SQL Performance Solutions: Refactor Mercilessly, Index WiselySQL Performance Solutions: Refactor Mercilessly, Index Wisely
SQL Performance Solutions: Refactor Mercilessly, Index Wisely
 
Firebird 3 Windows Functions
Firebird 3 Windows  FunctionsFirebird 3 Windows  Functions
Firebird 3 Windows Functions
 
Z abap coding_standards_v2_0_t
Z abap coding_standards_v2_0_tZ abap coding_standards_v2_0_t
Z abap coding_standards_v2_0_t
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatterns
 

Recently uploaded

Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 

Recently uploaded (20)

Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 

Lakhs crores indian comma separation in ABAP Flex Excel

  • 1. Generated by Jive on 2014-05-13+02:00 1 Lakhs Crores Indian Comma Separation in number ->SAP ABAP, Flex/AIR & Excel Acknowledgements: I owe a lot to many posts in STACKOVERFLOW & SCN __________________________________________________________________________________ Common requirement in India is Indian comma separation Unfortunately Excel, SAP, Flex etc offer only Thousand separator COBOL had great flexibility in offering choice SDN has many messages and some solutions on this very issue; My solution(s) combines Indian preference + leading sign. Indians think lakhs and crores; 10 lakhs = 1 million 1 crore = 10 million Indians write cheques in this convention and top management always complain about the extra mental effort to read the figures esp in INR. Top management need to feel figures as they prefer. SAP has a lot to say on "ergonomics"; hopefully this may find place in Standard SAP where all reports like FBL3N FBL1N FBL5N etc speak crores and lakhs for the very large Indian SAP user base. I faced need from senior managers in a Flex Application and later implemented in ABAP with EDIT MASK for amounts in Indian Style with BONUS leading sign Even total comes in crores lakhs and leading minus If ABAPers use edit mask '==ZLAKH' in any field catalog even WRITE you will see that it works 100% ABAPers try YJNCTEST76 and try -1234567898.9 as input The conversion exit needs very good understanding of regular expression https://help.sap.com/abapdocu_70/en/ABENREGULAR_EXPRESSIONS.htm ABAP Code 1. Create a dummy domain ZLAKHS copy of WERT13N but with conv exit ZLAKH The edit mask ==ZLAKH will for any type 0,1,2 or 3 decimals 2. Input conversion is dummy FUNCTION conversion_exit_zlakh_input.
  • 2. Lakhs Crores Indian Comma Separation in number ->SAP ABAP, Flex/AIR & Excel Generated by Jive on 2014-05-13+02:00 2 *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(INPUT) *" EXPORTING *" REFERENCE(OUTPUT) *"---------------------------------------------------------------------- MOVE input TO output. ENDFUNCTION. 3, This is the real code! Can be used for Integer, Quanity & Values Hidden assumption User is NON-EURO - that is . is decimal and , thousand separator FUNCTION conversion_exit_zlakh_output. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(INPUT) *" EXPORTING *" REFERENCE(OUTPUT) *"---------------------------------------------------------------------- * https://help.sap.com/abapdocu_70/en/ABENREGULAR_EXPRESSIONS.htm WRITE input TO output LEFT-JUSTIFIED. REPLACE ALL OCCURRENCES OF ',' IN output WITH ''. FIND '-' IN output. IF sy-subrc = 0. REPLACE ALL OCCURRENCES OF '-' IN output WITH ''. CONCATENATE '-' output INTO output. ENDIF. REPLACE REGEX '(d+)(d{3}.*)$' IN output WITH '$1,$2'. DO. FIND REGEX 'd{3,},.+' IN output.
  • 3. Lakhs Crores Indian Comma Separation in number ->SAP ABAP, Flex/AIR & Excel Generated by Jive on 2014-05-13+02:00 3 IF sy-subrc <> 0. EXIT. ENDIF. REPLACE REGEX '(d+)(d{2},.+)' IN output WITH '$1,$2'. ENDDO. ENDFUNCTION. 4. Usage in WRITE REPORT yjnctest76 MESSAGE-ID zmsgs. DATA: p_nrm(20) TYPE c, p_ind(20) TYPE c. PARAMETERS: p_input TYPE salk3. START-OF-SELECTION. WRITE p_input TO p_nrm LEFT-JUSTIFIED.. WRITE p_input TO p_ind LEFT-JUSTIFIED USING EDIT MASK '==ZLAKH'. WRITE: /, p_nrm, p_ind. 5. Usage in SALV ABAP (any ALV method supports EDIT MASK) zjnc_tblr_column->set_edit_mask( '==ZLAKH' ). __________________________________________________________________________________ Flex/AIR is where this innovation of Indian comma separation started This is done by custom item rendering; Adapted from Java See code below for AS3(Flex/AIR that can be adapted) (it does Right justify as well) Right justify a "missing" feature in Flex DataGrid AS3 Flex/AIR Code where all the above originated ( I needed 0 decimals but Desi convention)
  • 4. Lakhs Crores Indian Comma Separation in number ->SAP ABAP, Flex/AIR & Excel Generated by Jive on 2014-05-13+02:00 4 <s:GridColumn id="dmbtr" headerText="Amt (INR)" dataField="dmbtr" > <s:itemRenderer> <fx:Component> <s:GridItemRenderer> <s:Label id="MyText" top="9" left="7" alpha="1" text="{bizpopGlobals.instance.leftPad(data.dmbtr,10)}" fontFamily="Lucida Console" textAlign="right"/> </s:GridItemRenderer> </fx:Component> </s:itemRenderer> </s:GridColumn> public function leftPad(inp:Number,size:int):String { var lstr:String=Math.round(inp).toString(); var pat3:RegExp = /(d+)(d{3})$/; lstr = lstr.replace(pat3, "$1,$2"); var pat2:RegExp = /(d+)(d{2},.+)/; var pat1:RegExp = /d{3,},.+/; while(lstr.match(pat1)) lstr = lstr.replace(pat2, "$1,$2"); var strLen:int = lstr.length; var padLen:int = size - strLen; if (padLen <= 0) return lstr; var myspaces:String=" "; // 20 OK return myspaces.substring(0,padLen)+lstr; } __________________________________________________________________________________ To keep Excel download consistent I searched Indian comma separation and found http://exertia.wordpress.com/2006/04/23/displaying-lakhs-and-crores-in-excel/
  • 5. Lakhs Crores Indian Comma Separation in number ->SAP ABAP, Flex/AIR & Excel Generated by Jive on 2014-05-13+02:00 5 The lakhs part which is what is mostly needed and 1 custom format is BOTH +ve and –ve friendly with NO decimals [>99999]##,##,##0;[<-99999.99]-##,##,##0;##,##0 With 2 decimals [>99999]##,##,##0.00;[<-99999.99]-##,##,##0.00;##,##0.00 Please use when needed for INR figures in PHPEXCEL2007 and ABAP2XLSX and DOI __________________________________________________________________________________