Sunday, February 28, 2010

İş zekası, diğer uygulamalarla da bütünleşebilmeli

Zorlaşan rekabet ortamı, müşterilerin taleplerine cevap verme isteği ve farklı ihtiyaçlar nedeniyle kurumlar günümüzde birden fazla sistem kullanmak zorunda kalıyor. Her sisteme kendine özgü verilerin girilmesinin, girilen veriler arttıkça bunların raporlanmasının, analiz edilmesinin ve dolayısıyla karar verme sürecinin zorlaştırdığını dile getiren Bimsa SAP Danışmanı Altay Rodoplu, "İş zekâsı yeni fırsatlar yaratma, maliyetleri düşürme, karar verme gibi amaçlar için tüm bu sistemlerdeki veriyi konsolide ederek bilgiye dönüştürüyor ve anlamlı bir formatta kullanıcılara sunuyor" dedi.

İş zekâsı çözümü ile müşteri ilişkileri yönetimi (CRM) uygulamasının etkileşimli çalışması sonucunda, verimlilik artışının üst seviyelere taşınacağını düşündüklerini dile getiren Elsys Satış ve Pazarlama Müdürü Armağan Aydın ise şunları aktardı:

"İş zekâsı ile CRM uygulamasının birlikte çalışması müşterilerin tanınmasını ve detaylı olarak analiz edilmesini mümkün kılıyor. İş zekâsı ile CRM çözümünü bir arada sunduğumuz projelere imza attık. Bu projelerle, müşterilerin şehir, beşeri özellikler, tüketim alışkanlıkları ve hatta satın alma güçleri bazında ayrıştırılarak birkaç saniyede bilgilerine ulaşılması mümkün oluyor."

İş zekâsı uygulamaları şirket içi ve dışı bilgi sistemlerine hazır, sürdürülebilir bütünleştirmesi ve çok çeşitli kaynaklardan elde edilen verinin raporlanabilir, yorumlanabilir hale getirilmesini sağlamaktadır. İş zekâsı sisteminin hazır veri çekme yapıları ile SAP operasyonel sistemlerinden rahatlıkla anlık veri çekebilmekte olduğunu belirten Detaysoft İş Zekası Birim Yöneticisi Ergin Öztürk, şunları kaydetti:

"Bu verileri veriambarlarında konsolide etmekte ve analize hazır hale getirebilmektedir. Bu analiz sonuçlarını yayımlama ve dağıtım konusunda portal uygulamalarıyla bütünleşik çalışan iş zekâsı sistemleri kullanıcıların ister mobil ortamda isterse internet üzerinden anında veriye erişimine olanak sağlamaktadır. Operasyonel sistemlerden toplanan veriler istenirse bütçe uygulamalarında şirket hedeflerini sayısal hale getirmek için kullanılabilmekte ve eğilim modelleriyle gelecek dönemdeki şirket mali performansı sistem tarafından tahmin edilebilmektedir. Kurumsal karne uygulamalarıyla bütünleşik çalışabilen iş zekâsı sistemleri ile bütçelenen hedefler ve fiili sonuçlar karşılaştırılabilmekte bu sayede yöneticilerin aksiyon alması gereken durumlar zamanında tesbit edilebilmektedir. CRM sistemleriyle bütünleşik çalışan iş zekâsı sistemleriyle müşteri ve satıcı performansları analiz edilebilmekte, müşteri segmentasyonu, değerlemesi yapılabilmektedir. Potansiyel müşteri fırsatları için veri madenciliği modelleri ile hedef pazarlar ve müşteriler sistem tarafından önerilmekte ve bu öneri sonuçlarına göre kişiye özel kampanyalar tasarlanabilmektedir."

İş zekâsı uygulamalarının, şirketin mevcut operasyonel uygulamaları ile veriambarları ve B2C, B2B mecralarıyla yoğun bir etkileşimi bulunduğunu belirterek şunları kaydetti:

"Çünkü operasyonel verilerin bulunduğu ERP, CRM, veriambarları, e-ticaret uygulamalarıyla toplanan ve işlenen veriler, iş zekâsı uygulamaları ile anlamlı bilgiye dönüşmekte, doğru eylemleri gerçekleştirebilmek için yöneticilere yön göstermektedir. Örneğin, mağazacılık uygulamalarından elde edilen veriler, çeşitli kriterler çerçevesinde sınıflandırılıp analiz edilebilmekte, müşteri segmentasyonları oluşturulabilmekte; bu şekilde ham verilerden anlamlı bilgiye dönüşüm sonrasında, çeşitli kampanyalar organize edilerek; stratejik kararlar alınıp eyleme geçilmektedir. "İş zekâsı uygulamalarının ERP, CRM gibi temel uygulamalar üzerine inşa edildiğini belirten Netsis Genel Müdür Yardımcısı Timur Turgutlu, "Bu temel uygulamalar, iş zekâsını besleyen unsurlar oluyor. Dolayısıyla bütünleştirme şart. Bununla birlikte son dönemde iş zekâsı ile en fazla kesişen uygulamalar arasında CRM ve finansal uygulamalar ön plana çıkıyor. CRM ile müşteri ilişkileri süreçlerinde operasyonel takibin yapılması ve analitik değerlendirmelerin sağlanması mümkün olmaktadır. İş zekâsı ile CRM uygulamalarının bütünleştirilmesi sonucunda farklı departmanlarda elde edilen bilgiler üzerine kurulan analiz sistemleri müşterilere ait verilerin incelenmesini sağlamaktadır. İş zekâsı uygulamaları ile CRM bu noktada birleşmektedir.  Finansal süreçlerin raporlanması yine iş zekâsı uygulamalarıyla mümkün olmaktadır."

Oytek CRM Grup Yöneticisi İlkay Öztürk de konuyla ilgili olarak, "İş zekâsı uygulamasının temelinde veriler yer almaktadır. Eğer verileriniz yetersiz, tutarsız veya hatalı ise; bu verilerden doğru sonuçların çıkartılması da mümkün olmayacaktır. Bu kapsamda şirket içinde kullanılmakta olan operasyonel sistem ve tüm destekleyici uygulamaların verimliliği, süreçlerinin doğru işlemesi ve birbirleri ile bütünleşmeleri başarılı bir iş zekâsı uygulamasının hayata geçirilmesindeki çok  kritik faktördür" dedi.

Her sistemle uyumlu olmalı

Intellica Genel Müdürü Dr. Kemal Ünaltuna, iş zekâsı konusunda kurumların önce kendilerine düşen görevleri yerine getirmeleri gerektiğini belirterek, şunları kaydetti:

"Bir kurum en minimumda şu soruları kendisine sormalıdır. Kurumda olan biteni bütünleşik bir şekilde tek yerden izleyebiliyor muyum? Kurumda çalışanları operasyonel, taktiksel ve stratejik rapor ve analiz ihtiyaçlarını tek yerden karşılayabiliyor muyum? İstenen analiz ve raporlamaları an kısa zamanda iş kullanıcılarının yapmalarını sağlayabiliyor muyum? Kurumun çeşitli yerlerinde ve kanallarında yapılan işlemleri ve oluşan olayları akıllı senaryolar içinde işleyebiliyor ve bunlara gereken aksiyonları anında oluşturabiliyor muyum? Etkin bir müşteri ilişkileri yönetimi yapabiliyor muyum? Bu sorulara olumlu cevap verilemiyorsa bu kurum iş zekası teknolojilerini layıkıyla kullanmıyor demektir. Bir de çeşitli konferanslara ve etkinliklere katılınarak benzer kurumlarda neler yapıldığının izlenmesi de farkındalık oluşturmak için önemli bir yoldur. İdeal iş zekası çözümleri, ayrı modüller olarak çalışmalı, ancak istendiği zaman ve şekilde operasyonel ve diğer uygulamalar ile kolaylıkla bütünleşebilmelidir. Örneğin bir skorlama sistemi ayrı bir modül olarak çalışmakta ancak kredi başvuru iş akışları ile sıkı bir bütünleşme içinde bulunmaktadır. Genelde iş zekası uygulamaları operasyonel ortamlardan veri talep ederler ve bu verileri işleyerek kritik sonuçlara ulaşırlar. Sonra da bu sonuçlar operasyonel ortamlara geri beslenerek döngü tamamlanmış olur. İdeal bir iş zekâsı uygulamasının bunları sağlamak için kolaylıkla her sisteme uyumlandırılabilen arabirimleri olması gerekir."

Ayhan Sevgi
ayhans@interpromedya.com.tr

Source: http://www.bthaber.com.tr/?p=1770&sayi=SAYI:755

Doğru çözümlerle doğru zamanda karşılaşan kurumlar farkındalık yaratıyor

Yeni müşteri kazanmanın her geçen gün zorlaştığı rekabet ortamında kurumlar varolan müşterileri memnun edebilmenin, onları tanıyabilmenin ve ileriye dönük ihtiyaçlarını fırsata dönüştürmenin yollarını arıyorlar. Detaysoft İş Zekası Birim Yöneticisi Ergin Öztürk, bu konuda "Yöneticilerin şirket performansını değerlendirebilmesi için hedefler geliştirmesi, bu hedeflerin sonuçlarını sayısal olarak değerlendirmesi gerekmektedir. Bu aşamada bütünleşik kurumsal performans yönetim sistemleri, bütçeleme, konsolidasyon, veriambarı, veri madenciliği, raporlama ve bilgi yönetimi çözümleri iş zekâsı sistemleri ile gerçekleştirilmektedir" dedi.

Ancak odak noktasının doğru belirlenmesiyle farkındalık yaratmanın mümkün olduğunun altını çizen Bircom Yazılım Geliştirmeden Sorumlu Genel Müdür Yardımcısı Tolga Seçilmiş, "Süreç ve projelerde veriler tek boyutlu oluşmamaktadır. Dolayısıyla bunları hangi açıdan bakarak yorumlayacağınız sizin farkındalık yaratmak istediğiniz odak noktanızı doğru tanımlamanızla doğrudan alakalıdır. İş zekâsı uygulamanızı müşteri odağı, kalite veya maliyete göre yapılandırdığınız durumda mevcut üretim veya hizmet yapınız farklılaşacaktır. Bu durumda önce farkındalık yaratmak istediğiniz alanı belirleyip sonra iş zekâsı uygulamanızı buna göre düzenlemek farkındalık yaratmak için atılacak ilk adımdır" dedi.

IFS Satış ve Pazarlama Direktörü ve Yönetim Kurulu Üyesi Ergin Öztürk, "Günümüzde kurumsal verimliliğin temelinde, iş süreçlerinde ortaya çıkan her türlü verinin kayıt altına alınarak raporlanması ve işlenmesi, basitlik ve kullanışlılık sunan bir platform içinde değer yaratacak biçimde örgütlenmesi yatıyor. Piyasa baskısı ve ağır rekabet şartları altında modern işletme, karmaşık iş süreçlerine ve ilişkiler ağına sahiptir. Bu nedenle şirket içindeki bilgi akışının yüksek standartta, kesintisiz ve hızlı olarak üretimi, rekabet açısından önemli bir katma değer sunuyor" dedi.

SAS Türkiye Genel Müdürü Gökhan Nalbantoğlu da şunları aktardı:

"Günümüz koşullarında kurumlar kârlılıklarını, verimliliklerini artıracak ve onlara rekabet üstünlüğü sağlayacak çözümler arıyorlar. Bu süreçte, 'Müşterilerimi nasıl tanırım?', 'Fırsatları nasıl öngörebilirim?' ve 'İş süreçlerimi nasıl optimize edebilirim?' gibi temel soruların cevapları, farklı sektörlerden her seviyedeki kurum için, iş zekâsı ve analitik uygulamalardan geçiyor. Yükselen boyuttaki verinin bilgiye dönüştürülmesine ihtiyaç da bu bağlamda her geçen gün artıyor. Böylelikle, doğru çözümleri doğru kurumlarla doğru zamanda buluşturmanın farkındalığı da ortaya çıkıyor."

Arete Genel Müdürü Bahadır Balibaşa ise son yıllarda, küresel iş zekâsı pazarı göreceli olarak daha küçük yazılım üreticilerinin domine ettiği bir pazar olmaktan, büyük yazılım üreticilerinin odağına oturmuş ve büyük oyuncuların satın almalar ile inorganik büyümeyi tercih ettiği bir pazar haline geldiğini belirtti.

Yerel destek alınabilecek markalar tercih edilmeli

İş zekası ürününü kullanmak isteyen şirketlere önerilerde bulunan WorldBI Pazarlama ve Satış Müdürü Cem Yılmaz, şunları belirtti:

"Mevcut olan ERP veya ticari otomasyon uygulaması ile kolayca bütünleşebilecek şekilde gelmesi önemlidir. Pek çok ERP veya ticari otomasyon yazılımının altyapısında tutulan tablolar bir son kullanıcı tarafından anlaşılamayacak nitelikte isimler ve bilgiler içermektedir. Bu sebeple standart bir bütünleşmenin bulunması son kullanıcının hemen işe koyulması ve sonuçların bir an önce sağlanması açısından önemlidir. Kullanılacak iş zekası aracından azami şekilde yararlanılması, veri temizliği aşamasının en kısa zamanda geçilebilmesi için ilgili aracı yerel olarak da destekleyebilecek bir iş ortağı veya yerel üretici seçilmelidir. Bu anlamda kurumlara tavsiyemiz ticari otomasyon veya ERP yazılımının seçilmesi esnasında kullanılacakları iş zekası aracına da aynı anda karar vermeleri, özellikle yerel destek alabilecekleri yerel markaları tercih etmeleridir."

Bir kılavuz kaptandan yardım alınmalı

HP Yazılım Grubu Ülke Müdürü Tayfun Topkoç, kurumların iş zekasına bakışındaki en önemli güçlüklerden bir tanesinin bunun sadece bir raporlama uygulaması olarak algılanması olduğunu vurguluyor ve sözlerine şöyle devam ediyor: "Şirketler iyi işleyen bir iş zekâsından kendi işlerini geliştirebilecekleri bir 'işe yarayan teknoloji' oluşturabileceklerini görmeleri genelde biraz zaman alabilmekte. İş zekâsı uygulamasını hayata geçirmek için kurumların gerekli uzmanlıkları barındırmıyor olmaları konunun sadece teknik yönlerinin ele alındığı bir BT projesi olarak görülmesi ve bir raporlama uygulaması olarak algılanması çok sıklıkla görülen bir durum. Kurumların bir iş zekâsı uygulamasından ne beklediği, ne beklemesi gerektiğini, ne tür sorunlarla karşılaşılabileceğini, bu sorunlarla nasıl baş edebileceğini öğrenmesi genellikle zamanını ve kaynaklarını boşa harcamasına neden olabilmekte. Oysa bir kılavuz kaptandan yardım almak, hem gidilmek istenen limanı belirlemek hem de sorunsuz bir şekilde ilerleyebilmek, fırtınaya yakalanmamak, yakalanılmışsa da en uygun şekilde baş edebilmek açısından seçilebilecek yollardan bir tanesi."

Kurumsal sezgi hayata geçirilmeli

Günümüzün modern işletmesi kurumsal bilgi sistemlerinin; çağrı merkezi, B2C ve B2B siteleri ile geleneksel iletişim araçları üzerinden yoğun bir şekilde akan ham bilginin baskısı altında hizmet verdiğinin altını çizen Microsoft Türkiye Uygulama Platformu Ürün Yöneticisi Gökben Utkun, şunları kaydetti:

"Çünkü müşteriler, iş ortakları ve tedarikçilerden yansıyan her türlü geri bildirimin az ya da çok rekabet açısından büyük bir önemi vardır ve en uygun şekilde değerlendirilmesi gerekir. Kurumsal veriyi depolayan veritabanlarının hacmi geometrik olarak artarken, veritabanlarında saklanan ham verinin bir değer ifade edebilmesi için bilgiye dönüştürülmesi gerekmektedir. Kurumsal bilgiyi kalıcı hale getirmenin yolu çalışanlarda varolan sezgilere kurumsal bir kimlik kazandırmaktır. Kurumsal sezginin hayata geçmesiyle tüm çalışanlar ortak bir bilgi tabanı sayesinde ellerindeki bilgiyi doğrulayabilir, karşılaştırabilir, analiz edebilir ve nihayetinde doğru iş kararları alabilirler."

Sağlanan avantajlar her zaman için geçerli

"İş zekası uygulamaları veriyi bilgiye dönüştürür, kurumların kaynaklarını daha verimli bir şekilde kullanmasını sağlar, operasyon etkinliğini artırır ve yeni gelir fırsatlarını tespit eder" diyen Oracle İş Zekası ve Kurumsal Performans Yönetimi Çözümleri EEC&CIS Bölgesi Satış Direktörü Cenk Kıral, şunları kaydetti:

"Bir şirketin bu soruların yanıtlarını mevcut verilerinden yola çıkarak vermesi, onu her zaman rakiplerinden bir adım öne çıkaracaktır. Bu, sadece ekonomik durgunluk dönemlerinde değil, iş dünyasının çetin rekabet koşulları altında her zaman geçerli olacak bir avantajdır. Kurumlar gelişip büyüdükçe, şirketi neyin başarıya götürdüğü konusunda son derecede değerli bir içgörü sağlayabilecek olan büyük miktarda veri üretir. Ancak bu veriler genellikle farklı sistemlere dağılmış olduğundan verileri alıp analiz etmek zordur. Oysaki kurumlar bilgi toplama ve değerlendirme anlamında olumlu adımlar attıkça, ulaşmak istedikleri başarılı noktaya daha fazla yaklaşırlar."

Ayhan Sevgi
ayhans@interpromedya.com.tr

Source: http://www.bthaber.com.tr/?p=1765&sayi=SAYI:755

SAP cancels NetWeaver BW 7.2 release, plans to roll features into 7.3 release

SAP has cancelled its planned NetWeaver BW 7.2 release, and will instead roll 7.2 functionality into a NetWeaver BW 7.3 release set for later this year, the company said today.
Today, SAP told customers participating in a ramp-up program for NetWeaver BW 7.2 that it would be cancelled. The program was set to begin on March 1, and about 10 customers were participating, according to SAP. SAP's ramp-up is its process for introducing a product to the market, and the program allows a select group of customers to use the software before it becomes generally available.
"The feedback from our customers was loud and clear: while they appreciated the features that would be available via the 7.20 release, they prefer one more complete feature release and fewer upgrade steps," Franz Aman, vice president of platform marketing for SAP BusinessObjects, said in an email. "SAP listened, and will consequently not release SAP NetWeaver BW 7.20 in favor of consolidating the 7.20 and 7.30 functionality into one go-to release."
SAP last released a version of NetWeaver BW, in October 2005 NetWeaver BW 7.0. Customers have had complaints about NetWeaver BW, including slow query responses, limited data volume scalability and limited visibility into non-SAP data, according to analysts. SAP released the BW Accelerator to deal with the performance issues.
Some of the functionality customers can look forward to getting in the NetWeaver BW 7.3 release includes the full technology platform release supporting all of the NetWeaver hubs, tighter integration with the SAP BusinessObjects tools and enhanced business planning, Aman said.
NetWeaver BW 7.3 will also include support for Teradata and HP Neoview.
 
Courtney Bjorlin
Source: http://searchsap.techtarget.com/news/article/0,289142,sid21_gci1391034,00.html?track=sy191&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+techtarget%2Fsearchsap%2Fsapnews+%28SearchSAP+%3A+SAP+news%2C+tips+and+expert+advice%29&utm_content=Google+Reader



 

Tips on processing records in SAP internal tables


Back in the mists of time (before SAP R/3 4.6c, if I remember correctly), we had two types of tables --tables with header lines and tables without. For tables with header lines, we'd do things like:

LOOP AT my_table_wh.

my_table_wh-somefield = 'some value'.
MODIFY my_table.
ENDLOOP.

For tables without header lines, we'd do things like:


DATA: wa LIKE LINE OF t_table.

LOOP AT t_table INTO wa.
wa-somefield = 'some value'.
MODIFY t_table FROM wa.
ENDLOOP.

Both of these were, in fact, just as quick (or slow) because they both transfer the record from the table into another part of memory and back. With the former, the ABAP runtime does it for you, via the table header. With the latter, you do it yourself. Then we started using LOOP AT … ASSIGNING. This gives us direct access to the records of the table; no more of this tedious mucking about moving a copy of the record into a work area. The consensus seems to be that you should use LOOP AT ASSIGNING only when you're modifying the contents of an internal table. In most situations, it's definitely quicker.


FIELD-SYMBOLS: <ls_wa> LIKE LINE OF t_table.

LOOP AT t_table ASSIGNING <ls_wa>.
<ls_wa>-somefield = 'some value'.
ENDLOOP.

However, there is a scenario I've encountered where using ASSIGNING is slower than INTO. I'm often working with dynamically constructed tables (i.e., Exit Functions in SEM, where I have a table XTH_DATA TYPE HASHED TABLE). When handling these, I could use:


FIELD-SYMBOLS: <ls_data> TYPE ANY,

<l_field> TYPE sometype.
LOOP AT xth_data ASSIGNING <ls_data>.
ASSIGN COMPONENT 'SOMEFIELD' OF STRUCTURE <ls_data> TO <l_field>.
" Do stuff
ENDLOOP.

But I've found, especially if I need to access quite a number of components of the structure and the table has many records, that the following is actually quicker:


FIELD-SYMBOLS: <ls_data> TYPE ANY,

<l_field> TYPE sometype.
DATA: lr_data TYPE REF TO DATA.
CREATE DATA lr_data LIKE LINE OF xth_data.
ASSIGN <lr_data> TO <ls_data>.
ASSIGN COMPONENT 'SOMEFIELD' OF STRUCTURE <ls_data> TO <l_field>.
LOOP AT xth_data INTO <ls_data>.
" Do stuff with <l_field>.
MODIFY TABLE xth_data FROM <ls_data>.
ENDLOOP.

 


 

Matthew Billingham
Source: http://searchsap.techtarget.com/tip/0,289483,sid21_gci1385482,00.html?track=sy191&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+techtarget%2Fsearchsap%2Fsapnews+%28SearchSAP+%3A+SAP+news%2C+tips+and+expert+advice%29&utm_content=Google+Reader


 

Tuesday, January 26, 2010

Business Planning and Consolidation Getting Started

Business Planning and Consolidation
Business Planning and Consolidation drives consistency, transparency, and reliability in financial planning, management consolidation, business reporting and operational activities. Designed to empower users, regardless of skill level, to access and interact with data for timely and effective decision-making. Standardizing business flow processes and predictive analytics provide actionable information to drive business decisions as well as meet compliance requirements.
SAP BusinessObjects Planning and Consolidation (a component of SAP BusinessObjects EPM portfolio) is an application dedicated to financial processes on a unified platform. Owned by the business and designed for the end user, it is the target environment to support planning, consolidation and financial reporting, through unique functionalities like Business Process Flow and tight Microsoft Office integration. Get a snapshot of the application and learn how Enterprise Performance Management is now entering the next generation of application.

Getting Started
Business Planning and Consolidation 5.0 - Monthly Financial Process
This demo takes you through the details of the Monthly Financial Process in SAP BPC 5.0.
Budgeting Best Practices with SAP Business Planning
These blogs talk about the budgeting best practices and how they are surfaced using SAP CPM solutions. EPM How-To Guides Part IPart II, Part III, and Part IV introduce these best practices and explain how the SAP Business Planning solution supports them. This collection of EPM and CPM How-To Guides covers a wide array of topics for various stages of planning and development.
Online Help documents can be accessed here: http://help.sap.com/bp_bpc70/html/index.htm

Pasted from http://www.sdn.sap.com/irj/bpx/epm?rid=/webcontent/uuid/8064f3af-7613-2a10-5abb-b3f17efb05a3

Tuesday, January 19, 2010

IF_RSPLFA_SRVTYPE_IMP_EXEC~EXECUTE




public section.

interfaces IF_RSPLFA_SRVTYPE_IMP_EXEC .
types S_DATA type /BIC/VAL25012 .
types S_TAKIM_DATA type /BIC/CE8ZSETAC_O .
types T_DATA type TABLE OF S_DATA .
types T_TAKIM_DATA type TABLE OF S_TAKIM_DATA .
methods CONSTRUCTOR .

method CONSTRUCTOR.
SELECT * INTO TABLE lt_takim_data FROM /BIC/AZSETAC_O00 .
endmethod.

method IF_RSPLFA_SRVTYPE_IMP_EXEC~EXECUTE.
DATA: refdata TYPE REF TO data .

FIELD-SYMBOLS: <sdata> TYPE ANY.
FIELD-SYMBOLS: <tdata> TYPE ANY TABLE.
CREATE DATA refdata LIKE LINE OF c_th_data.
ASSIGN refdata->* TO <sdata>.


DATA: ls_data TYPE S_DATA .
DATA: lt_data TYPE T_DATA .
DATA: ls_data_change TYPE S_DATA .
DATA: lt_data_change TYPE T_DATA .
DATA: miktar_katsayi TYPE F .
DATA: fiyat_katsayi TYPE F .

LOOP AT c_th_data INTO <sdata>.
MOVE-CORRESPONDING <sdata> TO ls_data .
IF ls_data-0INFOPROV = 'ZICR020' .
COLLECT ls_data INTO lt_data .
ENDIF.
ENDLOOP.

LOOP AT lt_data INTO ls_data .
LOOP AT lt_takim_data INTO ls_takim_data
WHERE MATERIAL = ls_data-0MATERIAL .

miktar_katsayi = ls_takim_data-/BIC/ZSETORAN .
fiyat_katsayi = ls_takim_data-/BIC/ZFIYATYZD / 100 .
ls_data_change = ls_data .
ls_data_change-0INFOPROV = 'ZICR026' .
ls_data_change-ZSETMALZ = ls_takim_data-/BIC/ZSETMALZ .

IF ls_data-0MATERIAL = ls_data_change-ZSETMALZ .
ls_data_change-ZTA_TK = 'H' .
ELSE .
ls_data_change-ZTA_TK = 'A' .
ENDIF.

ls_data_change-ZBG0066 = ls_data-ZBG0066 * miktar_katsayi .
ls_data_change-ZBG0081 = ls_data-ZBG0081 * fiyat_katsayi .
ls_data_change-ZBG0072 = ls_data-ZBG0072 * fiyat_katsayi .
ls_data_change-ZBG0073 = ls_data-ZBG0073 * fiyat_katsayi .
ls_data_change-ZBG0179 = ls_data-ZBG0179 * fiyat_katsayi .
ls_data_change-ZBG0180 = ls_data-ZBG0180 * fiyat_katsayi .
ls_data_change-ZBG0182 = ls_data-ZBG0182 * fiyat_katsayi .
ls_data_change-ZBG0183 = ls_data-ZBG0183 * miktar_katsayi .
COLLECT ls_data_change INTO lt_data_change .

ENDLOOP .
ENDLOOP.

CLEAR C_TH_DATA[] .

*** TAKIM KAPALI KÜBÜNDEKI DATALAR DEGISMEYECEK AYNEN KORUNUYOR

LOOP AT lt_data INTO ls_data .
MOVE-CORRESPONDING ls_data to <sdata>.
COLLECT <sdata> INTO c_th_data.
ENDLOOP.

*** TAKIM AÇIK KÜBÜNE EKLENECEK KAYITLAR

LOOP AT lt_data_change INTO ls_data .
MOVE-CORRESPONDING ls_data to <sdata>.
COLLECT <data> INTO c_th_data.
ENDLOOP.
endmethod.

Friday, January 15, 2010

FOX Help

Formula Calculation
Overview of Features
The planning function of type Formula Calculation offers you a simple programming language for manipulating transaction data. It includes elements that can be found in many macro languages for business applications:
  • Statements that change transaction data using operators and functions for example: REVENUE = SLSQTY * PRICE.
  • A form of conditional statement for example: IF expression. statement. ENDIF.
  • General loop construct for example: DO. statement. IF expression. EXIT. ENDIF. ENDDO.
  • A special loop construct FOREACH that iterates over all characteristic values of one or several characteristics in the transaction data. The exact explanation of the construct can be found further below in a special section.
  • A DATA statement for matching auxiliary variables.
  • A comment option. Comments begin with '*' at the start of the row.
Internal Data Objects and Address
The internal data objects that are edited are subsets of the transaction data contained in the planning package. The user executes a planning function by selecting a package and a parameter group. This package is divided into smaller data objects made up of transaction data. If a formula requires reference data, these data objects are also created from this reference data. Note: If it is not possible to create data objects, a formula is not executed. The data objects are only different in terms of the characteristic values of the characteristics to be changed. The values of the other characteristics are the same. If no characteristics are selected to be changed, the formula is executed for each transaction data record. Therefore, as far as the system is concerned, the planning function is not called once for each package, but once for each data object. Each key figure value in the data object can now be addressed uniquely and changed by the functions due to the exact specification of the characteristic value of the characteristic to be changed, and the specification of the key figure name. In order to understand how a formula works, it may be useful to define a layout in which all the characteristics to be changed are placed in the lead columns and the remaining characteristics are placed in the header. The formula is then processed for all combinations. Of course the reference data that is referred to in the formulas is not available in the current package. For this reason, you may have to extend the layout to include columns with reference data. Restrict the values in the package as far possible to the characteristics that are not to be changed in the formula so that less data objects are generated.
In practice, some functions are always executed for all or a large number of the key figures. With a very large number of key figures, it can be awkward to have to write the same equation for each key figure. Therefore, there are two possible ways of expressing the key figure reference for a formula:
  • You make no entry for key figures. In this case, the system executes the calculation described by the formula for all key figures of the planning level. For example, copying version 001 to version 002 can be written as a formula as follows: { 002 } = { 001 }.
  • You explicitly enter the key figure for which the calculation should be executed. For this you include the generic entry "key figure name" in the list of fields to be changed, and enter the technical name of the key figure that is to be calculated in the formula operators. To execute the example shown (copying between versions) for the REVENUE key figure only, for example, write { REVENUE, 002 } = { REVENUE, 001 }.
There are two options if you want to access reference data in the formulas. You take the field that makes the reference data different from the data of the active planning package as the field to be changed (for example: Version technical name 0VERSION). You then write the operand like this { REVENUE, 002 } = { REVENUE, 001 }. The other option is to address the reference data explicitly. To do this, you enter the name of the characteristic and the value in the operand: { REVENUE = { REVENUE | 0VERSION = 001 }. The data of version 002 is then in the active planning package. The formula is run for each data record of the active planning package. The difference between the two variants is not only syntactic. The creation of data objects is controlled and this defines how often the formula is executed. For { REVENUE, 002 } = { REVENUE, 001 } the procedure is as follows: If there is no data in version 002, the internal data objects are created using the data from version 001. When the formula is executed, the data is created in version 002. { REVENUE, 002 } = { REVENUE, 001 } is suitable for formulas that create new data from reference data. In the case of { REVENUE} = { REVENUE | 0VERSION = 001 }, the formula is only run for all records in version 002 because it cannot be determined from the formula how the records from version 001 should be transformed to records from version 001. If there are no records, the formula is not run. No records are created. This format is suitable for formulas that require reference data to evaluate existing data.
Example: The following transaction data is available:

0VERSION0COSTCENTERREVENUE
00147113
00108152
00247119

Result from: { REVENUE, 002 } = { REVENUE 001 }.
0VERSION0COSTCENTERREVENUE
00147113
00108152
00247113
00108152

Two data objects are formed.
0COSTCENTER
4711
0815

Result from: { REVENUE } = { REVENUE | 0VERSION = 001 }.
0VERSION0COSTCENTERREVENUE
00147113
00108152
00247113

Data objects
0VERSION0COSTCENTER
0024711

Before executing the parameter group, the system decides which reference data is required based on a formula. The original selection is enhanced for the reference data selection. Assume that only data of version 002 is contained in the planning package. Based on the formula row { ERLOES, 002 } = { ERLOES, 001 }, the selection is enhanced with the value Version 001. Unfortunately it is not always possible to decide which reference data is required before starting a planning function of type Formula. If this occurs, the selection is deleted.
The cases in which this can occur are:
  • Use of function TMVL to change the value of a time characteristic
  • Use of function ATRV or ATRVT to read attribute values
  • Call of function modules
The selection is only deleted, however, if the results of the functions for addressing reference data are used.

DATA FISCPER TYPE 0FISCPER. 
DATA ACTPER TYPE 0FISCPER. 
ACT = VARV( AKTPERIO ).
FISCPER = ACTPER. 
FISCPER = TMVL ( FISCPER , -12 ).
{ ERLOES, ACTPER } = { ERLOES, FISCPER }.

In the example, the formula variable ACTPER is first filled from the global variable AKTPERIO. This value is then assigned to variable FISCPER. The value of ACTPER is then decreased by 12 using the function TMVL. Finally, the value of key figure ERLOES in period FISCPER is assigned to the key figure ERLOES in period ACTPER.

Conditions
Characteristics, which are not marked as to be changed, can be selected as characteristics for conditions. Selection conditions can be specified for these characteristics. A formula is only calculated if the selection condition is fulfilled for the internal data object. The "key figure name" can also be selected here like the other characteristics of the level for conditions are selected. If conditions are set for the field "key figure name", then the formulas are only calculated for those key figures that satisfy the selection conditions.

Formula or Exit: Which function type is the right one?
In addition to the formula calculation there is also the option of creating planning functions of type Exit in order to manipulate transaction data using a programming language. Weigh up the following points when deciding which function type to use:
  • Planning functions of type Formula are easy to learn and only require a small amount of training. This function is ideally intended for a user in Controlling, who has already mastered an algorithmic programming language or a macro language, and can solve most of the problems with the formula language.
  • Planning functions of type Exit must always be written if you require features that are yet not available by any other means. Example: When calculating costs, customer-defined tables have to be accessed. So far, no feature is available to access formulas in any tables.
  • You can call function modules in formulas. In this way it is possible for part of the logic to come from the function modules and part from the formula.
  • Generally, Exit function modules achieve a higher level of performance than formula calculations. The reason for this is mainly that each operand and each result from complex formulas are read separately from an internal table. In a self-written program, you would optimize this. This emphasis on performance is a decisive criterion with larger sets of data.
    In addition, you can also find information on formula calculation in the help on the application.
Data Declarations
Auxiliary variables can be defined as follows:
DATA HELPVAR TYPE I.
DATA KEYRA TYPE KEYFIGURE_NAME.
Data declarations are introduced with the word 'DATA', followed by the name of the auxiliary variable. The name must start with a letter and can contain digits and letters, however no special characters. Variable names must differ from keywords such as DATA, ELSEIF or SIN. If the formula syntax is later enhanced by new keywords, existing variables with the same name will become invalid.
To avoid errors, do not name the variables like characteristic values, or enclose the characteristic values in single quotes.
There are predefined types I (integers) for index operations and F (floating points) to calculate. You can also define variables of the type of characteristics to be changed. The technical name of a characteristic serves as the type description. If you have selected "key figure name", variables of the type KEYFIGURE_NAME can be defined. You can display the valid data types, when you press the pushbutton 'data types'.
You can also create data types for attributes. If the attributes are of the type key figure, auxiliary variables must be created of the type F or I. This is then displayed, where in the field for the type, the string attribute name = 'F' or attribute name = 'I' is displayed. You require the technical name of the attribute, when you want to read attribute values with the function ATRV.

Expressions
You can use the following elements in expressions:
1. Constants, which consist of digits and a decimal point.
2. Variables, which you have declared with the data statement.
3. Operands, that you can select using F4 Help. If the operands are not only addressed using key figure names, then the operands are contained in curly brackets '{' and '}'. If, on the other hand, "Key figure name" is the only characteristic to be changed, then you can write down the key figure name directly as the operand. The valid syntax and correct sequence of characteristics is displayed in the row above the Editor. You can use the F4 help to compile valid operands. If the characteristic values contain blank characters or symbols such as '+', '-', '*' in the operands, then the characteristic values have to be contained in quotation marks.
There is always an external and an internal format for a characteristic value. For example, date values are presented externally as 3.12.1963 and internally as 19631203. Always use the internal format in formaulas. In operands you can also use variables instead of characteristic values.
Note: If "key figure name" is the only characteristic to be changed, and you have defined a variable of the type KEYFIGURE_NAME and want to change key figures with it, then you must also enclose this in curly brackets. The following statement sets all key figures to the value 1. The FOREACH construct fills the variable KEYFIG with all key figure names of key figures, which are available in the level.
DATA KEYFIG TYPE KEYFIGURE_NAME.
FOREACH KEYFIG.
{ KEYFIG } = 1. ENDFOR.
4. Operators
OperatorMeaning
+Sign
+Addition
-Sign
-Minus
*Multiplication
/Division
DIVDivision of integers
MODModulo operation
**Exponentiation


5. Functions with one operand
FunctionMeaning
CEILsmallest integer value, which
is not smaller than x
FLOORlargest integer value, which
is not larger than x
TRUNCinteger part of x
FRACfraction of x
ABSamount (absolute values) |x| of x
SIGNSignum (sign) of x
ACOSArccosine(x) in the range [-pi/2, pi/2],
x from [-1, 1]
ASINArcsine(x) in the range [0, pi],
x from [-1, 1]
ATANArctangent(x) in the range [-pi/2, pi/2]
(pi = 3.1415926535897932)
COSCosine of an angle
given by the radius
SINSine of an angle
given by the radius
TANTangent of an angle
given by the radius
COSHHyperbolic cosine
SINHHyperbolic sine
TANHHyperbolic tangent
EXPExponential function to the base
e = 2.7182818284590452
LOGnatural logarithm
(this means to the base e)
LOG10logarithm of x to the base 10, x > 0
SQRTsquare root of a non-negative number
STRLENlength of character string
VARVvariable value (argument = variable name)
VARCnumber of values of a variable
(argument = variable name)


6. Functions with two operands
FunctionMeaningOperand1Operand2
MAXMaximum
MINMinimum
ATRVRead attributeAttribute typeVariable
TMVLRead time chara.ValueOffset
PERPPerpetual annuityKey figureInterest rate
C2DATEDetermine dateTime characteristicStart/end value
CONCATConcatenate operandsOperand1Operand2
VARIi-ter variable valuevariableindex
ROUNDRoundingkey figuredecimal places


7. Functions with three operands
FunctionMeaningOperand1,Operand2,Operand3
DISCDiscountingKey figure, Interest rate, Years
DECDDeclining balanceStart value, Percentage, Years
depreciation
ATRVTRead Time-DependentAttribute type, Variable,
AttributeDate
ATRVTRead partial stringVariable, Offset, Length
SUBSTRRead substringVariable, Offset, Length
REPLACEReplace CharacterSource String, Pattern, Replacement


8. Function with four operands
FunctionMeaningOperand1,..,Operand4
DECLStraight-line dep.Start value, Residual value,
Percentage, Years


9. Functions with five operands
FunctionMeaningOperand1,...,Operand5
CURCCurrencyAmount, Date, Exchange Rate Type
TranslationSource Currency, Target Currency

10. Functions without operands
FunctionMeaning
OBJVRead characteristic value
If no special operands are specified, then you can specify a constant as well as the valid operands.
The operand interest rate and percentage are given as a percentage, that is 10% as 10 and not as 0.1.
With function C2DATE, E has to be specified as the end value of a period and S as the start value of a period.
Function CURC calculates the amount in another target currency. Note that small rounding differences may occur with floating-point key figures, as internally calculations are performed to nine decimal places.
The functions have a value as a result, and not a time series. In the case of depreciation it would be ideal to have a time series with the depreciation amounts. To enable this, you must complete a formula for each point in time.
The PERP function calculates the perpetual annuity from a capital according to the following formula:
Result = Key figure value * ( interest rate / 100 )
The DISC function discounts an amount according to the following formula:
Result = Key figure value / ( ( 1 + interest rate / 100 ) ** years )
The DECD function calculates a declining-balance depreciation according to the following algorithm:
1. Step: Carry out years.
Intermediate value = intermediate value + ( start value -
intermediate value ) * percentage / 100.
2. Step: Result = start value - intermediate value
The DECL function calculates a straight-line depreciation according to the following formula:
Result = start value -
( ( start value - residual value ) * percentage / 100 *
years )
Conditional statements can be realized using the IF statement. After an IF statement, any further conditional statements with ELSEIF can follow. The ELSE statement is for dealing with the remaining cases within a chain of conditional statements. The schema appears as in the following example.IF expression1. statement1. ELSEIF expression2. statement2. ELSE. statement3. ENDIF.
Expressions within the IF statement consist of operands, relational operators and logical operators. The valid operands are the same as those discussed in the section 'Expressions' plus additional variables and constants. Note that constants can only be on the right side of a relational operator. '=', '', '=', '' are relational operators. To check the special case, whether an operand oper1 has the initial value, you can write: IF oper1 IS INITIAL. or IF oper1 = '#'. In addition, there are the logical operators NOT, OR and AND for constructions such as: IF NOT oper1 oper2.
The operators CP, CO, CA, CS also exist for working with character-type operands. Operators in the expression c1 op c2 have the following meanings:
  • CP (Contains Pattern):
    The whole character string c1 corresponds to c2 (c1 "matches" c2). There
    can be normal characters and wildcard characters in pattern c2. '*'
    masks a particular character string and '+' a particular character.
  • CO (Contains Only):
    c1 only contains characters from the c2 character set.
    If c1 or c2 is of internal type C, the full length of the field is entered in the comparison. This means that blank characters at the end are also included.
    If c1 is of type STRING and is empty, the outcome of the comparison is always positive.
    If c2 is of type STRING and is empty, the outcome of the comparison is always negative, unless c1 is also an empty string.
  • CA (Contains Any):
    c1 contains at least one character from the c2 character set.
    If c1 or c2 is of type C, the full length of the field is entered in the comparison. This means that blank characters at the end are also included.
    If either c1 or c2 is of type STRING and is empty, the outcome of the comparison is always negative.
  • CS (Contains String):
    c1 contains the character string c2. Concluding blank characters in c1 and c2 are ignored if the corresponding field is of type C.
    An empty character string c2 (blank characters with type C or an empty string with type STRING) is contained in every character string c1. This includes the empty character string itself. However, no non-empty character string is contained in an empty character string c1.
Loop Constructs
DO Loops
Statements, which appear between DO and ENDDO are repeated as many times as required. However, the loop is interrupted by the EXIT statement. The number of loop runs can also be controlled DO N TIMES by a variable of type I. N can also be replaced with an integer.

FOREACH Loops
With the FOREACH variable statement, all values of a variable are iterated. This affects the characteristic values that exist in the transaction data of the current data object (not necessarily all values that are maintained for the characteristic). This loop construct is closed with the statement ENDFOR. The characteristic values are processed in ascending order. If you require combinations of characteristic values, you can use the statement in the form FOREACH Variable1, Variable2. This construct delivers the available combination of characteristic values of the current data objects.
Comments on Runtime Behavior:
Before making an entry in the FOREACH loop, all characteristic values available in the data object are collected and sorted. Then these characteristic values are delivered into the FOREACH loop one after the other. If a new characteristic value is generated in the loop and written to the transaction data, it is only taken into account with the next FOREACH loop. However, the FOREACH construct takes a lot of processor time and should be used as infrequently as possible. Always consider carefully whether your only option is to use a construct of type FOREACH Variable1, Variable2. and not two loops as runtime behavior is normally improved in this case.
The following example illustrates a bad program:

DATA COUNTRY TYPE 0BPS_CNTRY.
DATA PRODUCT TYPE 0BPS_PRODU.
DATA FISCPER TYPE 0FISCPER.

    FOREACH COUNTRY.
        FOREACH PRODUCT.
            FOREACH FISCPER.
                {COUNTRY, PRODUCT, FISCPER} = {COUNTRY, PRODUCT, FISCPER} * 2.
            ENDFOR.
        ENDFOR.
    ENDFOR.

The following example illustrates a better program:
DATA COUNTRY TYPE 0BPS_CNTRY.
DATA PRODUCT TYPE 0BPS_PRODU.
DATA FISCPER TYPE 0FISCPER.

FOREACH COUNTRY.
    FOREACH PRODUCT.
        FOREACH FISCPER.
            IF {COUNTRY, PRODUCT, FISCPER} > 0.
            {COUNTRY, PRODUCT, FISCPER} = {COUNTRY, PRODUCT, FISCPER} * 2.
            ENDIF.
        ENDFOR.
    ENDFOR.
ENDFOR.

In this program example, new values are only generated if they are not equal to zero. Because the amount of values that can occur in variables PRODUCT and FISCPER does not have to be refreshed, this saves a lot of time in terms of the calculation. An update is only performed when both loops FOREACH PRODUCT. and FOREACH FISCPER. are executed again. If a formula generates zero values, the system does not write these back to the internal buffer. These zero values are not visible in subsequent planning functions or in manual planning. This also means that the value 0 is not assigned to existing data. Zero values do not have to be generated explicitly.
The following example illustrates the recommended programming:

DATA COUNTRY TYPE 0BPS_CNTRY.
DATA PRODUCT TYPE 0BPS_PRODU.
DATA FISCPER TYPE 0FISCPER.

FOREACH COUNTRY, PRODUCT, FISCPER.
    IF NOT {COUNTRY, PRODUCT, FISCPER} IS INITIAL.
    {COUNTRY, PRODUCT, FISCPER} = {COUNTRY, PRODUCT, FISCPER} * 2.
    ENDIF.
ENDFOR.

Additional variants of FOREACH loops
With the FOREACH Variable IN REFDATA you can perform iteratation for all characteristic values that are available in the reference data.
With the FOREACH Variable IN SELECTION you can perform iteration for all characteristic values in the current planning package.
With the FOREACH Variable IN VARIABLE Var you can perform iteration for all characteristic values for a globale variable Var.

Issuing Messages
Messages can be issued with MESSAGE Tnnn(class) or with MESSAGE Tnnn(class) WITH operand1 ... operand4. T is the type of message. 'E' = error, 'I' = information. nnn is a three-figure number. class is the message class. Optionally, a maximum of 4 operands can be entered additionally. Operands can either be variables or strings enclosed in quotation marks. If you trigger a type 'E' error, then the planning function results are not transferred into the internal transaction data buffer.
The messages are gathered and displayed after executing the function. If you edit plan data, the messages are only displayed, if at least one type 'E' error is triggered. Otherwise the display does not occur.
It is best if you create your own message class for error messages, and do not use any of the messages that are delivered by SAP. Note that you must transport your own message class from the test system into the production system.

Calling Function Modules
You use the CALL FUNCTION statement to call function modules. The names of the function modules have to be entered in table RSPLF_FDIR. You can do this in transaction SM30. In the following example, function module UPF_DISTR_RATE_GET is called.

DATA FISCPER TYPE 0FISCPER.
DATA FISCYEAR TYPE 0FISCYEAR.
DATA RATE TYPE F.
DATA KYF TYPE KEYFIGURE_NAME.

FOREACH FISCYEAR, KYF.
FISCPER = OBJV( ).

CALL FUNCTION UPF_DISTR_RATE_GET
    EXPORTING I_FISCPER = FISCPER
                            I_VERSION = 'OPTIMISTIC'
    IMPORTINGE_RATE = RATE.

{KYF,FISCYEAR} = { KYF, FISCYEAR } * RATE.
ENDFOR.

EXPORTING, IMPORTING, and CHANGING parameters can be transferred to function modules. The parameters have to have simple types (F, I, D, STRING and types of characteristics and attributes). Class references, structures and some table parameters are not permitted. All non-optional IMPORTING parameters for a function module have to be filled. If the function module raises an exception, you have to work with construct MESSAGE .... RAISING. THis is shown in the following example. The messages are transferred to the log. Class-based exceptions are also not permitted.

FUNCTION UPF_DISTR_RATE_GET.
*"--------------------------------------------------------------------
*"*"Local Interfaces:
*" IMPORTING
*" REFERENCE(I_FISCPER) TYPE /BI0/OIFISCPER
*" REFERENCE(I_VERSION) TYPE STRING DEFAULT 'OPTIMISTIC'
*" EXPORTING
*" REFERENCE(E_RATE) TYPE F
*" REFERENCE(E_FISCYEAR) TYPE /BI0/OIFISCYEAR
*" EXCEPTIONS
*" ERROR
*"--------------------------------------------------------------------
DATA: l_fiscper_3 TYPE n length 3.
l_fiscper_3 = i_fiscper+4(3).
IF i_version = 'OPTIMISTIC'.
e_rate = l_fiscper_3 / 5.
ELSE.
e_rate = l_fiscper_3 / 7.
ENDIF.
e_fiscyear = i_fiscper(4).
if l_fiscper_3 is initial or e_Fiscyear is initial.
message e001(upf) with 'Initial Values'(TIV) raising error.
endif.
ENDFUNCTION.

Examples
Price Planning
In this example the prices are stored in the transaction data. Characteristics to be changed are key figure name, version (0VERSION ) fiscal year (0FYEAR ) and customer (0CUSTOMER ). It is planned in version 1. Prices are stored in version 2. The records have the special feature that the characteristics Customer and Fiscal Year have the value "non assigned", and must therefore be included in the quantity of characteristics to be changed. Otherwise, for every object to be planned in version 1, there has to be an object in version 2 that can be used to determine the price. A message is issued if no price is planned for an article. The calculation is only executed if the planned combination {QUANTITY,1,FYEAR,CUSTOMER} is greater than 0.

DATA CUSTOMER TYPE 0CUSTOMER.
DATA FYEAR TYPE 0FYEAR.
DATA ARTICLE TYPE 0ARTICLE.
IF {PRICE,2,#,#} = 0.
ARTICLE = OBJV( ).
MESSAGE I001(/SEM/003) WITH ARTICLE.
ELSE.
FOREACH FYEAR, CUSTOMER
IF {QUANTITY,1,FYEAR,CUSTOMER} > 0.
{REVENUE,1,FYEAR,CUSTOMER} = {QUANTITY,1,FYEAR,CUSTOMER} * {PRICE,2,#,#}.
ENDIF.
ENDFOR.
ENDIF.

You may expect the characteristic Article to appear in the list of characteristics to be changed, even though the prices used for the calculation refer to Article. Using the Article characteristic as an example, the following is true:
DATA CUSTOMER TYPE 0CUSTOMER.
DATA FYEAR TYPE 0FYEAR.
DATA ARTICLE TYPE 0ARTICLE.
FOREACH ARTICLE, FYEAR, CUSTOMER.
IF {PRICE,2,#,#,ARTICLE} = 0.
MESSAGE I001(/SEM/003) WITH ARTICLE.
ELSE.
    IF {QUANTITY,1,FYEAR,CUSTOMER,ARTICLE} > 0.
    {REVENUE,1,FYEAR,CUSTOMER,ARTICLE} = {QUANTITY,1,FYEAR,CUSTOMER,ARTICLE} * {PRICE,2,#,#,ARTICLE}.
    ENDIF.
ENDIF.
ENDFOR.

The characteristic is superfluous to the formula as the values of the characteristic are not changed. When calculating the planned revenue, the same article is referred to on both sides of the relational operator. Under these circumstances SAP advises against including the characteristic in the quantity of characteristics to be changed, as it is not required for the calculation, but negatively affects performance when the values are read. Another way to accelerate the formula is to save the value of the element {PRICE,2,#,#} in an auxiliary variable and work with this. If the value of a characteristic is required to issue error messages or determine attribute values, the value can be read by function OBJV().
You can make the formula even shorter by accessing the reference data explicitly. In this case there are no characteristics to be changed except for the key figure name. The formula is run through the data record. A FOREACH loop over the characteristics to be changed is not necessary.

DATA ARTICLE TYPE 0ARTICLE.
IF {PREIS | 0VERSION = 2, 0GJAHR = #, 0CUSTOMER = #} = 0.
ARTICLE = OBJV( ).
MESSAGE I001(/SEM/003) WITH ARTICLE.
ELSE.
ERLOS = MENGE * { PREIS | 0VERSION = 2,0GJAHR = #,0CUSTOMER = #}.
ENDIF.

Price Planning with Prices in Master Data
How does price planning work when the price is stored in the master data? You use function OBJV to get the value of the article. The value of attribute 0PRICE is read using function ATRV. The ATRV function includes 2 arguments, in its simplest form. The first argument has to be the name of a master data attribute; the second argument has to be a variable. The value of the attribute is read using the variable value in the master data table. Two cases have to be distinguished with Formula compound characteristics:
  • If the higher-level characteristics are fields to be changed, the values of these characteristics have to be specified for the function in the form of variables. In this case, the number of arguments for the function complies with the number of field to be specified.
  • If the higher-level characteristics are not contained in the fields to be changed, values are filled automatically from the values for the current package. In the following example, only the key figure name is a characteristic to be changed.
DATA ARTICLE TYPE 0ARTICLE.
ARTICLE = OBJV().
REVENUE = ATRV( '0PRICE', ARTICLE ) * QUANTITY.

Proportional Planning
Characteristics to be changed are key figure name, version (0VERSION) and (0CUSTOMER).
DATA TOTREVEN TYPE F.
DATA TOTQUANT TYPE F.
DATA CUSTOMER TYPE 0CUSTOMER.
FOREACH CUSTOMER.
TOTREVEN = TOTREVEN + {REVENUE,2,CUSTOMER}.
TOTQUANT = TOTQUANT + {QUANTITY,2,CUSTOMER}.
ENDFOR.
FOREACH CUSTOMER.
{REVENUE,1,CUSTOMER} = {QUANTITY,1,CUSTOMER} * TOTREVEN /TOTQUANT.
ENDFOR.

Copying with Condition to the Value of a Key Figure
The characteristic to be changed is the version. The key figure name is selected as the characteristic for conditions. REVENUE is selected as the value for key figure names. The following formula copies the revenue from version 1 to version 2, if the revenue in version 1 is greater than 500. In this example, we cannot use the copy planning function as no conditions can be formulated for key figure values. Normally it is more beneficial to use special planning functions instead of formulas, as these are implemented more efficiently.
IF {1} > 500.
{2} = {1}.
ENDIF.

Copying with Condition and Iteration Using Key Figure Name

Characteristics to be changed are key figure name and version. In contrast to the example above, all key figures are now copied to version 2 if the revenue is greater than 500. So that you do not have to write the assignment for all key figures, we define a RATIO variable of type KEYFIGURE_NAME, and iterate it for all key figures in the planning level using the FOREACH construct.

DATA RATIO TYPE KEYFIGURE_NAME.
IF { REVENUE, 1 } > 500.
FOREACH RATIO.
{ RATIO, 2 } = { RATIO, 1 }.
ENDFOR.
ENDIF.

Checking Data for Plausibility
Characteristics to be changed are key figure name, version and article. We check whether the planned revenue achieves at least 90 percent of the revenue of version 1. If the revenue falls below the boundary, a warning is issued.
DATA ARTICLE TYPE 0ARTICLE.
DATA MINERLOS TYPE F.
FOREACH ARTICLE.
MINREVENUE = { ERLOS, 1, ARTICLE } * 0.9.
IF { REVENUE, 2, ARTICLE } < MINREVENUE.
* The planned revenue for article &1 fell below the predefined minimum revenue
MESSAGE I034(ZSEM) WITH ARTICLE.
ENDIF.
ENDFOR.

Rolling Planning
Characterisics to be changed are version and fiscal year/period. The actual data of the current period is copied into the plan version. The difference is distributed over the remaining periods. The current period is determined from a variable.
DATA CURRPER TYPE FISCPER.
DATA FISCPER TYPE FISCPER.
DATA SUM TYPE F.
DATA DELTA TYPE F.
* Read periods from the variables with technical name PERIOD
CURRPER = VARV( 'PERIOD' ).
* Get total on weighting
FOREACH FISCPER.
IF FISCPER > CURRPER.
SUM = SUM + { 1, FISCPER }.
ENDIF.
ENDFOR.
* Determine delta between plan value and actual value
DELTA = {1, CURRPER} - {0,CURRPER}.
* Set plan value to actual value
{1,ACTPER} = {0, ACTPER}.
* Distribute delta weighted
FOREACH FISCPER.
IF FISCPER > CURRPER.
{1,FISCPER} = {1,FISCPER} + DELTA * {1,FISCPER} / SUM.
ENDIF.
ENDFOR.

Depreciation
Characteristics to be changed are key figure name and fiscal year. The value of key figure 0AMOUNT is calculated for 5 years. The cost price is 1000. Residual value is 100. Depreciation percentage rate is 20 percent. Straight-line depreciation is carried out. In this example the depreciation function is not the focus; the TMVL funtion is. As its first argument, the function has the value of a time characteristic. As a second argument it has an offset. The offset specifies which next larger value the function is to deliver. You can also transfer negative offsets. Then the corresponding smaller values are delivered. You cannot perform the same function with a FOREACH loop, as all years do not have to be available in the transaction data.

DATA YEARS TYPE I.
DATA FYEAR TYPE 0FISCYEAR.
FYEAR = VARV( 'CURRYEAR' ).
DO.
YEARS = YEARS + 1.
FYEAR = TMVL( FYEAR, 1 ).
{0AMOUNT, FYEAR} = DECL( 1000, 100, 20, YEARS).
IF YEARS = 5.
EXIT.
ENDIF.
ENDDO.

Calculating with Data Type 'D'
You can also perform calculations with data type 'D'. A short example is now given. In the FOREACH loop, the the date of the first day in FISCPER is calculated in D1, and the last day in the FISCPER is calculated in D2. The difference between D1 and D2 is formed in I1 and two days are subtracted. I1 has type I. If the data specified in D1 and D2 are invalid, the result is 0. When you perform calculations with type D fields, the constant operands are checked to make sure that the dates specified are valid. Therefore, you can write I1 = D2 - D1 - 2., but an auxilliary variable I2 has to be used.

DATA D1 TYPE D.
DATA D2 TYPE D.
DATA I1 TYPE I.
DATA I2 TYPE I.
DATA FISCPER TYPE 0FISCPER.
FOREACH FISCPER.
* Calculate 1st day of FISCPER
D1 = C2DATE( FISCPER, S ).
* Calculate last day of FISCPER
D2 = C2DATE( FISCPER, E ).
* Calculate the difference between last and 1st day minus two days
I2 = 2.
I1 = D2 - D1 - I2.
MESSAGE I001(UPF) WITH 'DIFFERENCE' I1.
ENDFOR.

Working with Character Strings
In the following example. the system checks whether the characteristics fiscal year/period (0FISCPER), fiscal year (0FISCYEAR) and the three- figure posting periods (0FISCPER3) are filled consistently. The fiscal year/period characteristic is seven characters long. The first four characters contain the fiscal year. The posting period is stored in characters five to seven. Using function SUBSTR (characteristic value, offset, length), the appropriate values are read from the value for fiscal year/period. If the characteristic value for fiscal year/period is initial, it is filled with the concatenated value of fiscal year and posting period. The CONCAT function is used.
DATA FISCPER TYPE 0FISCPER.
DATA FISCPER_CMP TYPE 0FISCPER.
DATA YEAR TYPE 0FISCYEAR.
DATA PER TYPE 0FISCPER3.
DATA PER_CMP TYPE 0FISCPER3.
DATA YEAR_CMP TYPE 0FISCYEAR.
DATA KYFNM TYPE KEYFIGURE_NAME.

YEAR = OBJV( ).
PER = OBJV( ).

FISCPER_CMP = CONCAT( YEAR, PER3 ).
FOREACH KYFNM, FISCPER.
IF FISCPER IS INITIAL.
{KYFNM,FISCPER_CMP} = {KYFNM,FISCPER}.
ELSE.
PER_CMP = SUBSTR( FISCPER, 4, 3 ).YEAR_CMP = SUBSTR( FISCPER, 0, 4 ).
IF YEAR YEAR_CMP OR PER PER_CMP.
* Error message
MESSAGE E021(/SEM/003) WITH YEAR YEAR_CMP PER PER_CMP.
ENDIF.
ENDIF.
ENDFOR.

Testing Planning Functions
In this section, you find notes on how you test planning functions systematically and understand how they work.
1. You create packages at the level of target data (data, which was generated or changed), reference data (if the function requires reference data) and a package, which contains target and reference data.2. Restrict the packages so that only one or two records are in the target and reference data. It is difficult to analyze a function, which changes 50,000 data records.3. Create layouts for every package. The layouts have the characteristics to be changed in the lead columns, the key figures in the data columns, and the remaining characteristics in the header area. In this way, you can check whether reference data exists for every object in the target data. It is often overlooked that the values of the unit fields in the reference data do not match with the units in the target data.4. You can issue runtime information using the MESSAGE statement for planning functions of the type formula. If you want to get to the debugger, you can write the BREAK-POINT statement into the formula. When executing the parameter group, you get to the debugger and see the generated ABAP/V coding.5. For the messages in the log, you have the possibility to display details on a message. Press the detail button, then the system displays a dialog field in which you see the selection conditions for the records where the message was triggered. It concerns the quantity of records whose characteristic values are the same regarding the characteristics, which are NOT selected as characteristics to be changed.6. If you are executing the planning function in the trace, you receive the following information:
a) With which data object a function was executed. You can navigate to a detail screen from the data object display.
b) On the detail screen you can see records before and after the planning function was executed.
c) If reference data was required, you also see the reference data that was read. Reference data then has to be read in if it does not exist in the active planning package. Some functions such as 'delete data', do not require reference data.
d) Alternatively you can branch to the display with messages that belongs to the data object.
http://help.sap.com/saphelp_nw70/helpdata/EN/43/1dfeff41130bd5e10000000a422035/content.htm

Friday, January 8, 2010

Apple Store Has Surpassed 3 Billion Downloads



Apple has posted an official press release to inform that the App Store has surpassed 3 billion downloads in less than 18 months. This news is really exciting enough to impress Apple and even the whole industry.

“This is like nothing we’ve ever seen before,” said with emotion by Steve Jobs, Apple’s chief executive, “The revolutionary App Store offers iPhone and iPod touch users an experience unlike anything else available on other mobile devices, and we see no signs of the competition catching up anytime soon.”

It is easy to find that the pace of downloads has grown exponentially. Apple announced on Apr. 23 that its store surpassed 1 billion downloads, close behind it reached 2 billion downloads on Sep. 28, and now, 3 billion. Following such an increase trend, a larger download volume may be released in the near future.

Get started with iPhone application development

How can you get started with iPhone application development? Where can we get all the best iPhone Application development resources? Please have a look at the list of iPhone resources below, I am sure they can help you develop your first iPhone Web Application / Application.iPhone Application Development Guides
iPhone Application Tips and Tricks
iPhone Resources and Simulator
Top iPhone Applications / Web Applications
Books

Monday, December 14, 2009

BW Infoobject Reference characteristic change

REPORT zevl_infoobject_ref_fixer.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: g_iobj TYPE rsiobjnm OBLIGATORY,
g_ref TYPE rsiobjnm ,
g_mark TYPE checkbox AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: g_link TYPE checkbox AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK b2.

PERFORM main.

FORM main.
DATA: s_details TYPE bapi6108.
DATA: t_bapiret2 TYPE bapiret2_t,
s_return TYPE bapiret2.
CHECK ( g_mark = 'X' ).

CALL FUNCTION 'BAPI_IOBJ_GETDETAIL'
EXPORTING
* VERSION = RS_C_OBJVERS-ACTIVE
infoobject = g_iobj
IMPORTING
details = s_details
* RETURN =
* TABLES
* COMPOUNDS =
* ATTRIBUTES =
* NAVIGATIONATTRIBUTES =
* ATRNAVINFOPROVIDER =
* HIERARCHYCHARACTERISTICS =
* ELIMINATION =
.

IF ( g_link = 'X' ).
s_details-chabasnm = g_ref.
s_details-bchreffl = 'X'.
ELSE.
s_details-chabasnm = g_iobj.
s_details-bchreffl = space.
ENDIF.

CALL FUNCTION 'BAPI_IOBJ_CHANGE'
EXPORTING
infoobject = g_iobj
details = s_details
IMPORTING
return = s_return
TABLES
* COMPOUNDS =
* ATTRIBUTES =
* NAVIGATIONATTRIBUTES =
* ATRNAVINFOPROVIDER =
* HIERARCHYCHARACTERISTICS =
* ELIMINATION =
returntable = t_bapiret2.

WRITE: / s_return-message.

LOOP AT t_bapiret2 INTO s_return.
WRITE: / s_return-message.
ENDLOOP.

DATA: t_iobj TYPE STANDARD TABLE OF bapi6108io,
wa_iobj TYPE bapi6108io.
wa_iobj-infoobject = g_iobj.
APPEND wa_iobj TO t_iobj.

CALL FUNCTION 'BAPI_IOBJ_ACTIVATE_MULTIPLE'
TABLES
infoobjects = t_iobj
return = t_bapiret2
* INFOOBJECTS_ERROR =
.

LOOP AT t_bapiret2 INTO s_return.
WRITE: / s_return-message.
ENDLOOP.

WRITE: / 'Please remember to restart rsd1 due to local caching' COLOR COL_TOTAL.
WRITE: / 'If it still doesn''t work, try unlinking and relinking, sometimes master data routines need a little convincing' COLOR COL_TOTAL.

ENDFORM. "main