10-23-2005 7:26 AM
HI,
CAN ANY ONE TELL ME WHAT IS DIFFERENCT BETWEEN FUNCTION MODULE AND
PREDEFINE FUNCITON IN ABAP.
IN ORDER TO EXPLAIN U MY QUESTION I WILL GIVE U AN EXAMPLE OF COUNTING
THE NUMBER OF CHARACTERS IN A STRING
THE FUNCITON MODULE FOR THIS OPERATION IS
CALL FUNCTION 'STRING_LENGTH'
EXPORTING
STRING =
IMPORTING
LENGTH =
AND THE PREDEFINE FUNCTION FOR THIS OPERATON IS
STR_LEN = STRLEN( STRING ).
I WANT TO KNOW WHAT IS DIFFERNECE BETWEEN ABOUT TWO FUNCTIONS
note: the fm itself is using that predefine function and it is allowing us to use the predefine funtion also.
regards,
MAQSOOD
10-23-2005 7:43 AM
Function Modules mostly will have upward capability . So suppose the syntax of STRLEN changes , the function module 'STRING_LENGTH' will have the updated version .
On WAS 620 the FM STRING_LENGTH conatins code -
<b>class cl_abap_list_utilities definition load.
length = cl_abap_list_utilities=>dynamic_output_length( string ).</b>
May be you are on a lower release ( 46B / 46C ) so you still see STRLEN in the Function module .
So STRLEN is a key word of ABAP whose syntax may change with upgrade . But the FM STRING_LENGTH would keep the functionality even on upgrades . So its better to use standard FMs if available for any functinality.
Cheers.
10-23-2005 9:46 AM
Hi,
I think different than Sanjay. I consider that it's safer to use one of ABAP standard syntax command than one of SAP function module. Syntax command can be in future marked as obsolete but should work also in future releases.
There is no such warranty for SAP FM. Unless it's BAPI.
Krzys
10-23-2005 10:00 AM
I suggest use ABAP command, which is a part of ABAP Language. For Function Modules, you need check if it released, In many cases, they are not leased, which means it is not available for customer use.