Skip to content

Gain it!

Hey, just look around and see what can u gain through this small hut. :)

How to select text on website that being blocked?

September 17, 2014

Huh!…It is pretty annoying when you need to select particular text on a website but you unable to do so, don’t you?

I do not know how many times I encountered such issue which leaded me to open source code of that web page that manual to copy it. Yeah… it was such pain…

Luckily this morning I tried to Google and found something interesting.

Yes! there is an chrome plug in which will allow you to do that!ūüėČ That plugin called Selectable. If you unable to reach it, here is the link,¬†https://chrome.google.com/webstore/detail/selectable-for-fanfiction/jcidlhgdoojamkbpmhbpgldmajnobefd/related. Just add it to you chrome and the refresh that page which is block you to select text and see what happen!ūüôā

Again…it saved my dayūüėČ

September, 17 2014,

doya.

How to read data cluster from SAP transparent table

January 24, 2013

Last few week I was thrilled to create a tool dedicated for ABAP workbench development. However, during investigation I was facing that the source I need to read is stored in byte (Endian). In this case, when I retrieve data from database table, content will not readable (as character) since it’s converted to the byte sequence.

Let’s take an example, I will come with¬†STXFCONTR table as an object testing. This table contains runtime object of Smartforms. Structure of this table is shown as below,

STXFCONTR structure

Before I go to view the specific content of this table, I will create a new Smartforms, called ZDYSMARTFORM.

Smartforms ZDYSMARTFORM

Read more…

How to display ALV Grid full screen in OOP

January 24, 2013
tags: ,

Normally when you want to display ALV Grid output, you will define a custom control in screen. In the program logic you will create an instance that refers to CL_GUI_CUSTOM_CONTAINER. After the container is created, you will create ALV instance of ALV control and attach it to the container, which will something like this:

DATA: go_agflight       TYPE REF TO cl_gui_alv_grid.
DATA: go_ccflight       TYPE REF TO cl_gui_custom_container.

* Create an instance.
   CREATE OBJECT go_ccflight
     EXPORTING
       container_name              = 'CC_FLIGHT' "custom container define in screen painter
     EXCEPTIONS
       cntl_error                  = 1
       cntl_system_error           = 2
       create_error                = 3
       lifetime_error              = 4
       lifetime_dynpro_dynpro_link = 5
       OTHERS                      = 6.

* Create an instance of ALV grid control, attach to custom container.
   CREATE OBJECT go_agflight
     EXPORTING
 *      i_shellstyle      = 0
 *      i_lifetime        =
       i_parent          = go_ccflight
EXCEPTIONS
       error_cntl_create = 1
       error_cntl_init   = 2
       error_cntl_link   = 3
       error_dp_create   = 4
       OTHERS            = 5
       .

Read more…

How to debug smartforms

May 25, 2012

It has been a common question for most ABAPer when they starting to work with smartforms, how to debug it. Definitely, you cannot just put a break-point in program line where you add some logic of code like in SE38.ūüė¶. Yes, sometimes I love to say it’s not ‘really smart’ to you. lol. But overall most of the functionality I have to say, it’s quite smart.ūüėÄ. There are several ways to debug smartforms (based on my knowledge :p), anyone has more idea, please share it, yes! share your knowledge and you won’t lose anything…ūüėČ

  1. The most conventional ways is putting a break-point statement inside your “Program Lines”. But you can’t do when you are in production system (while functional needs you to check particular process). Definitely this is not the best approach.ūüôā
  2. Look for %GLOBAL_INIT subroutine inside your smartforms function module and put break-point inside this sub routine. However, this is global form routine (in case you define it). So, if you don’t have it, probably you should try third approach.ūüôā Read more…

How to display long text from Standard Text for certain lines in smartforms?

May 16, 2012

In most common case when you want to display long text in smartforms which source of text is come from Standard Text, you can easily use ‘Include Text’ ¬†type in Text. Parsing Text Name, Object, ID, and language then smartforms will smartly generate those long text for you.ūüôā

But how if the text has certain rules to be displayed in the form, definitely you can not use this built-in function to achieve your goals.

Let’s say you have document header with textas shown below:

Long text in document header

Long text in document header

Paragraph with prefix ‘**’ will be printed in all type form, acknowledge form, tax, etc. Otherwise paragraph comes with other prefix, filtering should be performed. For example above, paragraph XP and XT will not be printed when I execute delivery note form. In this case, I will only print ‘**’ prefix paragraph andūüėĄ as match its criteria.

The output will be like this:

Output long text in form

Output long text in form

Smartforms will not really smart to do it for you :p

How to achieve this? Read more…

Remove conduit search bar extension from firefox

May 13, 2012

After install a new application called FreeCorder 5, I just realized if my default search engine (G uncle) in firefox was modified!

Although in installation I choose advance setup which prevent this program to modify any of my existing configuration, especially my web browser, damn! I uninstalled this program from ‘Add/Remove Program’ but my firefox search engine result still come up with search.conduit.com/…

Really annoying, shown as screen below.

Annoying conduit

Annoying conduit

 

The best to remove this is go through firefox configuration,

  1. Type about:config in firefox address bar, just click “I’ll be careful, I promise!”

    Click Ok

    Click Ok

  2. Then, type word ‘keyword’ in the search field, you will find preference Name ‘keyword.URL’ value contains ‘conduit…. ‘.
  3. Right click it, and reset.
  4. Close your tab, and try again to search directly from firefox toolbar.
  5. Back to Google!ūüôā

Good luck removing the annoying add-ons.

 

 

Cheers,

doya.

How to check whether a value is a valid date in PHP?

March 6, 2011

Yesterday, I caught a problem on existing PHP project related to date information. While entering date value on his selection screen he asked me whether I did some checking for the dates. He noticed that system still accept invalid date, e.g: 31 February 2011. This is not exist right? Then he inquisitively input the transaction for this date.

Then he told me, transaction was performed without notify any error!, and on transaction screen he got nothing. I supposed, MySQL will truncated this data, so it didn’t get into database. How come?, after I checked into database directly I got the entry with 00-00-0000 value on date field as my colleagues input. I realized, I didn’t put any exception on executing mysql statement.ūüė¶.

Finally, i created a simple function to check, whether a value given is a valid date. I know, there are a lot version code/ solution related to this.ūüôā .

I named isValidDate($in_date)

function isValidDate(){
	$d=date_create(NormalDate($date));
	if($d->format('d-m-Y')<>$date){
		return false;
	}
	else
		return true;
}

Sample output:

Check a valid date

Check a valid date

In PHP (5.2.X), if parameter given is an invalid date, the interpreter will result a different date to entered value.
For code above. If an input given is '31-02-2011', created that will be '03-03-2011', in this case it counts upper from the last date of entered month.

May you will find an useful idea on this post.ūüôā

March, 6 2011,
doya.