SAP Function Modules

OIJ_VEH_AVAILABILITY SAP Function module - Vehicle Availability







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

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


Pattern for FM OIJ_VEH_AVAILABILITY - OIJ VEH AVAILABILITY





CALL FUNCTION 'OIJ_VEH_AVAILABILITY' "Vehicle Availability
  EXPORTING
*   iv_app_area = '3WP'         " oij_vehavl_apparea  Vehicle Available Application Area
    iv_fr_date =                " oij_el_valf   Validity period start date
    iv_to_date =                " oij_el_valt   Validity period end date
*   iv_vhrlper =                " oij_period    OIL-TSW: Rolling period
*   iv_minavlper =              " oij_period    OIL-TSW: Rolling period
*   iv_remcap =                 " oij_remcap_quan  Remaining capacity in quantity
*   iv_remcap_uom =             " oij_unit      General unit of measure
*   iv_remcap_perc =            " oij_remcap_perc  Remaining capacity in percentage
*   it_loc =                    " roij_locid_rtab  Ranges Table Selection LOCID
*   it_mat =                    " roij_matnr_rtab  Ranges Table Selection MATNR
*   it_fc_no =                  " oij_cpno_rtab  Ranges Table Selection OIJ_EL_CPNO
*   it_fc_pos_no =              " oij_posnr_rtab  Ranges Table Selection  OIJ_EL_POSNR
*   iv_vbtyp =                  " oij_el_cpvbtyp  Freight contract document type
*   it_fc_veh =                 " roij_doc_veh_assgn_t  Contract ~ Vehicle Assignment
*   it_vehicle =                " roij_vhlnmr_rtab  Vehicle List
*   it_mot =                    " roij_vktra_rtab  MoT List
*   it_ts =                     " roij_tsyst_rtab  Transport System List
*   it_carrier =                " roij_carrnr_rtab  Selection Range
*   it_shipper =                " roij_ship_rtab  Ranges Table Selection OIJ_SHIPNR
*   iv_upper_limit = 100        " tbmaxsel      Maximum number of selected entries
*   is_crnmdet =                " roij_crnmdet  Current Nomination Details
*   it_vehicle_type =           " roij02_vhltyp_rtab  Ranges Table Selection  OIG_VHLTYP
  IMPORTING
    et_trans_avail_tab =        " roij_trans_avail_t  Vehicle Availability Structure
    et_nmerr =                  " roij_vehavail_nmerr_t  Table type for ROIJ_VEHAVAIL_NMERR
    et_vhsts =                  " roij_vehavail_status_t  Table type for ROIJ_VEHAVAIL_STATUS
  EXCEPTIONS
    FR_DATE_IS_BLANK = 1        "               From Date is not Entered
    TO_DATE_IS_BLANK = 2        "               To Date is not Entered
    TO_DATE_IS_LT_FR_DATE = 3   "               To Date is less than equal to from date
    FR_DATE_IN_PAST = 4         "               From Date in Past
    TO_DATE_IN_PAST = 5         "               To Date in Past
    REMCAP_UOM_NOT_PASSED = 6   "               UoM of Remaining Capacity is not passed
    NO_VEHICLE_IS_AVAILABLE = 7  "              No Vehicle is Available
    FC_NOT_EXISTS = 8           "               Entered Freight Contract-Vehicle not exists
    .  "  OIJ_VEH_AVAILABILITY

ABAP code example for Function Module OIJ_VEH_AVAILABILITY





The ABAP code below is a full code listing to execute function module OIJ_VEH_AVAILABILITY 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:
ld_et_trans_avail_tab  TYPE ROIJ_TRANS_AVAIL_T ,
ld_et_nmerr  TYPE ROIJ_VEHAVAIL_NMERR_T ,
ld_et_vhsts  TYPE ROIJ_VEHAVAIL_STATUS_T .

DATA(ld_iv_app_area) = 'Check type of data required'.
DATA(ld_iv_fr_date) = 'Check type of data required'.
DATA(ld_iv_to_date) = 'Check type of data required'.
DATA(ld_iv_vhrlper) = 'Check type of data required'.
DATA(ld_iv_minavlper) = 'Check type of data required'.
DATA(ld_iv_remcap) = 'Check type of data required'.
DATA(ld_iv_remcap_uom) = 'Check type of data required'.
DATA(ld_iv_remcap_perc) = 'Check type of data required'.
DATA(ld_it_loc) = 'Check type of data required'.
DATA(ld_it_mat) = 'Check type of data required'.
DATA(ld_it_fc_no) = 'Check type of data required'.
DATA(ld_it_fc_pos_no) = 'Check type of data required'.
DATA(ld_iv_vbtyp) = 'Check type of data required'.
DATA(ld_it_fc_veh) = 'Check type of data required'.
DATA(ld_it_vehicle) = 'Check type of data required'.
DATA(ld_it_mot) = 'Check type of data required'.
DATA(ld_it_ts) = 'Check type of data required'.
DATA(ld_it_carrier) = 'Check type of data required'.
DATA(ld_it_shipper) = 'Check type of data required'.
DATA(ld_iv_upper_limit) = 'Check type of data required'.
DATA(ld_is_crnmdet) = 'Check type of data required'.
DATA(ld_it_vehicle_type) = 'Check type of data required'. . CALL FUNCTION 'OIJ_VEH_AVAILABILITY' EXPORTING * iv_app_area = ld_iv_app_area iv_fr_date = ld_iv_fr_date iv_to_date = ld_iv_to_date * iv_vhrlper = ld_iv_vhrlper * iv_minavlper = ld_iv_minavlper * iv_remcap = ld_iv_remcap * iv_remcap_uom = ld_iv_remcap_uom * iv_remcap_perc = ld_iv_remcap_perc * it_loc = ld_it_loc * it_mat = ld_it_mat * it_fc_no = ld_it_fc_no * it_fc_pos_no = ld_it_fc_pos_no * iv_vbtyp = ld_iv_vbtyp * it_fc_veh = ld_it_fc_veh * it_vehicle = ld_it_vehicle * it_mot = ld_it_mot * it_ts = ld_it_ts * it_carrier = ld_it_carrier * it_shipper = ld_it_shipper * iv_upper_limit = ld_iv_upper_limit * is_crnmdet = ld_is_crnmdet * it_vehicle_type = ld_it_vehicle_type IMPORTING et_trans_avail_tab = ld_et_trans_avail_tab et_nmerr = ld_et_nmerr et_vhsts = ld_et_vhsts EXCEPTIONS FR_DATE_IS_BLANK = 1 TO_DATE_IS_BLANK = 2 TO_DATE_IS_LT_FR_DATE = 3 FR_DATE_IN_PAST = 4 TO_DATE_IN_PAST = 5 REMCAP_UOM_NOT_PASSED = 6 NO_VEHICLE_IS_AVAILABLE = 7 FC_NOT_EXISTS = 8 . " OIJ_VEH_AVAILABILITY
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 ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "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_et_trans_avail_tab  TYPE ROIJ_TRANS_AVAIL_T ,
ld_iv_app_area  TYPE OIJ_VEHAVL_APPAREA ,
ld_et_nmerr  TYPE ROIJ_VEHAVAIL_NMERR_T ,
ld_iv_fr_date  TYPE OIJ_EL_VALF ,
ld_et_vhsts  TYPE ROIJ_VEHAVAIL_STATUS_T ,
ld_iv_to_date  TYPE OIJ_EL_VALT ,
ld_iv_vhrlper  TYPE OIJ_PERIOD ,
ld_iv_minavlper  TYPE OIJ_PERIOD ,
ld_iv_remcap  TYPE OIJ_REMCAP_QUAN ,
ld_iv_remcap_uom  TYPE OIJ_UNIT ,
ld_iv_remcap_perc  TYPE OIJ_REMCAP_PERC ,
ld_it_loc  TYPE ROIJ_LOCID_RTAB ,
ld_it_mat  TYPE ROIJ_MATNR_RTAB ,
ld_it_fc_no  TYPE OIJ_CPNO_RTAB ,
ld_it_fc_pos_no  TYPE OIJ_POSNR_RTAB ,
ld_iv_vbtyp  TYPE OIJ_EL_CPVBTYP ,
ld_it_fc_veh  TYPE ROIJ_DOC_VEH_ASSGN_T ,
ld_it_vehicle  TYPE ROIJ_VHLNMR_RTAB ,
ld_it_mot  TYPE ROIJ_VKTRA_RTAB ,
ld_it_ts  TYPE ROIJ_TSYST_RTAB ,
ld_it_carrier  TYPE ROIJ_CARRNR_RTAB ,
ld_it_shipper  TYPE ROIJ_SHIP_RTAB ,
ld_iv_upper_limit  TYPE TBMAXSEL ,
ld_is_crnmdet  TYPE ROIJ_CRNMDET ,
ld_it_vehicle_type  TYPE ROIJ02_VHLTYP_RTAB .

ld_iv_app_area = 'Check type of data required'.
ld_iv_fr_date = 'Check type of data required'.
ld_iv_to_date = 'Check type of data required'.
ld_iv_vhrlper = 'Check type of data required'.
ld_iv_minavlper = 'Check type of data required'.
ld_iv_remcap = 'Check type of data required'.
ld_iv_remcap_uom = 'Check type of data required'.
ld_iv_remcap_perc = 'Check type of data required'.
ld_it_loc = 'Check type of data required'.
ld_it_mat = 'Check type of data required'.
ld_it_fc_no = 'Check type of data required'.
ld_it_fc_pos_no = 'Check type of data required'.
ld_iv_vbtyp = 'Check type of data required'.
ld_it_fc_veh = 'Check type of data required'.
ld_it_vehicle = 'Check type of data required'.
ld_it_mot = 'Check type of data required'.
ld_it_ts = 'Check type of data required'.
ld_it_carrier = 'Check type of data required'.
ld_it_shipper = 'Check type of data required'.
ld_iv_upper_limit = 'Check type of data required'.
ld_is_crnmdet = 'Check type of data required'.
ld_it_vehicle_type = 'Check type of data required'.

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