SAP BM_LINE_BREAK Function Module for Line break









BM_LINE_BREAK is a standard bm line break SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Line break processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for bm line break FM, simply by entering the name BM_LINE_BREAK into the relevant SAP transaction such as SE37 or SE38.

Function Group: SF07
Program Name: SAPLSF07
Main Program:
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function BM_LINE_BREAK pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'BM_LINE_BREAK'"Line break
EXPORTING
* LINE_COUNT = 4 "
* LINE_LEN = 19 "
IN_STRING = "
* NEWLINE_CHAR = '~' "
* HYPHEN_CHAR = '_' "
* LANGU = SY-LANGU "

IMPORTING
OUT_LEN = "
OUT_STRING = "
RET_CODE = "

EXCEPTIONS
BREAK_LOOP_ERROR = 1 SPLITTING_ERROR = 2 ERROR_UNKNOWN_BREAK_TYPE = 3 ERROR_UNKNOWN_LANGUAGE = 4 ERROR_LANGUAGE_NOT_SUPPORTED = 5
.



IMPORTING Parameters details for BM_LINE_BREAK

LINE_COUNT -

Data type:
Default: 4
Optional: Yes
Call by Reference: No ( called with pass by value option)

LINE_LEN -

Data type:
Default: 19
Optional: Yes
Call by Reference: No ( called with pass by value option)

IN_STRING -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NEWLINE_CHAR -

Data type:
Default: '~'
Optional: Yes
Call by Reference: No ( called with pass by value option)

HYPHEN_CHAR -

Data type:
Default: '_'
Optional: Yes
Call by Reference: No ( called with pass by value option)

LANGU -

Data type: SY-LANGU
Default: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for BM_LINE_BREAK

OUT_LEN -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

OUT_STRING -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

RET_CODE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

BREAK_LOOP_ERROR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

SPLITTING_ERROR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ERROR_UNKNOWN_BREAK_TYPE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ERROR_UNKNOWN_LANGUAGE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ERROR_LANGUAGE_NOT_SUPPORTED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for BM_LINE_BREAK Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_out_len  TYPE STRING, "   
lv_line_count  TYPE STRING, "   4
lv_break_loop_error  TYPE STRING, "   
lv_line_len  TYPE STRING, "   19
lv_out_string  TYPE STRING, "   
lv_splitting_error  TYPE STRING, "   
lv_ret_code  TYPE STRING, "   
lv_in_string  TYPE STRING, "   
lv_error_unknown_break_type  TYPE STRING, "   
lv_newline_char  TYPE STRING, "   '~'
lv_error_unknown_language  TYPE STRING, "   
lv_hyphen_char  TYPE STRING, "   '_'
lv_error_language_not_supported  TYPE STRING, "   
lv_langu  TYPE SY-LANGU. "   SY-LANGU

  CALL FUNCTION 'BM_LINE_BREAK'  "Line break
    EXPORTING
         LINE_COUNT = lv_line_count
         LINE_LEN = lv_line_len
         IN_STRING = lv_in_string
         NEWLINE_CHAR = lv_newline_char
         HYPHEN_CHAR = lv_hyphen_char
         LANGU = lv_langu
    IMPORTING
         OUT_LEN = lv_out_len
         OUT_STRING = lv_out_string
         RET_CODE = lv_ret_code
    EXCEPTIONS
        BREAK_LOOP_ERROR = 1
        SPLITTING_ERROR = 2
        ERROR_UNKNOWN_BREAK_TYPE = 3
        ERROR_UNKNOWN_LANGUAGE = 4
        ERROR_LANGUAGE_NOT_SUPPORTED = 5
. " BM_LINE_BREAK




ABAP code using 7.40 inline data declarations to call FM BM_LINE_BREAK

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
DATA(ld_line_count) = 4.
 
 
DATA(ld_line_len) = 19.
 
 
 
 
 
 
DATA(ld_newline_char) = '~'.
 
 
DATA(ld_hyphen_char) = '_'.
 
 
"SELECT single LANGU FROM SY INTO @DATA(ld_langu).
DATA(ld_langu) = SY-LANGU.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!