SAP Function Modules

CY_KBED_COMMITMENT_GET_INTERV SAP Function module







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

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


Pattern for FM CY_KBED_COMMITMENT_GET_INTERV - CY KBED COMMITMENT GET INTERV





CALL FUNCTION 'CY_KBED_COMMITMENT_GET_INTERV' "
  EXPORTING
    i_kapid =                   " kako-kapid
    i_date_beg =                " i
    i_time_beg =                " kapa-begzt
    i_date_end =                " i
    i_time_end =                " kapa-begzt    Read record using index
*   i_index = 0                 " sy-tabix      Index of commitment record starting with which search begins
*   i_flg_forward = 'X'         " c             Search in future
*   i_amount_sum = 0            " kbed-kruerest  Existing total commitment in interval
*   i_flg_not_starting_before = SPACE  " c      Do not look for commitment starting before interval
*   i_flg_only_up_to_next_gap = SPACE  " c
  TABLES
    kbed_commitment_tab =       " cykapabel     Commitment records found
  EXCEPTIONS
    NOT_FOUND = 1               "               No records found
    .  "  CY_KBED_COMMITMENT_GET_INTERV

ABAP code example for Function Module CY_KBED_COMMITMENT_GET_INTERV





The ABAP code below is a full code listing to execute function module CY_KBED_COMMITMENT_GET_INTERV 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_kbed_commitment_tab  TYPE STANDARD TABLE OF CYKAPABEL,"TABLES PARAM
wa_kbed_commitment_tab  LIKE LINE OF it_kbed_commitment_tab .


SELECT single KAPID
FROM KAKO
INTO @DATA(ld_i_kapid).

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

SELECT single BEGZT
FROM KAPA
INTO @DATA(ld_i_time_beg).

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

SELECT single BEGZT
FROM KAPA
INTO @DATA(ld_i_time_end).

DATA(ld_i_index) = '123 '.
DATA(ld_i_flg_forward) = '123 '.

SELECT single KRUEREST
FROM KBED
INTO @DATA(ld_i_amount_sum).

DATA(ld_i_flg_not_starting_before) = '123 '.
DATA(ld_i_flg_only_up_to_next_gap) = '123 '.

"populate fields of struture and append to itab
append wa_kbed_commitment_tab to it_kbed_commitment_tab. . CALL FUNCTION 'CY_KBED_COMMITMENT_GET_INTERV' EXPORTING i_kapid = ld_i_kapid i_date_beg = ld_i_date_beg i_time_beg = ld_i_time_beg i_date_end = ld_i_date_end i_time_end = ld_i_time_end * i_index = ld_i_index * i_flg_forward = ld_i_flg_forward * i_amount_sum = ld_i_amount_sum * i_flg_not_starting_before = ld_i_flg_not_starting_before * i_flg_only_up_to_next_gap = ld_i_flg_only_up_to_next_gap TABLES kbed_commitment_tab = it_kbed_commitment_tab EXCEPTIONS NOT_FOUND = 1 . " CY_KBED_COMMITMENT_GET_INTERV
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_i_kapid  TYPE KAKO-KAPID ,
it_kbed_commitment_tab  TYPE STANDARD TABLE OF CYKAPABEL ,
wa_kbed_commitment_tab  LIKE LINE OF it_kbed_commitment_tab,
ld_i_date_beg  TYPE I ,
ld_i_time_beg  TYPE KAPA-BEGZT ,
ld_i_date_end  TYPE I ,
ld_i_time_end  TYPE KAPA-BEGZT ,
ld_i_index  TYPE SY-TABIX ,
ld_i_flg_forward  TYPE C ,
ld_i_amount_sum  TYPE KBED-KRUEREST ,
ld_i_flg_not_starting_before  TYPE C ,
ld_i_flg_only_up_to_next_gap  TYPE C .


SELECT single KAPID
FROM KAKO
INTO ld_i_kapid.


"populate fields of struture and append to itab
append wa_kbed_commitment_tab to it_kbed_commitment_tab.
ld_i_date_beg = '123 '.

SELECT single BEGZT
FROM KAPA
INTO ld_i_time_beg.

ld_i_date_end = '123 '.

SELECT single BEGZT
FROM KAPA
INTO ld_i_time_end.

ld_i_index = '123 '.
ld_i_flg_forward = '123 '.

SELECT single KRUEREST
FROM KBED
INTO ld_i_amount_sum.

ld_i_flg_not_starting_before = '123 '.
ld_i_flg_only_up_to_next_gap = '123 '.

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