Monday, September 3, 2007

Conversion routine

Write this simple code.


REPORT ZFIELDCONV.
data: d_auart LIKE vbak-auart.
d_auart = 'TA'.
WRITE d_auart.

What the result output on screen do you expect, "TA"? No, the result will be "OR".

The result comes from conversion routine of its domain. In SE11 open table VBAK, find field AUART, double click to go to data element AUART, then double click to open domain AUART. You will see its conversion routine, named AUART. Double click the conversion routine, you got at least two conversion routine conversion routine input & output. They are function module, you can test them in SE37.
The INPUT routine performs the conversion from display format to internal format. The OUTPUT routine performs the conversion from internal format to display format. Take attention when we hard code value as a condition value in "WHERE condition", you must convert its value into internal format.

Other commonly used conversion routine is ALPHA. It is conversion used to insert leading zero for document number. For example, in sales order (VBAK-VBELN length 10), when we key in order no, for example we key in '4302', conversion routine input will automatically add leading zero, so it will become '0000004302', this is real value stored in table VBAK. On conversion routine output, it will delete leading zero.

In SE16, we can view the data wheather in internal format or display format, to toggle format, in display list, go to Setting->User Parameter, in tab strip "Data browser" choose "format, field conversion exit".

5 komentar:

Kevin said...

Hi Alionzo,

I'm a new abaper from Houston, I found your blog very good source for the newbies like me. I may have some questions about Abap, if you can please send me email at kevinabap@yahoo.com

Thanks

arm said...

this info are very useful... thanks... pleeese.. feel free to visit my blog also... i put free movies download and software application for free..

sai krishna said...

excellent blog submit all your posts at www.indiantags.com we are social bookmarking site just like digg we share adsense revenue with our users who submit their stories who keep posting

David said...

Hi Maas Alionzo,
How are you? How is Jakartha???

I am David from Chennai. Here i am with a small problem.

In se78 i imported few images and i named them. and also i created few screens in se51. even i allocated each image for each screen.
But the problem is, when i tried to call them from se38, the images are not properly applied to the screens. the first image which i allocated for the first screen is automatically apllied on all the screens.

Why it is happening. How can i solve this problen. i want each image for each scree evenly. what should i do? what would be the problem?
Please advice me regarding this problem.

Also send me your advise to davidjagan@mytechus.com.

Thank you bro.

alionzo said...

Hi David..
I'm fine, thanks..Thanks for visiting my blog..

Here is sample code about display image in abap:
http://www.saptechnical.com/Tutorials/ABAP/image/screen.htm
You can start by testing this sample progam.

Hope it help.