SAP Function Modules

SWB_COND_TO_HTML SAP Function module







SWB_COND_TO_HTML 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 SWB_COND_TO_HTML into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM SWB_COND_TO_HTML - SWB COND TO HTML





CALL FUNCTION 'SWB_COND_TO_HTML' "
* EXPORTING
*   receiver =                  " swe_rectyp    Name of Receiver Type
*   catid = 'BO'                " sibfcatid     Category of Objects in Persistent Object References
*   object =                    " c             Object Type
*   event =                     " swo_event     Event
*   currency =                  " sycurr        Currency Key
*   operator_style =            " string
*   onclick_command =           " string
*   onmouseover_command =       " string
*   onmouseout_command =        " string
*   natural_language =          " xflag
*   tooltip_text =              " string
*   container_if =              " if_swf_cnt_container  Container Object
*   expression_factory =        " cl_swf_exp_factory  Create and Manage Expressions
*   want_plain_html =           " xflag
*   force_technical_names = SPACE  " xflag
  IMPORTING
    html_string =               " string
    html_size =                 " i
* TABLES
*   condition =                 " swb_cond
*   contdef =                   " swcontdef
*   html_code =                 " swbhtmline
  EXCEPTIONS
    NO_CONDITION = 1            "
    NO_CONTAINER_DEFINITION = 2  "
    INVALID_BRACKET_STRUCTURE = 3  "
    .  "  SWB_COND_TO_HTML

ABAP code example for Function Module SWB_COND_TO_HTML





The ABAP code below is a full code listing to execute function module SWB_COND_TO_HTML 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_html_string  TYPE STRING ,
ld_html_size  TYPE I ,
it_condition  TYPE STANDARD TABLE OF SWB_COND,"TABLES PARAM
wa_condition  LIKE LINE OF it_condition ,
it_contdef  TYPE STANDARD TABLE OF SWCONTDEF,"TABLES PARAM
wa_contdef  LIKE LINE OF it_contdef ,
it_html_code  TYPE STANDARD TABLE OF SWBHTMLINE,"TABLES PARAM
wa_html_code  LIKE LINE OF it_html_code .

DATA(ld_receiver) = 'Check type of data required'.
DATA(ld_catid) = 'Check type of data required'.
DATA(ld_object) = 'Check type of data required'.
DATA(ld_event) = 'Check type of data required'.
DATA(ld_currency) = 'some text here'.
DATA(ld_operator_style) = 'some text here'.
DATA(ld_onclick_command) = 'some text here'.
DATA(ld_onmouseover_command) = 'some text here'.
DATA(ld_onmouseout_command) = 'some text here'.
DATA(ld_natural_language) = 'some text here'.
DATA(ld_tooltip_text) = 'some text here'.
DATA(ld_container_if) = 'some text here'.
DATA(ld_expression_factory) = 'some text here'.
DATA(ld_want_plain_html) = 'some text here'.
DATA(ld_force_technical_names) = 'some text here'.

"populate fields of struture and append to itab
append wa_condition to it_condition.

"populate fields of struture and append to itab
append wa_contdef to it_contdef.

"populate fields of struture and append to itab
append wa_html_code to it_html_code. . CALL FUNCTION 'SWB_COND_TO_HTML' * EXPORTING * receiver = ld_receiver * catid = ld_catid * object = ld_object * event = ld_event * currency = ld_currency * operator_style = ld_operator_style * onclick_command = ld_onclick_command * onmouseover_command = ld_onmouseover_command * onmouseout_command = ld_onmouseout_command * natural_language = ld_natural_language * tooltip_text = ld_tooltip_text * container_if = ld_container_if * expression_factory = ld_expression_factory * want_plain_html = ld_want_plain_html * force_technical_names = ld_force_technical_names IMPORTING html_string = ld_html_string html_size = ld_html_size * TABLES * condition = it_condition * contdef = it_contdef * html_code = it_html_code EXCEPTIONS NO_CONDITION = 1 NO_CONTAINER_DEFINITION = 2 INVALID_BRACKET_STRUCTURE = 3 . " SWB_COND_TO_HTML
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here 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_html_string  TYPE STRING ,
ld_receiver  TYPE SWE_RECTYP ,
it_condition  TYPE STANDARD TABLE OF SWB_COND ,
wa_condition  LIKE LINE OF it_condition,
ld_html_size  TYPE I ,
ld_catid  TYPE SIBFCATID ,
it_contdef  TYPE STANDARD TABLE OF SWCONTDEF ,
wa_contdef  LIKE LINE OF it_contdef,
ld_object  TYPE C ,
it_html_code  TYPE STANDARD TABLE OF SWBHTMLINE ,
wa_html_code  LIKE LINE OF it_html_code,
ld_event  TYPE SWO_EVENT ,
ld_currency  TYPE SYCURR ,
ld_operator_style  TYPE STRING ,
ld_onclick_command  TYPE STRING ,
ld_onmouseover_command  TYPE STRING ,
ld_onmouseout_command  TYPE STRING ,
ld_natural_language  TYPE XFLAG ,
ld_tooltip_text  TYPE STRING ,
ld_container_if  TYPE IF_SWF_CNT_CONTAINER ,
ld_expression_factory  TYPE CL_SWF_EXP_FACTORY ,
ld_want_plain_html  TYPE XFLAG ,
ld_force_technical_names  TYPE XFLAG .

ld_receiver = 'some text here'.

"populate fields of struture and append to itab
append wa_condition to it_condition.
ld_catid = 'some text here'.

"populate fields of struture and append to itab
append wa_contdef to it_contdef.
ld_object = 'some text here'.

"populate fields of struture and append to itab
append wa_html_code to it_html_code.
ld_event = 'some text here'.
ld_currency = 'some text here'.
ld_operator_style = 'some text here'.
ld_onclick_command = 'some text here'.
ld_onmouseover_command = 'some text here'.
ld_onmouseout_command = 'some text here'.
ld_natural_language = 'some text here'.
ld_tooltip_text = 'some text here'.
ld_container_if = 'some text here'.
ld_expression_factory = 'some text here'.
ld_want_plain_html = 'some text here'.
ld_force_technical_names = 'some text here'.

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 SWB_COND_TO_HTML or its description.