SAP CREATE_ASSET_FOR_POSTING Function Module for
CREATE_ASSET_FOR_POSTING is a standard create asset for posting 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 create asset for posting FM, simply by entering the name CREATE_ASSET_FOR_POSTING into the relevant SAP transaction such as SE37 or SE38.
Function Group: AIST
Program Name: SAPLAIST
Main Program: SAPLAIST
Appliation area: A
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CREATE_ASSET_FOR_POSTING 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 'CREATE_ASSET_FOR_POSTING'".
EXPORTING
I_ANLA = "
* I_XNACH = ' ' "
* I_DARK = 'X' "
* I_BUKRS_FIX = 'X' "
* I_GSBER_FIX = ' ' "
* I_TRANSV = ' ' "
* I_CALLED_BY_TRANSFER = ' ' "
* I_ANLU = "Asset Master Record: User Fields
* I_ANLV = "
* I_ANLZ = "
* I_ANLH = "Main Asset Number
* I_RANLN1 = ' ' "
* I_RANLN2 = ' ' "
* I_RBUKRS = ' ' "
* I_SUBNO = ' ' "
IMPORTING
E_ANLH = "
E_ANLA = "
E_ANLU = "Asset Master Record: User Fields
E_ANLV = "
E_ANLZ = "
TABLES
* T_ANLB_I = "
* T_ANLB_E = "
* T_ANLC_E = "Asset Value Fields
EXCEPTIONS
MISSING_COMPANY_CODE = 1 MISSING_ASSET_CLASS = 2 MISSING_ASSET_MAINNUMBER = 3 INTERNAL_ERROR = 4
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLAIST_001 Exchange Number Range
EXIT_SAPLAIST_002 Transfer Data for User Subscreens
EXIT_SAPLAIST_003 Transfer of User-Defined Fields to SAP Master Data Transactions
IMPORTING Parameters details for CREATE_ASSET_FOR_POSTING
I_ANLA -
Data type: ANLAOptional: No
Call by Reference: No ( called with pass by value option)
I_XNACH -
Data type: RA02S-XNACHDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DARK -
Data type: T020-KOARTDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_BUKRS_FIX -
Data type: T020-KOARTDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_GSBER_FIX -
Data type: T020-KOARTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_TRANSV -
Data type: T082I-TRANSVDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CALLED_BY_TRANSFER -
Data type: RA02S-XNEWDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ANLU - Asset Master Record: User Fields
Data type: ANLUOptional: Yes
Call by Reference: No ( called with pass by value option)
I_ANLV -
Data type: ANLVOptional: Yes
Call by Reference: No ( called with pass by value option)
I_ANLZ -
Data type: ANLZOptional: Yes
Call by Reference: No ( called with pass by value option)
I_ANLH - Main Asset Number
Data type: ANLHOptional: Yes
Call by Reference: No ( called with pass by value option)
I_RANLN1 -
Data type: RA02S-RANL1Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_RANLN2 -
Data type: RA02S-RANL2Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_RBUKRS -
Data type: RA02S-RBUKRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SUBNO -
Data type: T020-KOARTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CREATE_ASSET_FOR_POSTING
E_ANLH -
Data type: ANLHOptional: No
Call by Reference: No ( called with pass by value option)
E_ANLA -
Data type: ANLAOptional: No
Call by Reference: No ( called with pass by value option)
E_ANLU - Asset Master Record: User Fields
Data type: ANLUOptional: No
Call by Reference: No ( called with pass by value option)
E_ANLV -
Data type: ANLVOptional: No
Call by Reference: No ( called with pass by value option)
E_ANLZ -
Data type: ANLZOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CREATE_ASSET_FOR_POSTING
T_ANLB_I -
Data type: ANLBOptional: Yes
Call by Reference: No ( called with pass by value option)
T_ANLB_E -
Data type: ANLBOptional: Yes
Call by Reference: No ( called with pass by value option)
T_ANLC_E - Asset Value Fields
Data type: ANLCOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
MISSING_COMPANY_CODE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MISSING_ASSET_CLASS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MISSING_ASSET_MAINNUMBER -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CREATE_ASSET_FOR_POSTING 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_e_anlh | TYPE ANLH, " | |||
| lv_i_anla | TYPE ANLA, " | |||
| lt_t_anlb_i | TYPE STANDARD TABLE OF ANLB, " | |||
| lv_missing_company_code | TYPE ANLB, " | |||
| lv_i_xnach | TYPE RA02S-XNACH, " SPACE | |||
| lv_i_dark | TYPE T020-KOART, " 'X' | |||
| lv_i_bukrs_fix | TYPE T020-KOART, " 'X' | |||
| lv_i_gsber_fix | TYPE T020-KOART, " SPACE | |||
| lv_i_transv | TYPE T082I-TRANSV, " SPACE | |||
| lv_i_called_by_transfer | TYPE RA02S-XNEW, " SPACE | |||
| lv_e_anla | TYPE ANLA, " | |||
| lv_i_anlu | TYPE ANLU, " | |||
| lt_t_anlb_e | TYPE STANDARD TABLE OF ANLB, " | |||
| lv_missing_asset_class | TYPE ANLB, " | |||
| lv_e_anlu | TYPE ANLU, " | |||
| lv_i_anlv | TYPE ANLV, " | |||
| lt_t_anlc_e | TYPE STANDARD TABLE OF ANLC, " | |||
| lv_missing_asset_mainnumber | TYPE ANLC, " | |||
| lv_e_anlv | TYPE ANLV, " | |||
| lv_i_anlz | TYPE ANLZ, " | |||
| lv_internal_error | TYPE ANLZ, " | |||
| lv_e_anlz | TYPE ANLZ, " | |||
| lv_i_anlh | TYPE ANLH, " | |||
| lv_i_ranln1 | TYPE RA02S-RANL1, " SPACE | |||
| lv_i_ranln2 | TYPE RA02S-RANL2, " SPACE | |||
| lv_i_rbukrs | TYPE RA02S-RBUKR, " SPACE | |||
| lv_i_subno | TYPE T020-KOART. " SPACE |
|   CALL FUNCTION 'CREATE_ASSET_FOR_POSTING' " |
| EXPORTING | ||
| I_ANLA | = lv_i_anla | |
| I_XNACH | = lv_i_xnach | |
| I_DARK | = lv_i_dark | |
| I_BUKRS_FIX | = lv_i_bukrs_fix | |
| I_GSBER_FIX | = lv_i_gsber_fix | |
| I_TRANSV | = lv_i_transv | |
| I_CALLED_BY_TRANSFER | = lv_i_called_by_transfer | |
| I_ANLU | = lv_i_anlu | |
| I_ANLV | = lv_i_anlv | |
| I_ANLZ | = lv_i_anlz | |
| I_ANLH | = lv_i_anlh | |
| I_RANLN1 | = lv_i_ranln1 | |
| I_RANLN2 | = lv_i_ranln2 | |
| I_RBUKRS | = lv_i_rbukrs | |
| I_SUBNO | = lv_i_subno | |
| IMPORTING | ||
| E_ANLH | = lv_e_anlh | |
| E_ANLA | = lv_e_anla | |
| E_ANLU | = lv_e_anlu | |
| E_ANLV | = lv_e_anlv | |
| E_ANLZ | = lv_e_anlz | |
| TABLES | ||
| T_ANLB_I | = lt_t_anlb_i | |
| T_ANLB_E | = lt_t_anlb_e | |
| T_ANLC_E | = lt_t_anlc_e | |
| EXCEPTIONS | ||
| MISSING_COMPANY_CODE = 1 | ||
| MISSING_ASSET_CLASS = 2 | ||
| MISSING_ASSET_MAINNUMBER = 3 | ||
| INTERNAL_ERROR = 4 | ||
| . " CREATE_ASSET_FOR_POSTING | ||
ABAP code using 7.40 inline data declarations to call FM CREATE_ASSET_FOR_POSTING
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.| "SELECT single XNACH FROM RA02S INTO @DATA(ld_i_xnach). | ||||
| DATA(ld_i_xnach) | = ' '. | |||
| "SELECT single KOART FROM T020 INTO @DATA(ld_i_dark). | ||||
| DATA(ld_i_dark) | = 'X'. | |||
| "SELECT single KOART FROM T020 INTO @DATA(ld_i_bukrs_fix). | ||||
| DATA(ld_i_bukrs_fix) | = 'X'. | |||
| "SELECT single KOART FROM T020 INTO @DATA(ld_i_gsber_fix). | ||||
| DATA(ld_i_gsber_fix) | = ' '. | |||
| "SELECT single TRANSV FROM T082I INTO @DATA(ld_i_transv). | ||||
| DATA(ld_i_transv) | = ' '. | |||
| "SELECT single XNEW FROM RA02S INTO @DATA(ld_i_called_by_transfer). | ||||
| DATA(ld_i_called_by_transfer) | = ' '. | |||
| "SELECT single RANL1 FROM RA02S INTO @DATA(ld_i_ranln1). | ||||
| DATA(ld_i_ranln1) | = ' '. | |||
| "SELECT single RANL2 FROM RA02S INTO @DATA(ld_i_ranln2). | ||||
| DATA(ld_i_ranln2) | = ' '. | |||
| "SELECT single RBUKR FROM RA02S INTO @DATA(ld_i_rbukrs). | ||||
| DATA(ld_i_rbukrs) | = ' '. | |||
| "SELECT single KOART FROM T020 INTO @DATA(ld_i_subno). | ||||
| DATA(ld_i_subno) | = ' '. | |||
Search for further information about these or an SAP related objects