SAP SX_FORMAT_CONVERT Function Module for









SX_FORMAT_CONVERT is a standard sx format convert SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 sx format convert FM, simply by entering the name SX_FORMAT_CONVERT into the relevant SAP transaction such as SE37 or SE38.

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



Function SX_FORMAT_CONVERT 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 'SX_FORMAT_CONVERT'"
EXPORTING
* NODE = "
* ADDR_TYPE = 'INT' "

CHANGING
FORMAT = "
TRANSFER_BIN = "
CONTENT_TXT = "
CONTENT_BIN = "
OBJHEAD = "Object header
LEN = "

EXCEPTIONS
ERR_CONV_FAILED = 1 ERR_CONV_UNKNOWN = 2
.



IMPORTING Parameters details for SX_FORMAT_CONVERT

NODE -

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

ADDR_TYPE -

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

CHANGING Parameters details for SX_FORMAT_CONVERT

FORMAT -

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

TRANSFER_BIN -

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

CONTENT_TXT -

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

CONTENT_BIN -

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

OBJHEAD - Object header

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

LEN -

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

EXCEPTIONS details

ERR_CONV_FAILED - Conversion Could Not Be Executed

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

ERR_CONV_UNKNOWN -

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

Copy and paste ABAP code example for SX_FORMAT_CONVERT 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_node  TYPE SX_NODE_ID, "   
lv_format  TYPE SX_FORMAT, "   
lv_err_conv_failed  TYPE SX_FORMAT, "   
lv_addr_type  TYPE SX_ADDR_TYPE, "   'INT'
lv_transfer_bin  TYPE SX_BOOLEAN, "   
lv_err_conv_unknown  TYPE SX_BOOLEAN, "   
lv_content_txt  TYPE SOLI_TAB, "   
lv_content_bin  TYPE SOLIX_TAB, "   
lv_objhead  TYPE SOLI_TAB, "   
lv_len  TYPE SO_OBJ_LEN. "   

  CALL FUNCTION 'SX_FORMAT_CONVERT'  "
    EXPORTING
         NODE = lv_node
         ADDR_TYPE = lv_addr_type
    CHANGING
         FORMAT = lv_format
         TRANSFER_BIN = lv_transfer_bin
         CONTENT_TXT = lv_content_txt
         CONTENT_BIN = lv_content_bin
         OBJHEAD = lv_objhead
         LEN = lv_len
    EXCEPTIONS
        ERR_CONV_FAILED = 1
        ERR_CONV_UNKNOWN = 2
. " SX_FORMAT_CONVERT




ABAP code using 7.40 inline data declarations to call FM SX_FORMAT_CONVERT

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_addr_type) = 'INT'.
 
 
 
 
 
 
 


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!