SAP Function Modules

SWA_EXPR_EVALUATE_TEST SAP Function module







SWA_EXPR_EVALUATE_TEST is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name SWA_EXPR_EVALUATE_TEST into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SWA30
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM SWA_EXPR_EVALUATE_TEST - SWA EXPR EVALUATE TEST





CALL FUNCTION 'SWA_EXPR_EVALUATE_TEST' "
* EXPORTING
*   expression_string = SPACE   " string
*   expression = SPACE          " swaexpdef-expr  Expression in binding of SAP Business Workflow
*   loopindex = 0               " swcont-tab_index  Loop index to table element of container
*   inttype_of_constant =       " dfies-inttype  Internal data type of a constant expression
*   intleng_of_constant =       " dfies-leng    Internal length of a constant expression
*   refstruct_of_expression =   " dfies-tabname
*   do_not_free_bor_objects = SPACE  " xfeld
  IMPORTING
    ref_to_value =              " data
    value_string =              " string
    value =                     "               Value of expression
    value_converted =           "               Value of expression (formatted for output, left-aligned)
    elemtype =                  " swcont-type   Internal data type of expression value
    elemlength =                "               Length of expression value
    elemdecimals =              " dfies-decimals  Number of Decimal Places
    expression_is_objectreference =   "         Expression is an object reference
    objecttype =                " swotobjid-objtype  Object type of object reference
    objectkey =                 " swotobjid-objkey  Type-specific key of object reference
    expression_is_table =       "               Indicator: Expression is multiline
    expressionelement_is_nil =   "              Element expression refers to is NIL
    expression_is_initial =     "               Expression value is initial
    worst_messagetype =         " swaexerror-msgty  Most serious message type (A->E->W->I)
    errorcount =                " swaexpedit-errorcount  Error count
  TABLES
    cont =                      " swcont        Container Instance
*   exerror =                   " swaexerror    Messages
*   value_tab =                 "
*   value_tab_converted =       "
*   elem_refstruct_nametab =    " swarefnmtb
    .  "  SWA_EXPR_EVALUATE_TEST

ABAP code example for Function Module SWA_EXPR_EVALUATE_TEST





The ABAP code below is a full code listing to execute function module SWA_EXPR_EVALUATE_TEST including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_ref_to_value  TYPE DATA ,
ld_value_string  TYPE STRING ,
ld_value  TYPE STRING ,
ld_value_converted  TYPE STRING ,
ld_elemtype  TYPE SWCONT-TYPE ,
ld_elemlength  TYPE STRING ,
ld_elemdecimals  TYPE DFIES-DECIMALS ,
ld_expression_is_objectreference  TYPE STRING ,
ld_objecttype  TYPE SWOTOBJID-OBJTYPE ,
ld_objectkey  TYPE SWOTOBJID-OBJKEY ,
ld_expression_is_table  TYPE STRING ,
ld_expressionelement_is_nil  TYPE STRING ,
ld_expression_is_initial  TYPE STRING ,
ld_worst_messagetype  TYPE SWAEXERROR-MSGTY ,
ld_errorcount  TYPE SWAEXPEDIT-ERRORCOUNT ,
it_cont  TYPE STANDARD TABLE OF SWCONT,"TABLES PARAM
wa_cont  LIKE LINE OF it_cont ,
it_exerror  TYPE STANDARD TABLE OF SWAEXERROR,"TABLES PARAM
wa_exerror  LIKE LINE OF it_exerror ,
it_value_tab  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_value_tab  LIKE LINE OF it_value_tab ,
it_value_tab_converted  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_value_tab_converted  LIKE LINE OF it_value_tab_converted ,
it_elem_refstruct_nametab  TYPE STANDARD TABLE OF SWAREFNMTB,"TABLES PARAM
wa_elem_refstruct_nametab  LIKE LINE OF it_elem_refstruct_nametab .

DATA(ld_expression_string) = 'Check type of data required'.

DATA(ld_expression) = some text here

DATA(ld_loopindex) = Check type of data required

DATA(ld_inttype_of_constant) = some text here

DATA(ld_intleng_of_constant) = Check type of data required

DATA(ld_refstruct_of_expression) = some text here
DATA(ld_do_not_free_bor_objects) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_cont to it_cont.

"populate fields of struture and append to itab
append wa_exerror to it_exerror.

"populate fields of struture and append to itab
append wa_value_tab to it_value_tab.

"populate fields of struture and append to itab
append wa_value_tab_converted to it_value_tab_converted.

"populate fields of struture and append to itab
append wa_elem_refstruct_nametab to it_elem_refstruct_nametab. . CALL FUNCTION 'SWA_EXPR_EVALUATE_TEST' * EXPORTING * expression_string = ld_expression_string * expression = ld_expression * loopindex = ld_loopindex * inttype_of_constant = ld_inttype_of_constant * intleng_of_constant = ld_intleng_of_constant * refstruct_of_expression = ld_refstruct_of_expression * do_not_free_bor_objects = ld_do_not_free_bor_objects IMPORTING ref_to_value = ld_ref_to_value value_string = ld_value_string value = ld_value value_converted = ld_value_converted elemtype = ld_elemtype elemlength = ld_elemlength elemdecimals = ld_elemdecimals expression_is_objectreference = ld_expression_is_objectreference objecttype = ld_objecttype objectkey = ld_objectkey expression_is_table = ld_expression_is_table expressionelement_is_nil = ld_expressionelement_is_nil expression_is_initial = ld_expression_is_initial worst_messagetype = ld_worst_messagetype errorcount = ld_errorcount TABLES cont = it_cont * exerror = it_exerror * value_tab = it_value_tab * value_tab_converted = it_value_tab_converted * elem_refstruct_nametab = it_elem_refstruct_nametab . " SWA_EXPR_EVALUATE_TEST
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_ref_to_value  TYPE DATA ,
it_cont  TYPE STANDARD TABLE OF SWCONT ,
wa_cont  LIKE LINE OF it_cont,
ld_expression_string  TYPE STRING ,
ld_expression  TYPE SWAEXPDEF-EXPR ,
it_exerror  TYPE STANDARD TABLE OF SWAEXERROR ,
wa_exerror  LIKE LINE OF it_exerror,
ld_value_string  TYPE STRING ,
it_value_tab  TYPE STANDARD TABLE OF STRING ,
wa_value_tab  LIKE LINE OF it_value_tab,
ld_value  TYPE STRING ,
ld_loopindex  TYPE SWCONT-TAB_INDEX ,
it_value_tab_converted  TYPE STANDARD TABLE OF STRING ,
wa_value_tab_converted  LIKE LINE OF it_value_tab_converted,
ld_value_converted  TYPE STRING ,
ld_inttype_of_constant  TYPE DFIES-INTTYPE ,
ld_elemtype  TYPE SWCONT-TYPE ,
it_elem_refstruct_nametab  TYPE STANDARD TABLE OF SWAREFNMTB ,
wa_elem_refstruct_nametab  LIKE LINE OF it_elem_refstruct_nametab,
ld_intleng_of_constant  TYPE DFIES-LENG ,
ld_elemlength  TYPE STRING ,
ld_refstruct_of_expression  TYPE DFIES-TABNAME ,
ld_elemdecimals  TYPE DFIES-DECIMALS ,
ld_do_not_free_bor_objects  TYPE XFELD ,
ld_expression_is_objectreference  TYPE STRING ,
ld_objecttype  TYPE SWOTOBJID-OBJTYPE ,
ld_objectkey  TYPE SWOTOBJID-OBJKEY ,
ld_expression_is_table  TYPE STRING ,
ld_expressionelement_is_nil  TYPE STRING ,
ld_expression_is_initial  TYPE STRING ,
ld_worst_messagetype  TYPE SWAEXERROR-MSGTY ,
ld_errorcount  TYPE SWAEXPEDIT-ERRORCOUNT .


"populate fields of struture and append to itab
append wa_cont to it_cont.
ld_expression_string = 'Check type of data required'.

ld_expression = some text here

"populate fields of struture and append to itab
append wa_exerror to it_exerror.

"populate fields of struture and append to itab
append wa_value_tab to it_value_tab.

ld_loopindex = Check type of data required

"populate fields of struture and append to itab
append wa_value_tab_converted to it_value_tab_converted.

ld_inttype_of_constant = some text here

"populate fields of struture and append to itab
append wa_elem_refstruct_nametab to it_elem_refstruct_nametab.

ld_intleng_of_constant = Check type of data required

ld_refstruct_of_expression = some text here
ld_do_not_free_bor_objects = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name SWA_EXPR_EVALUATE_TEST or its description.