SAP Function Modules

K_SETTLEMENT_CHECK SAP Function module







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

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


Pattern for FM K_SETTLEMENT_CHECK - K SETTLEMENT CHECK





CALL FUNCTION 'K_SETTLEMENT_CHECK' "
  EXPORTING
*   ignore_warnings = ' '       " c
    profil =                    " cobra-aprof   Settlement Profile
*   i_wkg_only = ' '            " c
*   inv_massn =                 " taprf-invma
*   testrun =                   " c
  TABLES
    aa =                        " auaa
    ab =                        " auab
    ao =                        " auao
    as =                        " auas
    av =                        " auav
    ai =                        " auai
*   ai_rest =                   " auai
*   t_coiob =                   " coiob
*   aw =                        " auaw
  CHANGING
    ak =                        " auak
  EXCEPTIONS
    ERROR_OCCURRED = 1          "               An Error Has Occurred
    MESSAGES_STORED = 2         "
    CORRECTIONS_WANTED = 3      "
    .  "  K_SETTLEMENT_CHECK

ABAP code example for Function Module K_SETTLEMENT_CHECK





The ABAP code below is a full code listing to execute function module K_SETTLEMENT_CHECK 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:
it_aa  TYPE STANDARD TABLE OF AUAA,"TABLES PARAM
wa_aa  LIKE LINE OF it_aa ,
it_ab  TYPE STANDARD TABLE OF AUAB,"TABLES PARAM
wa_ab  LIKE LINE OF it_ab ,
it_ao  TYPE STANDARD TABLE OF AUAO,"TABLES PARAM
wa_ao  LIKE LINE OF it_ao ,
it_as  TYPE STANDARD TABLE OF AUAS,"TABLES PARAM
wa_as  LIKE LINE OF it_as ,
it_av  TYPE STANDARD TABLE OF AUAV,"TABLES PARAM
wa_av  LIKE LINE OF it_av ,
it_ai  TYPE STANDARD TABLE OF AUAI,"TABLES PARAM
wa_ai  LIKE LINE OF it_ai ,
it_ai_rest  TYPE STANDARD TABLE OF AUAI,"TABLES PARAM
wa_ai_rest  LIKE LINE OF it_ai_rest ,
it_t_coiob  TYPE STANDARD TABLE OF COIOB,"TABLES PARAM
wa_t_coiob  LIKE LINE OF it_t_coiob ,
it_aw  TYPE STANDARD TABLE OF AUAW,"TABLES PARAM
wa_aw  LIKE LINE OF it_aw .

DATA(ld_ak) = 'Check type of data required'.
DATA(ld_ignore_warnings) = 'Check type of data required'.

SELECT single APROF
FROM COBRA
INTO @DATA(ld_profil).

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

SELECT single INVMA
FROM TAPRF
INTO @DATA(ld_inv_massn).

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

"populate fields of struture and append to itab
append wa_aa to it_aa.

"populate fields of struture and append to itab
append wa_ab to it_ab.

"populate fields of struture and append to itab
append wa_ao to it_ao.

"populate fields of struture and append to itab
append wa_as to it_as.

"populate fields of struture and append to itab
append wa_av to it_av.

"populate fields of struture and append to itab
append wa_ai to it_ai.

"populate fields of struture and append to itab
append wa_ai_rest to it_ai_rest.

"populate fields of struture and append to itab
append wa_t_coiob to it_t_coiob.

"populate fields of struture and append to itab
append wa_aw to it_aw. . CALL FUNCTION 'K_SETTLEMENT_CHECK' EXPORTING * ignore_warnings = ld_ignore_warnings profil = ld_profil * i_wkg_only = ld_i_wkg_only * inv_massn = ld_inv_massn * testrun = ld_testrun TABLES aa = it_aa ab = it_ab ao = it_ao as = it_as av = it_av ai = it_ai * ai_rest = it_ai_rest * t_coiob = it_t_coiob * aw = it_aw CHANGING ak = ld_ak EXCEPTIONS ERROR_OCCURRED = 1 MESSAGES_STORED = 2 CORRECTIONS_WANTED = 3 . " K_SETTLEMENT_CHECK
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_ak  TYPE AUAK ,
ld_ignore_warnings  TYPE C ,
it_aa  TYPE STANDARD TABLE OF AUAA ,
wa_aa  LIKE LINE OF it_aa,
ld_profil  TYPE COBRA-APROF ,
it_ab  TYPE STANDARD TABLE OF AUAB ,
wa_ab  LIKE LINE OF it_ab,
ld_i_wkg_only  TYPE C ,
it_ao  TYPE STANDARD TABLE OF AUAO ,
wa_ao  LIKE LINE OF it_ao,
ld_inv_massn  TYPE TAPRF-INVMA ,
it_as  TYPE STANDARD TABLE OF AUAS ,
wa_as  LIKE LINE OF it_as,
ld_testrun  TYPE C ,
it_av  TYPE STANDARD TABLE OF AUAV ,
wa_av  LIKE LINE OF it_av,
it_ai  TYPE STANDARD TABLE OF AUAI ,
wa_ai  LIKE LINE OF it_ai,
it_ai_rest  TYPE STANDARD TABLE OF AUAI ,
wa_ai_rest  LIKE LINE OF it_ai_rest,
it_t_coiob  TYPE STANDARD TABLE OF COIOB ,
wa_t_coiob  LIKE LINE OF it_t_coiob,
it_aw  TYPE STANDARD TABLE OF AUAW ,
wa_aw  LIKE LINE OF it_aw.

ld_ak = 'Check type of data required'.
ld_ignore_warnings = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_aa to it_aa.

SELECT single APROF
FROM COBRA
INTO ld_profil.


"populate fields of struture and append to itab
append wa_ab to it_ab.
ld_i_wkg_only = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_ao to it_ao.

SELECT single INVMA
FROM TAPRF
INTO ld_inv_massn.


"populate fields of struture and append to itab
append wa_as to it_as.
ld_testrun = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_av to it_av.

"populate fields of struture and append to itab
append wa_ai to it_ai.

"populate fields of struture and append to itab
append wa_ai_rest to it_ai_rest.

"populate fields of struture and append to itab
append wa_t_coiob to it_t_coiob.

"populate fields of struture and append to itab
append wa_aw to it_aw.

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