2012 Jun 19 10:49 AM
Hello,
I am new to ABAP, I am used to program in VB. Is it possible to create an inline function ourself just like Lines( ) or Condense( ).
For instance IsSalesOrder( vbak-vbeln ) or IsProtocol( vbak-vbeln ) ? It does read easier then refering to fieldnames which makes no sense of understanding lol. I know I can create a class with a method which I can call without creating an object like EF=>IsSalesOrder( vbak-vbeln ) but I want to get rid of the EF=> part, I want to expand the group of inline functions in ABAP.
hmm. But where is the code located for the other inline functions like Lines( ), Condense( ), ToUpper( ), ToLower( ), BoolC( ) , ...
When I debug it doesnt show me the code behind these function.
I think if I include my own inline function in there it will be ok, no?
2012 Jun 19 11:08 AM
What about routines ?
Perform isSalesOrder using vbak-vbeln
changing success.
Or definitions.
define is_order.
select ... where field = &1
if ...
&2 = 'X'.
endif.
end-of-definition.
is order vbak-vbeln success.
Do this cover your requirement ?
2012 Jun 19 12:03 PM
But I want to use it in every program not only in current program. Creating a form needs a return variable and writing a lot more code. I mean reading somthing like this:
If IsSalesOrder( vbak-vbeln) Or IsProtocol( vbak-vbeln)
'Execute some code
Endif
Reads a lot easier
2012 Jun 19 12:24 PM
I understand your needs but I don't have any other thing in mind to propose.
You can create a common program with the required definitions and include it in any new program that you create. But this is a bit risky since if something happens to the include by mistake, all related programs will produce a dump.
Kind regards.
2012 Jun 19 12:32 PM
hmm. But where is the code located for the other inline functions like Lines( ), Condense( ), ToUpper( ), ToLower( ), BoolC( ) , ...
When I debug it doesnt show me the code behind these function.
I think if I include my own inline function in there it will be ok, no?
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |