test

method WDDOMODIFYVIEW .
data : lr_textview type ref to cl_wd_text_view.
Data: lr_uicontainer type ref to cl_wd_uielement_container,
lr_rowhead type ref to cl_wd_row_head_data,
lr_button type ref to cl_wd_button,
lr_inputfield type ref to cl_wd_input_field,
lr_flowdata type ref to cl_wd_flow_data,
ld_childid type string.
*if first_time = 'X'. "Uncomment when parameter created in method
lr_button = cl_wd_button=>new_button( view = view
text = 'My Button'
on_action = 'PRESSBUTTON' ).
lr_rowhead = cl_wd_row_head_data=>new_row_head_data( element = lr_button ).
lr_button->set_layout_data( lr_rowhead ).
lr_button->set_tooltip( value = 'Tooltip' ).
lr_flowdata = cl_wd_flow_data=>new_flow_data( element = lr_button ).
lr_uicontainer ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_uicontainer->add_child( lr_button ).
lr_textview = cl_wd_text_view=>new_text_view( view = view
text = 'Create Dynamic UI Elements' ).
lr_rowhead = cl_wd_row_head_data=>new_row_head_data( element = lr_textview ).
lr_textview->set_layout_data( lr_rowhead ).
lr_flowdata = cl_wd_flow_data=>new_flow_data( element = lr_textview ).
lr_uicontainer ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_uicontainer->add_child( lr_textview ).
*endif.
endmethod.
  • check
    List Element
  • check
    List Element
  • check
    List Element

html image url contains http://1.1.1.3/bmi/ or something with bmi

I noticed the other week that some of the image SRC links within my website HTML code was being transformed. Basically a spurious http://1.1.1.2/bmi/ (or a version of this such as 1.1.1.2/bmi/, 1.1.1.4/bmi/ etc) was being injected into my HTML code when my website was being viewed. At first I thought it was my web host implementing some kind of image caching so i ignored it for a while. I then started notice that the images were not always been displayed so I contact them to discus the issue and to find out what was going on.

To cut a long story short it turned out to be my internet service provider(ISP) Three.co.uk. Because it is a 4G mobile based provider they and most of the others seem to use a service call ByteMobile, which tries to reduce the amount of data being transferred. I’m not sure they use this all the time but just in busy areas or at peak times.

The Fix

After a bit of trial an error the final solution was quite a simple one, just enter the following code into your .htaccess file.


Header set Cache-Control “no-transform”

this then tells the service provider that pages from this website should not be transformed and to display them as they are.

 

The fix with HTTPS

I believe an alternate fix would be to implement HTTPS on your web site, this way your code is secure and the service provided is unable view or transform it even if they wanted too

Thrive architect hangs when editing page new or old – first look

So I just updated to thrive architect from thrive content builder but unfortunately whenever I created a new page or edited an existing one the thrive architect hangs...the page remains greyed out with the 4 or 5 dots/drops constantly animating. Turns out the solution was a very simple one, I simply needed to also update the Thrive theme i was using. Now all is well and i am able to publish this post...obviously my first using the new thrive architect editor.       

Installing Thrive Architect

I had actually been putting this off for a few days, as i assumed I would need to find out / remember my thrive login details then download the plugin.

...then remove the old content builder plugin and install the new Architect plugin...I'll be honest I also thought there might be a trip to my hosting backup functionally to restore a previous version, due to something going wrong.

....well how wrong i could be, I logged into my WordPress account, hit update on the content builder plugin and hey presto it was updated to thrive architect. As discussed above the only issue I had was forgetting to also update the squared theme. But once that was done all was good.      

Thrive architect first impressions 

My first impressions are that this is amazing, I liked the previous version but there was a few things that made it a pain to use. It was much better than the basic wp editor but still caused me some issues that forced you to do things in a specific way. For example pressing enter key within a paragraph/text element used to create a whole new text element. This meant if you wanted your text all in the same element you had to remember to hold down the shift key. I can happily report Thrive Architect does not do this, pressing enter creates a new paragraph but within the same element and using the shift key moves only the next line i.e.
...with shift key pressed

...just pressing enter without the shift key pressed.

This might seem like a small thing but it used to cause me all sorts of issues especially when pasting text into the editor.

Displaying coding blocks

I also used to have issues trying to display code samples with the correct indentation.  Even when using custom html code and the <pre> tag it would still not work and would strip out the indentation. So let's see if Thrive architect is any better, here is some simple ABAP code...let's see what it looks like after is save and publish   

LOOP at itab where condition 1 or condition 2.
EXIT.
ENDLOOP.
If sy-subrc eq 0.
"Data found
endif.

oh well seems not, still removes the indentation...also when using <pre> every time you edit and save, it actually adds another line of numbers so probably best to avoid the <pre> tag  

Setup page events 

This is not a full thrive architect review but my first impressions are that this is actually beautifully done, and apart from the custom code issue everything seems to work as you would expect it to. You create a paragraph and enter your text as you would expect, and no random elements are created. The menu on the left is also so much cleaner. I have just found what looks like a very useful feature without even trying, with the previous version i'll hold my hands up and admit I didn't really know what most of the options did and kept forgetting how to access features I had previously used.

Within thrive architect I have just clicked the  back arrow to return to thrive architect menu page        

...followed by the setting type cog 

...and found a section that allows you to add page events i.e. when the user wants to leave the page or after a certain amount of time perform a certain event . I'm sure this existed before but I never found it. To be honest I never looked but I have only been using this for 20 minutes and have found so much more...Maybe as I use it more I will find things missing but so far the ease of use is so good that I could handle a few things missing. 

If anyone is reading this I have Grammarly installed on my chrome browser and if there was a way to allow that to access the text within these input sections that would be awesome.  

See what your page looks like on different browsers

The last thing I will point out is that thrive architect allows you to see what your page looks like on different devices i.e. desktop, tablet or mobile. Simply click the Responsive view icon in the bottom left hand corner and change the device. 

thrive architect responsive view

thrive architect responsive view

Note you can change the size of the text within each of these views and it will only be effective for that device screen size or smaller.

  • Changes on desktop effect all, unless changed for smaller device already 
  • Changes on tablet only effect tablet and mobile
  • Changes on mobile only effect mobile 

ABAP read table with OR condition in SAP

So is it possible to add an OR condition to the key values of the read statement? The simple answer is no, but you can replicate this functionality using one of two methods.

Method 1 - Using multiple ABAP READ statements within nested IF statements

The first method would be to use multiple READ statements to check each condition but nest these within IF statements.

i.e. Read condition 1
if no entry found read condition 2
if no entry found read condition 3 etc etc

Method 2 - Using an ABAP LOOP statement

The second method would be to use a LOOP statement with all the options within the where clause and simply EXIT on the first loop pass.

i.e.LOOP at itab where condition 1 or condition 2.
EXIT.
ENDLOOP.
If sy-subrc eq 0.
"Data found
endif.

data: IT_COMPONENT type standard table of SEOCOMPO,
WA_COMPONENT like line of IT_COMPONENT.
select *
from SEOCOMPO as A inner join SEOCOMPOTX as B
on B~CLSNAME = A~CLSNAME
and B~CMPNAME = A~CMPNAME
inner join SEOCOMPODF as C
on C~CLSNAME = A~CLSNAME
and C~CMPNAME = A~CMPNAME
into corresponding fields of table IT_COMPONENT
where A~CMPTYPE in (0,1,2)
and B~LANGU eq SY-LANGU.
sort IT_COMPONENT by clsname cmptype.
"READ solution
read table IT_COMPONENT transporting no fields
with key CLSNAME = WA_CLASS-CLSNAME
CMPTYPE = 0 binary search.
if SY-SUBRC eq 0.
"perform entry_found.
else.
read table IT_COMPONENT transporting no fields
with key CLSNAME = WA_CLASS-CLSNAME
CMPTYPE = 1 binary search.
if SY-SUBRC eq 0.
"perform entry_found.
else.
EXIT.
endif.
endif.
"loop solution
LOOP at IT_COMPONENT into WA_COMPONENT where  CLSNAME = WA_CLASS-CLSNAME
AND ( CMPTYPE = 0 or CMPTYPE = 1 ).
ENDLOOP.
if sy-subrc eq 0.
"at least one entry found
else.
EXIT.
endif.

ABAP Glossary

Each entry in the glossary contains a reference to the application component to which it belongs. You can use this path in the R/3 Library to find further information. For example, for more information about ABAP Dictionary. look under ABAP Workbench (application component BC-DWB)

ABAP Dictionary

ABAP Workbench (BC-DWB)Central and redundancy-free storage facility for all data used in the R/3 System. The ABAP Dictionary describes the logical structure of application development objects and their representation in the structures of the underlying relational database. All runtime environment components such as application programs or the database interface get information about these objects from the ABAP Dictionary. The ABAP Dictionary is an active data dictionary and is fully integrated into the ABAP Workbench.

ABAP Native SQL

ABAP Workbench (BC-DWB)

ABAP Native SQL allows you to include database-specific SQL statements in an ABAP program. Most ABAP programs containing database-specific SQL statements do not run with different databases. If different databases are involved, use Open SQL. To execute ABAP Native SQL in an ABAP program, use the statement EXEC.

ABAP Open SQL

ABAP Workbench (BC-DWB)
Subset of standard SQL statements. To avoid conflicts between database tables and to keep ABAP programs independent from the database system used, SAP has generated its own set of SQL statements known as Open SQL. Using Open SQL allows you to access all database tables available in the R/3 System, regardless of the manufacturer.

ABAP Program

ABAP Workbench (BC-DWB)
Programs written in the ABAP programming language. n ABAP program consists of a collection of processing locks, which are processed sequentially as soon as they are called by the runtime system. There are two main kinds of ABAP program: Report programs (ABAP reports) Dialog programs

ABAP Query

Basis Services/Communication Interfaces (BC-SRV)ABAP Workbench tool that allows users without knowledge of the ABAP programming language, or table or field names, to define and execute their own reports To determine the structure of reports in ABAP Query, users only have to enter texts, and select fields and options. Fields are selected from functional areas and can be assigned a sequence by numbering There are three types of report available

Create dynamic SAP Web dynpro screen

Simply create a new Web dynpo application and add this code to the WDDOMODIFYVIEW method of your main view.

method WDDOMODIFYVIEW .
  data : lr_textview type ref to cl_wd_text_view.
  Data: lr_uicontainer type ref to cl_wd_uielement_container,
        lr_rowhead type ref to cl_wd_row_head_data,
        lr_button type ref to cl_wd_button,
        lr_inputfield type ref to cl_wd_input_field,
        lr_flowdata type ref to cl_wd_flow_data,
        ld_childid type string.

*if first_time = 'X'. "Uncomment when parameter created in method
  lr_button = cl_wd_button=&gt;new_button( view = view
  text = 'My Button'
  on_action = 'PRESSBUTTON' ).

  lr_rowhead = cl_wd_row_head_data=&gt;new_row_head_data( element = lr_button ).
  lr_button-&gt;set_layout_data( lr_rowhead ).
  lr_button-&gt;set_tooltip( value = 'Tooltip' ).
  lr_flowdata = cl_wd_flow_data=&gt;new_flow_data( element = lr_button ).
  lr_uicontainer ?= view-&gt;get_element( 'ROOTUIELEMENTCONTAINER' ).
  lr_uicontainer-&gt;add_child( lr_button ).
  lr_textview = cl_wd_text_view=&gt;new_text_view( view = view
  text = 'Create Dynamic UI Elements' ).
  lr_rowhead = cl_wd_row_head_data=&gt;new_row_head_data( element = lr_textview ). 
  lr_textview-&gt;set_layout_data( lr_rowhead ).
  lr_flowdata = cl_wd_flow_data=&gt;new_flow_data( element = lr_textview ).
  lr_uicontainer ?= view-&gt;get_element( 'ROOTUIELEMENTCONTAINER' ).
  lr_uicontainer-&gt;add_child( lr_textview ).
*endif.
endmethod.

Cookiechoices cookie only set for specific page not whole website

When I first downloaded the cookiechoices.js file from the link suggested by Google and then installed it onto my site it didn’t really work correctly. It would display the message but when the user clicked on the ok button the Cookiechoices cookie only seemed to be getting set for that specific page, so when a second page was visited the cookie message would be displayed a second time. 

Cause of the Error

The reason for this was that the cookiechoices code was not setting the path correctly. You can see the Path that the cookie sets by going to “More tools->Developer tools” within Chrome and then selecting the Application tab and expanding Cookies within the Storage tree structure. As you can see in this example the path /abap has been included as part of the cookie properties. This is not what you want, it should just be a ‘/’ like all the others. In this case the cookie will only be set for all pages within the /abap directory rather than the whole website.

CookieChoices Path Error

CookieChoices Path Error

Solution

The solution is actually quite simple but took me a lot of messing around to find. You basically just need to hard code the path property to be the route  of your website. To do that within the cookie choices code recommended by google simply find the following section of code document.cookie = cookieName + ‘=y; expires=’ + expiryDate.toGMTString(); Now simply add “path=/” after =y; i.e.  Resultant JavaScript code will now look like this: document.cookie = cookieName + ‘=y; path=/; expires=’ + expiryDate.toGMTString();  

Test

Once you have implemented the above fix and uploaded the new file to you website try a page where the cookie choices message is displayed  and click the OK button again. The result should be that the cookie is set for the route of the website.

cookiechoices fix

cookiechoices fix

Unix commends via putty

Create directory 

mkdir page-backup

create directory called page-backup

 

Copy all files and sub-directories from one directory to another

cp -r page/* page-backup

copies all files from page into page-backup

 

Surprising Insights from Behavioral Economics That Can Help You Win Over Your Customers

Changing Customer Behavior

Acumen Presents: Dan Ariely on Changing Customer Behavior

You’ve probably heard of Dan either through his NY Times bestseller, Predictably Irrational, or through one of his many Ted Talks on behavioral economics. He’s an expert on what motivates behavior, and the psychology behind motivation and decision.

And now he wants you to use his knowledge to help your business succeed in his new course on Udemy!

As an entrepreneur, studying and understanding the behavior of your customers is incredibly valuable – don’t just assume you know what they’re thinking. As Dan will tell you in his course, we’re very often wrong about what we think will motivate people.

Here are just 3 of his astonishing tips from understanding people that you can apply to your business:

 

Information Is Not The Answer

Sounds kind of weird, right? As Dan explains, it’s a common misconception, and smoking is the best example of this.

As soon as the information came out about cigarettes being bad for us (like, literally giving us cancer and killing us), a huge public information campaign started to try and get people to quit: commercials, PSAs, even the Surgeon’s General Warning on the pack of cigarettes saying how bad they are.

As you might have guessed, it didn’t convince anyone.

Giving customer’s information doesn’t actually have that much of an effect on their behavior. They might listen to you, they might remember it, and they might even think of you while they do what you told them not to do. But they are very unlikely to change just because you told them a better way of doing things.

There are other things you need to do besides just tell them why your idea will help them – it’s not enough to make them change.

 

Even If It’s Really Easy, They Still Won’t Do It

Entrepreneurs have an amazing idea, and they think: “all the customer needs to do is fill out this extra form/mail back this letter/shop here instead – that’s easy!”

That’s wrong.

Well, it may be true, but that is not how your customer thinks. People don’t like bumps, they don’t like extra work (even a little bit!), and they don’t like change.

Take Dan’s example:

People had a current prescription for a brand-name medication. They were mailed a form and told that all they had to do was return it with a confirmation that they would like to switch to the generic prescription, and save money in the process. What do you think happened?

Well, of course you know where this is going. It converted exactly no one.

They even went a step further and offered to pay for their medications for a period of time, if they would just switch to the generic brand! Even then, almost no one switched.

What got them to switch?

Forcing the issue. They had to take away the customer’s choice of doing nothing – the customer had to mail back the letter saying they wanted to continue with the brand-name medication, or mail it back saying they would switch to generic – but they didn’t have an option to not mail it back. Lo and behold, almost 90% of customers switched to the generic brand.

 

We Still Care A Lot About Fitting In

It sounds like high school stuff that we should have outgrown by now, but believe it or not, the belief that we’re doing what everyone else is doing – social proof – is one of the most powerful motivators for behavior change.

Dan explains this with an experiment done on how to convince people to use less energy, and attempting to convince them with one of three arguments: it helps the environment, it saves them money, or everyone else is doing it.

The most interesting thing about this is that people don’t think it works. When polled on which technique they thought would be most effective, people said that they personally would be affected by it saving the environment, but other people would be influenced by the money-saving aspect of it. No one thought that telling people everyone else was doing it would work.

Of course, it did. In fact, it was the only thing that worked.

 

Tell Me More!

Of course, there’s so much more that you can apply from psychology and behavioral economics to your business. Dan wants to help you hack your customers’ behaviors to make your methods more successful and your business more impactful – or as he would say, everyone else is taking it, don’t you want to join?

You’ll learn how to influence your customers’ behavior, how to get them to want to use your product, how to design a valuable and desirable product in the first place, and even how to run experiments to see how effective your behavior-change methods are.

So what are you waiting for? ENROLL NOW!

 

html image url contains http://1.1.1.3/bmi/ or something with bmi

I noticed the other week that some of the image SRC links within my website HTML code was being transformed. Basically a spurious http://1.1.1.2/bmi/ (or a version of this such as 1.1.1.2/bmi/, 1.1.1.4/bmi/ etc) was being injected into my HTML code when my website was being viewed. At first I thought it was my web host implementing some kind of image caching so i ignored it for a while. I then started notice that the images were not always been displayed so I contact them to discus the issue and to find out what was going on.

To cut a long story short it turned out to be my internet service provider(ISP) Three.co.uk. Because it is a 4G mobile based provider they and most of the others seem to use a service call ByteMobile, which tries to reduce the amount of data being transferred. I’m not sure they use this all the time but just in busy areas or at peak times.

 

The fix

After a bit of trial an error the final solution was quite a simple one, just enter the following code into your .htaccess file.

<IfModule mod_headers.c>
Header set Cache-Control “no-transform”
</IfModule>

this then tells the service provider that pages from this website should not be transformed and to display them as they are.

 

Fix with HTTPS
I believe an alternate fix would be to implement HTTPS on your web site, this way your code is secure and the service provided is unable view or transform it even if they wanted too

1 2 3 7