Home > ABAP, API > Common ABAP Function Modules – 2

Common ABAP Function Modules – 2

Application Area – BC

Overview

This post lists function modules related to data formatting and conversion.

Function Modules Detail – Data Formatting and Conversion

a) CONVERSION_EXIT_ALPHA_INPUT – ALPHA conversion is used especially with account numbers. During conversion from the external to the internal format, the system checks to see if input in the INPUT field is purely numeric, that is, if this input consists only of numbers, possibly with spaces before and after them. If this is the case, then the number string is inserted right- justified in the display field OUTPUT and all spaces to the left of the value are filled with zeroes (’0′). If the input is not purely numeric, it is inserted in the display field from left to right and all extra spaces are filled with blanks.

Example:

(Input field and output field are both eight characters in length)

1. ’1234 ‘ –> ’00001234′
2. ‘ABCD ‘ –> ‘ABCD ‘
3. ‘ 1234 ‘ –> ’00001234′

b) CONVERSION_EXIT_ALPHA_OUTPUT
- Reversing conversion undertaken by function module CONVERSION_EXIT_ALPHA_INPUT. The contents of the INPUT field are converted to display format and placed in the OUTPUT field.

c) DATE_CONVERT_TO_FACTORYDATE – In the factory calendar, the working days are numbered sequentially fromthe first working day. The working day numbers are called the factory date. This function module calculates the factory date for a calendar date. If the date passed is not a working day, the next or previous working day is calculated.

d) FACTORYDATE_CONVERT_TO_DATE – In the factory calendar the working days are numbered sequentially from the first working day. The numbers of the working days are called factory dates. This function module calculates the date for a factory date.

e) CONVERSION_EXIT_MATN1_INPUT - Convert external material number to internal format.

f) CONVERSION_EXIT_MATN1_OUTPUTConvert internal material number to external format.

g) CONVERT_TO_LOCAL_CURRENCY – Translate foreign currency amount to local currency.

An amount in local currency is calculated from a specified foreign currency amount. For this, you may either specify the translation rate manually (Parameter RATE) or have the system determine it from table TCURR on the basis of the rate type, date and currency key. Because the ratios for the units of the currencies involved in the translation are significant for this translation, table TCURF is always read by the program, and there must be a valid entry there for the data specified.

h) CLOI_PUT_SIGN_IN_FRONT – Put the minus sign to the front.

i) CONVERT_OTF – Convert OTF format to another format.

j) UNIT_CONVERSION_SIMPLE – Measurement unit conversion by table T006, with rounding. This FM converts values from one measurement unit to another and rounds the result to the number of decimal places maintained in the measurement unit table, if necessary. The rounding is up (‘+’), down (‘-’), commercial (‘X’) or no rounding (SPACE), depending on the parameter ROUND_SIGN.

k) SPELL_AMOUNT – This function module converts an amount or number into words.

l) HR_IN_CHG_INR_WRDS – Changes INR (India) amount to words

m) BAPI_CURRENCY_CONV_TO_EXTERNAL – Converts currency amounts from SAP internal data format to the external data format.

n) BAPI_CURRENCY_CONV_TO_INTERNAL – Converts currency amounts from external data format into SAP internal data format.

  1. September 19th, 2010 at 05:31 | #1

    Would like to add my two cents to the discussion.
    ABAP (Advanced Business Application Programming), to me, is much like a COBOL and/or C hybrid. The value versus reference feature reminds me of C. The commands (MOVE, WRITE,…) and PERFORMs remind me of COBOL. ABAP constructs (Loops, subroutines, if/then,…) seem similar to constructs in other languages. The only aspects of the language not communicated in this web site are SAP GUI related features (Like functions defined in the SAP GUI). I felt ABAP GUI features/impacts would be too difficult to accurately explain.
    http://www.learnabapprogramming.com

  2. September 25th, 2010 at 22:57 | #2

    Well…although I agree with most of the above ..each one can have their own opinion..but it definitely makes one think …its good to see people collaborating and sharing their thoughts with others and trying to participate in discussions…we need to encourage this spirit.
    http://www.learnabapprogramming.com

  1. March 15th, 2010 at 01:43 | #1