lunes, 22 de junio de 2015

My return random.randint(0, 1)

Hi everybody, i didn't posted like before days.
But the summer arrive and i will try posts new content. Now a days i publised a lot of commits and PR's (pull request) in my github account (https://github.com/Endika) i will try posted all interesting things in my blog.

This is only a notify posts but the next posts i promise i published interesting things.

Thanks for followme @endika_iglesias

domingo, 1 de febrero de 2015

How to check if my website this ON?

With Selenium language, is very easy. Only need installed selenium python library.
Simple example using Selenium library
browser = webdriver.Firefox()
browser.get('http://google.es')
assert 'Google' in browser.title
In this example only checked if google.es has the "Google" title.

Now, if don't has the correct title the webs site, takes a screenshot.
browser = webdriver.Firefox()
browser.get('http://google.es')
if 'Google' not in browser.title:
    base64 = browser.get_screenshot_as_base64()
Finally, you can program tasks to check your websites and send email on error. If you want see the full example code go to this url Github/Endika/test_script/checkWebsite.py

miércoles, 21 de mayo de 2014

[SOLVED] Servers Digital Ocean with timezone problems

use this command
cp /usr/share/zoneinfo/Europe/Madrid /etc/localtime 

lunes, 19 de mayo de 2014

How to create certificates in a single line

complete as follows
/C= Country Name (2 letter code)
/ST= State or Province Name (full name)
/L= Locality Name
/O= Organization Name
/OU= Organizational Unit Name
/CN=website.com
openssl req -new -newkey rsa:4096 -days 2 -nodes -x509 -subj "/C=SP/ST=Madrid/L=Madrid/O=Empresa/OU=Internet Services/CN=website.com" -keyout server.key  -out server.cert
view example in github

lunes, 17 de febrero de 2014

Solution jQueryMobile viewport tag

If we use the jQueryMobile library, it may not work the viewport tag
Si usamos la librería jQueryMobile es muy posible que tengamos problemas para que nos funcione la etiqueta viewport
<html>
<head>
...
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
...
</head>
<body>
...
</body>
It has very easy solution. First step to remove the label.
Bueno por suerte tiene muy fácil solución. Primer paso eliminar la etiqueta.
Second step, add an instruction using javascript with jquery.
Segundo paso, añadimos mediante una instrucción javascript con jquery.
jQuery(document).bind('mobileinit', function(){
        jQuery.mobile.metaViewportContent = 'width=device-width, minimum-scale=1, maximum-scale=2';
});
With this statement, we can zoom in on our mobile device.
Con esta instrucción, podremos hacer zoom en nuestro dispositivo movil.

jueves, 6 de febrero de 2014

Translate the organization number of internal number of SAP


    CALL METHOD cl_crm_org_management=>get_instance
      IMPORTING
        ev_instance = lv_orgman.

    CALL METHOD lv_orgman->get_sales_org_of_vkorg
      EXPORTING
        iv_vkorg            = lv_s_vkorg
      IMPORTING
        ev_sales_org        = lv_sales_org
      EXCEPTIONS
        crm_key_not_defined = 1.

How to delete the zeros of a variable?

Use this function, and convert 00001 to 1.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
      input  = lv_partner
    IMPORTING
      output = lv_partner.

lunes, 3 de febrero de 2014

SAP Cheat Cube CRM version


Copying the idea of Cube Cheat. I have prepared one. You may download the image and print it for your personal use.

Copiando la idea de los Cheat Cube. He preparado uno. Podéis descargar la imagen sin problema he imprimirla para vuestro uso personal.

Here is a preview of the final result.

Aquí una preview del resultado final.

sábado, 18 de enero de 2014

Get BP number with customer user (Obtén el numero de BP con el usuario del cliente)

Only use one function. It's very simple.

      CALL FUNCTION 'YCRM_CC_FUNC_GET_FRONT_OFFICE'
        EXPORTING
          user       = sy-uname 
        IMPORTING
          og_partner = lv_bp.

sy-uname is the global variable in ABAP contains the current user.
lv_bp is the local variable containing BP code.

Read structures and get the sales manager (leer la estructura y obtener el jefe de ventas)

For example, i need to get my sales manager of the organizational structure. The function is this
  CALL FUNCTION 'RH_STRUC_GET'
    EXPORTING
      act_otype      = 'BP'
      act_objid      = partner_no #enter de Partner number
      act_wegid      = 'BP-CP-O'  #we indicate that we want to get
      act_tdepth     = 0
    TABLES
      result_tab     = lt_result #here the result
    EXCEPTIONS
      no_plvar_found = 1
      no_entry_found = 2
      OTHERS         = 3.