Scroll Top

How Bad Polling Data Fooled Everyone Except Trump

How Bad Polling Data Fooled Everyone Except Trump

TAKE NOTE (Insights into SAP solutions and Emerging Technology)

Data crunching is only as good as the data you use.

If Barack Obama’s 2012 presidential victory proved big data’s triumph for accurately predicting elections, Donald Trump’s 2016 presidential win could demonstrate the opposite. Prior to Trump’s upset win, virtually all national polls showed the businessman and reality television star trailing Democratic nominee Hillary Clinton. Her win was considered inevitable, with prominent pollsters and pundits merely arguing about how big her guaranteed victory would be.

According to The Washington Post, Clinton’s campaign used a custom algorithm called Ada that staff fed “a raft of polling numbers, public and private” to help Clinton’s team decide where they should dedicate their resources. But while Ada could help the Clinton campaign best determine when and where to trot out pop stars Jay Z and Beyoncé to campaign rallies, it apparently overlooked “the power of rural voters in Rust Belt states,” the report said.

Trump’s campaign, as The New York Timesreported a few days prior to the election, seemed to have relied on much more primitive methods for determining where best to concentrate resources. As the Time’s report describes, they seemed to base their decisions from the emotions of crowds attending Trump’s rollicking campaign events.

BIG Data vs Emotional Intelligence?

Read more here at Fortune.



UNDER DEVELOPMENT(Information for ABAP Developers)

Running ABAP Traces in the New Debugger

Running ST05 in the ABAP Debugger

I was recently on a Skype learning session at a client where the topic was “Advanced Debugging Techniques”. The developer delivering the live training was showing examples of using Debugger Scripting. For those that need a refresher on what that is, check out our blog post, Fast, and Easy SAP ABAP Debugger Scripting.

While explaining how to execute a statement trace for anSAP ABAP Program using the delivered script “RSTPDA_SCRIPT_STATEMENT_TRACE“, one of our new ABAP developers asked if there was a way to trace SQL, similar to running ST05. And this Blog post was born…

The Answer is a resounding YES! Not only can you trace SQL, but you can trace buffers, RFC’s, Enqueues, and the Classic SE30 ABAP Trace.

Let’s run an example using the ST05 Performace trace. If you need a refresher on what this traceis, and how to interpret it take a look at our blog post ABAP Database SQL Analysis Using The Performance Trace parts one and two. Please note you also require ECC SAP_ABA release 702.

Read more

Q&A (Post your questions to Facebook or Twitter and get the answers you need)

Q. Tony, we have both Real Time and Batch programs handling special characters when generating the XML output. Just to give you a quick background, EMALL was experiencing an issue where the response they got was missing a large number of NIINS, e.g. sent request for 89,000 NIINs but response only contained around 60,000 records when ALL 89,000 should have been returned regardless of there being data in EDW or not.  Good news is that we are including ALL of the requested records in the response but when they open the file all of the records after the one that has a ‘&’ in its description are dropped and it looks like they are receiving lessNIINs that the expected.

We tested out the Real Time Response for a NIIN that has a description with ‘&’ and the record is going out like ‘&’.  But batch is not sending it out with the ‘&’.  Should updates to the program be made before generating the XML or is it something that is done while the file is being converted to XML?

A. Fernando – thanks for the great question!

In ABAP we have a built in function to transform and replaces certain special characters with escape characters according to a rule specified. This function gets the content of the character string in text,and replaces certain special characters with escape characters according to a rule specified in format.

The possible values of format are defined as constants in the class CL_ABAP_FORMAT. Each value defines which special characters are replaced, and how. There are rules for special characters in markup languages (XML and HTML), in URIs and URLs, as well as in regular expressions and character string templates. format expects data objects of the typei. An invalid value for format raises an exception of the class CX_SY_STRG_PAR_VAL. The return code has the type string.

The command is ESCAPE. The syntax is below…

escape( val = text format = format ) …

Rules for Markup Languages

The following table shows the replacement rules for markup languages. The first column contains the names of the constants from the class CL_ABAP_FORMAT. The other columns show the escape characters that replace the special characters in the first row. None of the other characters are affected. TAB, LF, CR, BS, and FF are the control characters for tabulator, Line Feed, Carriage Return, Backspace, and Form Feed, to which the codes x09, x0A, x0D, x08, and x0C are assigned in 7-Bit ASCII. ctrl-char stands for all control characters with codes less than x20 that are not covered by those characters listed explicitly. These can be converted to xhh, where “hh” is the hexadecimal value of the code. If there is no value in a field (-), the special character is not affected.

I have created a sample program in DV1 called ZTONY_DEMO_XML so you can see it working. The code looks like this…

REPORT ztony_demo_xml.

DATA: xml_string TYPE string,

xml_result TYPE string.

xml_string = ‘This is a test of this & that’.

CLEAR xml_result.


xml_result = escape( val = xml_string format =
cl_abap_format=>e_xml_text ).


Hope this helps!

Pin It on Pinterest

Share This

If you enjoyed this post, why not share it with your friends!