SAP Function Modules

OIDA_GET_ORIGIN_DESTINATION SAP Function module - Get the orgin and destination field values from plant and ship-to







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

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


Pattern for FM OIDA_GET_ORIGIN_DESTINATION - OIDA GET ORIGIN DESTINATION





CALL FUNCTION 'OIDA_GET_ORIGIN_DESTINATION' "Get the orgin and destination field values from plant and ship-to
* EXPORTING
*   i_werks =                   " vbap-werks    Input plant: (get the ORIGIN field values)
*   i_ship_to =                 " vbpa-kunnr    Input ship-to: (get DESTINATION field values)
*   i_po_so =                   " ekko-abgru
*   i_vend =                    " ekko-lifnr
*   i_rec_werks =               " ekpo-werks
  IMPORTING
    e_oic_dcityc =              " oic_pipe-oic_dcityc  destination city code     (from ship-to)
    e_oic_dcounc =              " oic_pipe-oic_dcounc  destination county code   (from ship-to)
    e_oic_dregio =              " oic_pipe-oic_dregio  destination region code   (from ship-to)
    e_oic_oland1 =              " oic_pipe-oic_oland1  origin country code       (from plant)
    e_oic_oregio =              " oic_pipe-oic_oregio  origin region code         (from plant)
    e_oic_ocounc =              " oic_pipe-oic_ocounc  origin county code         (from plant)
    e_oic_ocityc =              " oic_pipe-oic_ocityc  origin city code           (from plant)
    e_oic_dland1 =              " oic_pipe-oic_dland1  destination country code   (from ship-to)
    .  "  OIDA_GET_ORIGIN_DESTINATION

ABAP code example for Function Module OIDA_GET_ORIGIN_DESTINATION





The ABAP code below is a full code listing to execute function module OIDA_GET_ORIGIN_DESTINATION 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_e_oic_dcityc  TYPE OIC_PIPE-OIC_DCITYC ,
ld_e_oic_dcounc  TYPE OIC_PIPE-OIC_DCOUNC ,
ld_e_oic_dregio  TYPE OIC_PIPE-OIC_DREGIO ,
ld_e_oic_oland1  TYPE OIC_PIPE-OIC_OLAND1 ,
ld_e_oic_oregio  TYPE OIC_PIPE-OIC_OREGIO ,
ld_e_oic_ocounc  TYPE OIC_PIPE-OIC_OCOUNC ,
ld_e_oic_ocityc  TYPE OIC_PIPE-OIC_OCITYC ,
ld_e_oic_dland1  TYPE OIC_PIPE-OIC_DLAND1 .


SELECT single WERKS
FROM VBAP
INTO @DATA(ld_i_werks).


SELECT single KUNNR
FROM VBPA
INTO @DATA(ld_i_ship_to).


SELECT single ABGRU
FROM EKKO
INTO @DATA(ld_i_po_so).


SELECT single LIFNR
FROM EKKO
INTO @DATA(ld_i_vend).


SELECT single WERKS
FROM EKPO
INTO @DATA(ld_i_rec_werks).
. CALL FUNCTION 'OIDA_GET_ORIGIN_DESTINATION' * EXPORTING * i_werks = ld_i_werks * i_ship_to = ld_i_ship_to * i_po_so = ld_i_po_so * i_vend = ld_i_vend * i_rec_werks = ld_i_rec_werks IMPORTING e_oic_dcityc = ld_e_oic_dcityc e_oic_dcounc = ld_e_oic_dcounc e_oic_dregio = ld_e_oic_dregio e_oic_oland1 = ld_e_oic_oland1 e_oic_oregio = ld_e_oic_oregio e_oic_ocounc = ld_e_oic_ocounc e_oic_ocityc = ld_e_oic_ocityc e_oic_dland1 = ld_e_oic_dland1 . " OIDA_GET_ORIGIN_DESTINATION
IF SY-SUBRC EQ 0. "All OK 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_e_oic_dcityc  TYPE OIC_PIPE-OIC_DCITYC ,
ld_i_werks  TYPE VBAP-WERKS ,
ld_e_oic_dcounc  TYPE OIC_PIPE-OIC_DCOUNC ,
ld_i_ship_to  TYPE VBPA-KUNNR ,
ld_e_oic_dregio  TYPE OIC_PIPE-OIC_DREGIO ,
ld_i_po_so  TYPE EKKO-ABGRU ,
ld_e_oic_oland1  TYPE OIC_PIPE-OIC_OLAND1 ,
ld_i_vend  TYPE EKKO-LIFNR ,
ld_e_oic_oregio  TYPE OIC_PIPE-OIC_OREGIO ,
ld_i_rec_werks  TYPE EKPO-WERKS ,
ld_e_oic_ocounc  TYPE OIC_PIPE-OIC_OCOUNC ,
ld_e_oic_ocityc  TYPE OIC_PIPE-OIC_OCITYC ,
ld_e_oic_dland1  TYPE OIC_PIPE-OIC_DLAND1 .


SELECT single WERKS
FROM VBAP
INTO ld_i_werks.


SELECT single KUNNR
FROM VBPA
INTO ld_i_ship_to.


SELECT single ABGRU
FROM EKKO
INTO ld_i_po_so.


SELECT single LIFNR
FROM EKKO
INTO ld_i_vend.


SELECT single WERKS
FROM EKPO
INTO ld_i_rec_werks.

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