SAP Function Modules

WS_LM_DATA_SELECTION SAP Function module







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

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


Pattern for FM WS_LM_DATA_SELECTION - WS LM DATA SELECTION





CALL FUNCTION 'WS_LM_DATA_SELECTION' "
* EXPORTING
*   if_proctype = SPACE         " char1         Processing Type
*   if_flag_inbound = SPACE     " char1
*   if_parvw = SPACE            " vbpa-parvw
*   if_item_add = SPACE         " char1
*   if_anzpos = SPACE           " mv50l_anzpos  Indicator: Determine Number of Delivery Items
*   if_spdnr_add = SPACE        " char1
*   if_flag_wm = SPACE          " char1
*   if_flag_fix = SPACE         " char1
*   if_refnum_add = SPACE       " char1
*   if_lgnum_head = SPACE       " char1
*   if_ref_gewei = SPACE        " lipov-gewei
*   if_ref_voleh = SPACE        " lipov-voleh
*   if_uncha = SPACE            " mv50l-uncha
*   if_no_additional_data = SPACE  " xfeld
*   if_select_code = SPACE      " /spe/ret_mon_sel_code
  TABLES
*   it_vstel =                  " range_c4
*   it_route =                  " range_c6
*   it_aulwe =                  " range_c10
*   it_spdnr =                  " range_c10
*   it_kunag =                  " range_c10
*   it_kunwe =                  " range_c10
*   it_partn =                  " range_c10
*   it_vkorg =                  " range_c4
*   it_kdgrp =                  " range_c2
*   it_matnr =                  " range_mat
*   it_wadat =                  " range_date
*   it_wadat_ist =              " range_date
*   it_lddat =                  " range_date
*   it_tddat =                  " range_date
*   it_lfdat =                  " range_date
*   it_kodat =                  " range_date
*   it_sammg =                  " range_c10
*   it_tknum =                  " range_c10
*   it_lfart =                  " range_c4
*   it_vbeln =                  " range_c10
*   it_lstel =                  " range_c2
*   it_lgnum =                  " range_c3
*   it_lgort =                  " range_c4
*   it_lgtor =                  " range_c3
*   it_ablad =                  " range_c25
*   it_vsbed =                  " range_c2
*   it_lprio =                  " range_n2
*   it_kostk =                  " range_stat
*   it_wbstk =                  " range_stat
*   it_fkstk =                  " range_stat
*   it_koquk =                  " range_stat
*   it_lvstk =                  " range_stat
*   it_trsta =                  " range_stat
*   it_pkstk =                  " range_stat
*   it_bestk =                  " range_stat
*   it_ernam =                  " range_c12
*   it_erdat =                  " range_date
*   it_vtweg =                  " range_c2
*   it_spart =                  " range_c2
*   it_ebeln =                  " range_ebeln
*   it_ebelp =                  " range_c5
*   it_traid =                  " range_c20
*   it_exidv =                  " range_c20
*   it_lifex =                  " range_c35
*   it_lifnr =                  " range_c10
*   it_kdmat =                  " range_c35
*   it_ean11 =                  " range_c18
*   it_charg =                  " range_c10
*   it_prvbe =                  " range_c10
*   it_aufnr =                  " range_c12
*   it_lgbzo_h =                " range_c10
*   it_xblnr =                  " range_c25
*   it_tragr_h =                " range_c4
*   it_abeln =                  " range_c10
*   it_vgsys =                  " range_c10
*   it_vlstk =                  " range_stat
*   it_bwlvs =                  " range_n3
*   it_werks =                  " range_c4
*   it_imwrk =                  " range_c1
*   it_lduhr =                  " range_tims
*   it_wauhr =                  " range_tims
*   it_lfuhr =                  " range_tims
*   it_vgbel =                  " range_c10
*   it_vgpos =                  " range_n6
*   it_rmano =                  " /spe/range_rma
*   it_exexd =                  " /spe/ret_exp_tms_ext_range
*   it_inexd =                  " /spe/ret_exp_tms_int_range
    ct_postab =                 " lipov         View: Header and Item Delivery Information
*   ct_postab_kodat =           " lipov_kodat
*   it_rstnr =                  " range_c10
*   it_cronr =                  " range_c10
*   it_rmavd =                  " range_c20
  EXCEPTIONS
    NO_DATA_FOUND = 1           "
    WRONG_PROC_TYPE = 2         "
    .  "  WS_LM_DATA_SELECTION

ABAP code example for Function Module WS_LM_DATA_SELECTION





The ABAP code below is a full code listing to execute function module WS_LM_DATA_SELECTION 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_it_vstel  TYPE STANDARD TABLE OF RANGE_C4,"TABLES PARAM
wa_it_vstel  LIKE LINE OF it_it_vstel ,
it_it_route  TYPE STANDARD TABLE OF RANGE_C6,"TABLES PARAM
wa_it_route  LIKE LINE OF it_it_route ,
it_it_aulwe  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_aulwe  LIKE LINE OF it_it_aulwe ,
it_it_spdnr  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_spdnr  LIKE LINE OF it_it_spdnr ,
it_it_kunag  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_kunag  LIKE LINE OF it_it_kunag ,
it_it_kunwe  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_kunwe  LIKE LINE OF it_it_kunwe ,
it_it_partn  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_partn  LIKE LINE OF it_it_partn ,
it_it_vkorg  TYPE STANDARD TABLE OF RANGE_C4,"TABLES PARAM
wa_it_vkorg  LIKE LINE OF it_it_vkorg ,
it_it_kdgrp  TYPE STANDARD TABLE OF RANGE_C2,"TABLES PARAM
wa_it_kdgrp  LIKE LINE OF it_it_kdgrp ,
it_it_matnr  TYPE STANDARD TABLE OF RANGE_MAT,"TABLES PARAM
wa_it_matnr  LIKE LINE OF it_it_matnr ,
it_it_wadat  TYPE STANDARD TABLE OF RANGE_DATE,"TABLES PARAM
wa_it_wadat  LIKE LINE OF it_it_wadat ,
it_it_wadat_ist  TYPE STANDARD TABLE OF RANGE_DATE,"TABLES PARAM
wa_it_wadat_ist  LIKE LINE OF it_it_wadat_ist ,
it_it_lddat  TYPE STANDARD TABLE OF RANGE_DATE,"TABLES PARAM
wa_it_lddat  LIKE LINE OF it_it_lddat ,
it_it_tddat  TYPE STANDARD TABLE OF RANGE_DATE,"TABLES PARAM
wa_it_tddat  LIKE LINE OF it_it_tddat ,
it_it_lfdat  TYPE STANDARD TABLE OF RANGE_DATE,"TABLES PARAM
wa_it_lfdat  LIKE LINE OF it_it_lfdat ,
it_it_kodat  TYPE STANDARD TABLE OF RANGE_DATE,"TABLES PARAM
wa_it_kodat  LIKE LINE OF it_it_kodat ,
it_it_sammg  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_sammg  LIKE LINE OF it_it_sammg ,
it_it_tknum  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_tknum  LIKE LINE OF it_it_tknum ,
it_it_lfart  TYPE STANDARD TABLE OF RANGE_C4,"TABLES PARAM
wa_it_lfart  LIKE LINE OF it_it_lfart ,
it_it_vbeln  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_vbeln  LIKE LINE OF it_it_vbeln ,
it_it_lstel  TYPE STANDARD TABLE OF RANGE_C2,"TABLES PARAM
wa_it_lstel  LIKE LINE OF it_it_lstel ,
it_it_lgnum  TYPE STANDARD TABLE OF RANGE_C3,"TABLES PARAM
wa_it_lgnum  LIKE LINE OF it_it_lgnum ,
it_it_lgort  TYPE STANDARD TABLE OF RANGE_C4,"TABLES PARAM
wa_it_lgort  LIKE LINE OF it_it_lgort ,
it_it_lgtor  TYPE STANDARD TABLE OF RANGE_C3,"TABLES PARAM
wa_it_lgtor  LIKE LINE OF it_it_lgtor ,
it_it_ablad  TYPE STANDARD TABLE OF RANGE_C25,"TABLES PARAM
wa_it_ablad  LIKE LINE OF it_it_ablad ,
it_it_vsbed  TYPE STANDARD TABLE OF RANGE_C2,"TABLES PARAM
wa_it_vsbed  LIKE LINE OF it_it_vsbed ,
it_it_lprio  TYPE STANDARD TABLE OF RANGE_N2,"TABLES PARAM
wa_it_lprio  LIKE LINE OF it_it_lprio ,
it_it_kostk  TYPE STANDARD TABLE OF RANGE_STAT,"TABLES PARAM
wa_it_kostk  LIKE LINE OF it_it_kostk ,
it_it_wbstk  TYPE STANDARD TABLE OF RANGE_STAT,"TABLES PARAM
wa_it_wbstk  LIKE LINE OF it_it_wbstk ,
it_it_fkstk  TYPE STANDARD TABLE OF RANGE_STAT,"TABLES PARAM
wa_it_fkstk  LIKE LINE OF it_it_fkstk ,
it_it_koquk  TYPE STANDARD TABLE OF RANGE_STAT,"TABLES PARAM
wa_it_koquk  LIKE LINE OF it_it_koquk ,
it_it_lvstk  TYPE STANDARD TABLE OF RANGE_STAT,"TABLES PARAM
wa_it_lvstk  LIKE LINE OF it_it_lvstk ,
it_it_trsta  TYPE STANDARD TABLE OF RANGE_STAT,"TABLES PARAM
wa_it_trsta  LIKE LINE OF it_it_trsta ,
it_it_pkstk  TYPE STANDARD TABLE OF RANGE_STAT,"TABLES PARAM
wa_it_pkstk  LIKE LINE OF it_it_pkstk ,
it_it_bestk  TYPE STANDARD TABLE OF RANGE_STAT,"TABLES PARAM
wa_it_bestk  LIKE LINE OF it_it_bestk ,
it_it_ernam  TYPE STANDARD TABLE OF RANGE_C12,"TABLES PARAM
wa_it_ernam  LIKE LINE OF it_it_ernam ,
it_it_erdat  TYPE STANDARD TABLE OF RANGE_DATE,"TABLES PARAM
wa_it_erdat  LIKE LINE OF it_it_erdat ,
it_it_vtweg  TYPE STANDARD TABLE OF RANGE_C2,"TABLES PARAM
wa_it_vtweg  LIKE LINE OF it_it_vtweg ,
it_it_spart  TYPE STANDARD TABLE OF RANGE_C2,"TABLES PARAM
wa_it_spart  LIKE LINE OF it_it_spart ,
it_it_ebeln  TYPE STANDARD TABLE OF RANGE_EBELN,"TABLES PARAM
wa_it_ebeln  LIKE LINE OF it_it_ebeln ,
it_it_ebelp  TYPE STANDARD TABLE OF RANGE_C5,"TABLES PARAM
wa_it_ebelp  LIKE LINE OF it_it_ebelp ,
it_it_traid  TYPE STANDARD TABLE OF RANGE_C20,"TABLES PARAM
wa_it_traid  LIKE LINE OF it_it_traid ,
it_it_exidv  TYPE STANDARD TABLE OF RANGE_C20,"TABLES PARAM
wa_it_exidv  LIKE LINE OF it_it_exidv ,
it_it_lifex  TYPE STANDARD TABLE OF RANGE_C35,"TABLES PARAM
wa_it_lifex  LIKE LINE OF it_it_lifex ,
it_it_lifnr  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_lifnr  LIKE LINE OF it_it_lifnr ,
it_it_kdmat  TYPE STANDARD TABLE OF RANGE_C35,"TABLES PARAM
wa_it_kdmat  LIKE LINE OF it_it_kdmat ,
it_it_ean11  TYPE STANDARD TABLE OF RANGE_C18,"TABLES PARAM
wa_it_ean11  LIKE LINE OF it_it_ean11 ,
it_it_charg  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_charg  LIKE LINE OF it_it_charg ,
it_it_prvbe  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_prvbe  LIKE LINE OF it_it_prvbe ,
it_it_aufnr  TYPE STANDARD TABLE OF RANGE_C12,"TABLES PARAM
wa_it_aufnr  LIKE LINE OF it_it_aufnr ,
it_it_lgbzo_h  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_lgbzo_h  LIKE LINE OF it_it_lgbzo_h ,
it_it_xblnr  TYPE STANDARD TABLE OF RANGE_C25,"TABLES PARAM
wa_it_xblnr  LIKE LINE OF it_it_xblnr ,
it_it_tragr_h  TYPE STANDARD TABLE OF RANGE_C4,"TABLES PARAM
wa_it_tragr_h  LIKE LINE OF it_it_tragr_h ,
it_it_abeln  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_abeln  LIKE LINE OF it_it_abeln ,
it_it_vgsys  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_vgsys  LIKE LINE OF it_it_vgsys ,
it_it_vlstk  TYPE STANDARD TABLE OF RANGE_STAT,"TABLES PARAM
wa_it_vlstk  LIKE LINE OF it_it_vlstk ,
it_it_bwlvs  TYPE STANDARD TABLE OF RANGE_N3,"TABLES PARAM
wa_it_bwlvs  LIKE LINE OF it_it_bwlvs ,
it_it_werks  TYPE STANDARD TABLE OF RANGE_C4,"TABLES PARAM
wa_it_werks  LIKE LINE OF it_it_werks ,
it_it_imwrk  TYPE STANDARD TABLE OF RANGE_C1,"TABLES PARAM
wa_it_imwrk  LIKE LINE OF it_it_imwrk ,
it_it_lduhr  TYPE STANDARD TABLE OF RANGE_TIMS,"TABLES PARAM
wa_it_lduhr  LIKE LINE OF it_it_lduhr ,
it_it_wauhr  TYPE STANDARD TABLE OF RANGE_TIMS,"TABLES PARAM
wa_it_wauhr  LIKE LINE OF it_it_wauhr ,
it_it_lfuhr  TYPE STANDARD TABLE OF RANGE_TIMS,"TABLES PARAM
wa_it_lfuhr  LIKE LINE OF it_it_lfuhr ,
it_it_vgbel  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_vgbel  LIKE LINE OF it_it_vgbel ,
it_it_vgpos  TYPE STANDARD TABLE OF RANGE_N6,"TABLES PARAM
wa_it_vgpos  LIKE LINE OF it_it_vgpos ,
it_it_rmano  TYPE STANDARD TABLE OF /SPE/RANGE_RMA,"TABLES PARAM
wa_it_rmano  LIKE LINE OF it_it_rmano ,
it_it_exexd  TYPE STANDARD TABLE OF /SPE/RET_EXP_TMS_EXT_RANGE,"TABLES PARAM
wa_it_exexd  LIKE LINE OF it_it_exexd ,
it_it_inexd  TYPE STANDARD TABLE OF /SPE/RET_EXP_TMS_INT_RANGE,"TABLES PARAM
wa_it_inexd  LIKE LINE OF it_it_inexd ,
it_ct_postab  TYPE STANDARD TABLE OF LIPOV,"TABLES PARAM
wa_ct_postab  LIKE LINE OF it_ct_postab ,
it_ct_postab_kodat  TYPE STANDARD TABLE OF LIPOV_KODAT,"TABLES PARAM
wa_ct_postab_kodat  LIKE LINE OF it_ct_postab_kodat ,
it_it_rstnr  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_rstnr  LIKE LINE OF it_it_rstnr ,
it_it_cronr  TYPE STANDARD TABLE OF RANGE_C10,"TABLES PARAM
wa_it_cronr  LIKE LINE OF it_it_cronr ,
it_it_rmavd  TYPE STANDARD TABLE OF RANGE_C20,"TABLES PARAM
wa_it_rmavd  LIKE LINE OF it_it_rmavd .

DATA(ld_if_proctype) = 'Check type of data required'.
DATA(ld_if_flag_inbound) = 'Check type of data required'.

SELECT single PARVW
FROM VBPA
INTO @DATA(ld_if_parvw).

DATA(ld_if_item_add) = 'Check type of data required'.
DATA(ld_if_anzpos) = 'Check type of data required'.
DATA(ld_if_spdnr_add) = 'Check type of data required'.
DATA(ld_if_flag_wm) = 'Check type of data required'.
DATA(ld_if_flag_fix) = 'Check type of data required'.
DATA(ld_if_refnum_add) = 'Check type of data required'.
DATA(ld_if_lgnum_head) = 'Check type of data required'.

DATA(ld_if_ref_gewei) = Check type of data required

DATA(ld_if_ref_voleh) = Check type of data required

DATA(ld_if_uncha) = some text here
DATA(ld_if_no_additional_data) = 'Check type of data required'.
DATA(ld_if_select_code) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_vstel to it_it_vstel.

"populate fields of struture and append to itab
append wa_it_route to it_it_route.

"populate fields of struture and append to itab
append wa_it_aulwe to it_it_aulwe.

"populate fields of struture and append to itab
append wa_it_spdnr to it_it_spdnr.

"populate fields of struture and append to itab
append wa_it_kunag to it_it_kunag.

"populate fields of struture and append to itab
append wa_it_kunwe to it_it_kunwe.

"populate fields of struture and append to itab
append wa_it_partn to it_it_partn.

"populate fields of struture and append to itab
append wa_it_vkorg to it_it_vkorg.

"populate fields of struture and append to itab
append wa_it_kdgrp to it_it_kdgrp.

"populate fields of struture and append to itab
append wa_it_matnr to it_it_matnr.

"populate fields of struture and append to itab
append wa_it_wadat to it_it_wadat.

"populate fields of struture and append to itab
append wa_it_wadat_ist to it_it_wadat_ist.

"populate fields of struture and append to itab
append wa_it_lddat to it_it_lddat.

"populate fields of struture and append to itab
append wa_it_tddat to it_it_tddat.

"populate fields of struture and append to itab
append wa_it_lfdat to it_it_lfdat.

"populate fields of struture and append to itab
append wa_it_kodat to it_it_kodat.

"populate fields of struture and append to itab
append wa_it_sammg to it_it_sammg.

"populate fields of struture and append to itab
append wa_it_tknum to it_it_tknum.

"populate fields of struture and append to itab
append wa_it_lfart to it_it_lfart.

"populate fields of struture and append to itab
append wa_it_vbeln to it_it_vbeln.

"populate fields of struture and append to itab
append wa_it_lstel to it_it_lstel.

"populate fields of struture and append to itab
append wa_it_lgnum to it_it_lgnum.

"populate fields of struture and append to itab
append wa_it_lgort to it_it_lgort.

"populate fields of struture and append to itab
append wa_it_lgtor to it_it_lgtor.

"populate fields of struture and append to itab
append wa_it_ablad to it_it_ablad.

"populate fields of struture and append to itab
append wa_it_vsbed to it_it_vsbed.

"populate fields of struture and append to itab
append wa_it_lprio to it_it_lprio.

"populate fields of struture and append to itab
append wa_it_kostk to it_it_kostk.

"populate fields of struture and append to itab
append wa_it_wbstk to it_it_wbstk.

"populate fields of struture and append to itab
append wa_it_fkstk to it_it_fkstk.

"populate fields of struture and append to itab
append wa_it_koquk to it_it_koquk.

"populate fields of struture and append to itab
append wa_it_lvstk to it_it_lvstk.

"populate fields of struture and append to itab
append wa_it_trsta to it_it_trsta.

"populate fields of struture and append to itab
append wa_it_pkstk to it_it_pkstk.

"populate fields of struture and append to itab
append wa_it_bestk to it_it_bestk.

"populate fields of struture and append to itab
append wa_it_ernam to it_it_ernam.

"populate fields of struture and append to itab
append wa_it_erdat to it_it_erdat.

"populate fields of struture and append to itab
append wa_it_vtweg to it_it_vtweg.

"populate fields of struture and append to itab
append wa_it_spart to it_it_spart.

"populate fields of struture and append to itab
append wa_it_ebeln to it_it_ebeln.

"populate fields of struture and append to itab
append wa_it_ebelp to it_it_ebelp.

"populate fields of struture and append to itab
append wa_it_traid to it_it_traid.

"populate fields of struture and append to itab
append wa_it_exidv to it_it_exidv.

"populate fields of struture and append to itab
append wa_it_lifex to it_it_lifex.

"populate fields of struture and append to itab
append wa_it_lifnr to it_it_lifnr.

"populate fields of struture and append to itab
append wa_it_kdmat to it_it_kdmat.

"populate fields of struture and append to itab
append wa_it_ean11 to it_it_ean11.

"populate fields of struture and append to itab
append wa_it_charg to it_it_charg.

"populate fields of struture and append to itab
append wa_it_prvbe to it_it_prvbe.

"populate fields of struture and append to itab
append wa_it_aufnr to it_it_aufnr.

"populate fields of struture and append to itab
append wa_it_lgbzo_h to it_it_lgbzo_h.

"populate fields of struture and append to itab
append wa_it_xblnr to it_it_xblnr.

"populate fields of struture and append to itab
append wa_it_tragr_h to it_it_tragr_h.

"populate fields of struture and append to itab
append wa_it_abeln to it_it_abeln.

"populate fields of struture and append to itab
append wa_it_vgsys to it_it_vgsys.

"populate fields of struture and append to itab
append wa_it_vlstk to it_it_vlstk.

"populate fields of struture and append to itab
append wa_it_bwlvs to it_it_bwlvs.

"populate fields of struture and append to itab
append wa_it_werks to it_it_werks.

"populate fields of struture and append to itab
append wa_it_imwrk to it_it_imwrk.

"populate fields of struture and append to itab
append wa_it_lduhr to it_it_lduhr.

"populate fields of struture and append to itab
append wa_it_wauhr to it_it_wauhr.

"populate fields of struture and append to itab
append wa_it_lfuhr to it_it_lfuhr.

"populate fields of struture and append to itab
append wa_it_vgbel to it_it_vgbel.

"populate fields of struture and append to itab
append wa_it_vgpos to it_it_vgpos.

"populate fields of struture and append to itab
append wa_it_rmano to it_it_rmano.

"populate fields of struture and append to itab
append wa_it_exexd to it_it_exexd.

"populate fields of struture and append to itab
append wa_it_inexd to it_it_inexd.

"populate fields of struture and append to itab
append wa_ct_postab to it_ct_postab.

"populate fields of struture and append to itab
append wa_ct_postab_kodat to it_ct_postab_kodat.

"populate fields of struture and append to itab
append wa_it_rstnr to it_it_rstnr.

"populate fields of struture and append to itab
append wa_it_cronr to it_it_cronr.

"populate fields of struture and append to itab
append wa_it_rmavd to it_it_rmavd. . CALL FUNCTION 'WS_LM_DATA_SELECTION' * EXPORTING * if_proctype = ld_if_proctype * if_flag_inbound = ld_if_flag_inbound * if_parvw = ld_if_parvw * if_item_add = ld_if_item_add * if_anzpos = ld_if_anzpos * if_spdnr_add = ld_if_spdnr_add * if_flag_wm = ld_if_flag_wm * if_flag_fix = ld_if_flag_fix * if_refnum_add = ld_if_refnum_add * if_lgnum_head = ld_if_lgnum_head * if_ref_gewei = ld_if_ref_gewei * if_ref_voleh = ld_if_ref_voleh * if_uncha = ld_if_uncha * if_no_additional_data = ld_if_no_additional_data * if_select_code = ld_if_select_code TABLES * it_vstel = it_it_vstel * it_route = it_it_route * it_aulwe = it_it_aulwe * it_spdnr = it_it_spdnr * it_kunag = it_it_kunag * it_kunwe = it_it_kunwe * it_partn = it_it_partn * it_vkorg = it_it_vkorg * it_kdgrp = it_it_kdgrp * it_matnr = it_it_matnr * it_wadat = it_it_wadat * it_wadat_ist = it_it_wadat_ist * it_lddat = it_it_lddat * it_tddat = it_it_tddat * it_lfdat = it_it_lfdat * it_kodat = it_it_kodat * it_sammg = it_it_sammg * it_tknum = it_it_tknum * it_lfart = it_it_lfart * it_vbeln = it_it_vbeln * it_lstel = it_it_lstel * it_lgnum = it_it_lgnum * it_lgort = it_it_lgort * it_lgtor = it_it_lgtor * it_ablad = it_it_ablad * it_vsbed = it_it_vsbed * it_lprio = it_it_lprio * it_kostk = it_it_kostk * it_wbstk = it_it_wbstk * it_fkstk = it_it_fkstk * it_koquk = it_it_koquk * it_lvstk = it_it_lvstk * it_trsta = it_it_trsta * it_pkstk = it_it_pkstk * it_bestk = it_it_bestk * it_ernam = it_it_ernam * it_erdat = it_it_erdat * it_vtweg = it_it_vtweg * it_spart = it_it_spart * it_ebeln = it_it_ebeln * it_ebelp = it_it_ebelp * it_traid = it_it_traid * it_exidv = it_it_exidv * it_lifex = it_it_lifex * it_lifnr = it_it_lifnr * it_kdmat = it_it_kdmat * it_ean11 = it_it_ean11 * it_charg = it_it_charg * it_prvbe = it_it_prvbe * it_aufnr = it_it_aufnr * it_lgbzo_h = it_it_lgbzo_h * it_xblnr = it_it_xblnr * it_tragr_h = it_it_tragr_h * it_abeln = it_it_abeln * it_vgsys = it_it_vgsys * it_vlstk = it_it_vlstk * it_bwlvs = it_it_bwlvs * it_werks = it_it_werks * it_imwrk = it_it_imwrk * it_lduhr = it_it_lduhr * it_wauhr = it_it_wauhr * it_lfuhr = it_it_lfuhr * it_vgbel = it_it_vgbel * it_vgpos = it_it_vgpos * it_rmano = it_it_rmano * it_exexd = it_it_exexd * it_inexd = it_it_inexd ct_postab = it_ct_postab * ct_postab_kodat = it_ct_postab_kodat * it_rstnr = it_it_rstnr * it_cronr = it_it_cronr * it_rmavd = it_it_rmavd EXCEPTIONS NO_DATA_FOUND = 1 WRONG_PROC_TYPE = 2 . " WS_LM_DATA_SELECTION
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 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_if_proctype  TYPE CHAR1 ,
it_it_vstel  TYPE STANDARD TABLE OF RANGE_C4 ,
wa_it_vstel  LIKE LINE OF it_it_vstel,
ld_if_flag_inbound  TYPE CHAR1 ,
it_it_route  TYPE STANDARD TABLE OF RANGE_C6 ,
wa_it_route  LIKE LINE OF it_it_route,
ld_if_parvw  TYPE VBPA-PARVW ,
it_it_aulwe  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_aulwe  LIKE LINE OF it_it_aulwe,
ld_if_item_add  TYPE CHAR1 ,
it_it_spdnr  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_spdnr  LIKE LINE OF it_it_spdnr,
ld_if_anzpos  TYPE MV50L_ANZPOS ,
it_it_kunag  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_kunag  LIKE LINE OF it_it_kunag,
ld_if_spdnr_add  TYPE CHAR1 ,
it_it_kunwe  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_kunwe  LIKE LINE OF it_it_kunwe,
ld_if_flag_wm  TYPE CHAR1 ,
it_it_partn  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_partn  LIKE LINE OF it_it_partn,
it_it_vkorg  TYPE STANDARD TABLE OF RANGE_C4 ,
wa_it_vkorg  LIKE LINE OF it_it_vkorg,
ld_if_flag_fix  TYPE CHAR1 ,
it_it_kdgrp  TYPE STANDARD TABLE OF RANGE_C2 ,
wa_it_kdgrp  LIKE LINE OF it_it_kdgrp,
ld_if_refnum_add  TYPE CHAR1 ,
ld_if_lgnum_head  TYPE CHAR1 ,
it_it_matnr  TYPE STANDARD TABLE OF RANGE_MAT ,
wa_it_matnr  LIKE LINE OF it_it_matnr,
ld_if_ref_gewei  TYPE LIPOV-GEWEI ,
it_it_wadat  TYPE STANDARD TABLE OF RANGE_DATE ,
wa_it_wadat  LIKE LINE OF it_it_wadat,
ld_if_ref_voleh  TYPE LIPOV-VOLEH ,
it_it_wadat_ist  TYPE STANDARD TABLE OF RANGE_DATE ,
wa_it_wadat_ist  LIKE LINE OF it_it_wadat_ist,
ld_if_uncha  TYPE MV50L-UNCHA ,
it_it_lddat  TYPE STANDARD TABLE OF RANGE_DATE ,
wa_it_lddat  LIKE LINE OF it_it_lddat,
ld_if_no_additional_data  TYPE XFELD ,
it_it_tddat  TYPE STANDARD TABLE OF RANGE_DATE ,
wa_it_tddat  LIKE LINE OF it_it_tddat,
ld_if_select_code  TYPE /SPE/RET_MON_SEL_CODE ,
it_it_lfdat  TYPE STANDARD TABLE OF RANGE_DATE ,
wa_it_lfdat  LIKE LINE OF it_it_lfdat,
it_it_kodat  TYPE STANDARD TABLE OF RANGE_DATE ,
wa_it_kodat  LIKE LINE OF it_it_kodat,
it_it_sammg  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_sammg  LIKE LINE OF it_it_sammg,
it_it_tknum  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_tknum  LIKE LINE OF it_it_tknum,
it_it_lfart  TYPE STANDARD TABLE OF RANGE_C4 ,
wa_it_lfart  LIKE LINE OF it_it_lfart,
it_it_vbeln  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_vbeln  LIKE LINE OF it_it_vbeln,
it_it_lstel  TYPE STANDARD TABLE OF RANGE_C2 ,
wa_it_lstel  LIKE LINE OF it_it_lstel,
it_it_lgnum  TYPE STANDARD TABLE OF RANGE_C3 ,
wa_it_lgnum  LIKE LINE OF it_it_lgnum,
it_it_lgort  TYPE STANDARD TABLE OF RANGE_C4 ,
wa_it_lgort  LIKE LINE OF it_it_lgort,
it_it_lgtor  TYPE STANDARD TABLE OF RANGE_C3 ,
wa_it_lgtor  LIKE LINE OF it_it_lgtor,
it_it_ablad  TYPE STANDARD TABLE OF RANGE_C25 ,
wa_it_ablad  LIKE LINE OF it_it_ablad,
it_it_vsbed  TYPE STANDARD TABLE OF RANGE_C2 ,
wa_it_vsbed  LIKE LINE OF it_it_vsbed,
it_it_lprio  TYPE STANDARD TABLE OF RANGE_N2 ,
wa_it_lprio  LIKE LINE OF it_it_lprio,
it_it_kostk  TYPE STANDARD TABLE OF RANGE_STAT ,
wa_it_kostk  LIKE LINE OF it_it_kostk,
it_it_wbstk  TYPE STANDARD TABLE OF RANGE_STAT ,
wa_it_wbstk  LIKE LINE OF it_it_wbstk,
it_it_fkstk  TYPE STANDARD TABLE OF RANGE_STAT ,
wa_it_fkstk  LIKE LINE OF it_it_fkstk,
it_it_koquk  TYPE STANDARD TABLE OF RANGE_STAT ,
wa_it_koquk  LIKE LINE OF it_it_koquk,
it_it_lvstk  TYPE STANDARD TABLE OF RANGE_STAT ,
wa_it_lvstk  LIKE LINE OF it_it_lvstk,
it_it_trsta  TYPE STANDARD TABLE OF RANGE_STAT ,
wa_it_trsta  LIKE LINE OF it_it_trsta,
it_it_pkstk  TYPE STANDARD TABLE OF RANGE_STAT ,
wa_it_pkstk  LIKE LINE OF it_it_pkstk,
it_it_bestk  TYPE STANDARD TABLE OF RANGE_STAT ,
wa_it_bestk  LIKE LINE OF it_it_bestk,
it_it_ernam  TYPE STANDARD TABLE OF RANGE_C12 ,
wa_it_ernam  LIKE LINE OF it_it_ernam,
it_it_erdat  TYPE STANDARD TABLE OF RANGE_DATE ,
wa_it_erdat  LIKE LINE OF it_it_erdat,
it_it_vtweg  TYPE STANDARD TABLE OF RANGE_C2 ,
wa_it_vtweg  LIKE LINE OF it_it_vtweg,
it_it_spart  TYPE STANDARD TABLE OF RANGE_C2 ,
wa_it_spart  LIKE LINE OF it_it_spart,
it_it_ebeln  TYPE STANDARD TABLE OF RANGE_EBELN ,
wa_it_ebeln  LIKE LINE OF it_it_ebeln,
it_it_ebelp  TYPE STANDARD TABLE OF RANGE_C5 ,
wa_it_ebelp  LIKE LINE OF it_it_ebelp,
it_it_traid  TYPE STANDARD TABLE OF RANGE_C20 ,
wa_it_traid  LIKE LINE OF it_it_traid,
it_it_exidv  TYPE STANDARD TABLE OF RANGE_C20 ,
wa_it_exidv  LIKE LINE OF it_it_exidv,
it_it_lifex  TYPE STANDARD TABLE OF RANGE_C35 ,
wa_it_lifex  LIKE LINE OF it_it_lifex,
it_it_lifnr  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_lifnr  LIKE LINE OF it_it_lifnr,
it_it_kdmat  TYPE STANDARD TABLE OF RANGE_C35 ,
wa_it_kdmat  LIKE LINE OF it_it_kdmat,
it_it_ean11  TYPE STANDARD TABLE OF RANGE_C18 ,
wa_it_ean11  LIKE LINE OF it_it_ean11,
it_it_charg  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_charg  LIKE LINE OF it_it_charg,
it_it_prvbe  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_prvbe  LIKE LINE OF it_it_prvbe,
it_it_aufnr  TYPE STANDARD TABLE OF RANGE_C12 ,
wa_it_aufnr  LIKE LINE OF it_it_aufnr,
it_it_lgbzo_h  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_lgbzo_h  LIKE LINE OF it_it_lgbzo_h,
it_it_xblnr  TYPE STANDARD TABLE OF RANGE_C25 ,
wa_it_xblnr  LIKE LINE OF it_it_xblnr,
it_it_tragr_h  TYPE STANDARD TABLE OF RANGE_C4 ,
wa_it_tragr_h  LIKE LINE OF it_it_tragr_h,
it_it_abeln  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_abeln  LIKE LINE OF it_it_abeln,
it_it_vgsys  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_vgsys  LIKE LINE OF it_it_vgsys,
it_it_vlstk  TYPE STANDARD TABLE OF RANGE_STAT ,
wa_it_vlstk  LIKE LINE OF it_it_vlstk,
it_it_bwlvs  TYPE STANDARD TABLE OF RANGE_N3 ,
wa_it_bwlvs  LIKE LINE OF it_it_bwlvs,
it_it_werks  TYPE STANDARD TABLE OF RANGE_C4 ,
wa_it_werks  LIKE LINE OF it_it_werks,
it_it_imwrk  TYPE STANDARD TABLE OF RANGE_C1 ,
wa_it_imwrk  LIKE LINE OF it_it_imwrk,
it_it_lduhr  TYPE STANDARD TABLE OF RANGE_TIMS ,
wa_it_lduhr  LIKE LINE OF it_it_lduhr,
it_it_wauhr  TYPE STANDARD TABLE OF RANGE_TIMS ,
wa_it_wauhr  LIKE LINE OF it_it_wauhr,
it_it_lfuhr  TYPE STANDARD TABLE OF RANGE_TIMS ,
wa_it_lfuhr  LIKE LINE OF it_it_lfuhr,
it_it_vgbel  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_vgbel  LIKE LINE OF it_it_vgbel,
it_it_vgpos  TYPE STANDARD TABLE OF RANGE_N6 ,
wa_it_vgpos  LIKE LINE OF it_it_vgpos,
it_it_rmano  TYPE STANDARD TABLE OF /SPE/RANGE_RMA ,
wa_it_rmano  LIKE LINE OF it_it_rmano,
it_it_exexd  TYPE STANDARD TABLE OF /SPE/RET_EXP_TMS_EXT_RANGE ,
wa_it_exexd  LIKE LINE OF it_it_exexd,
it_it_inexd  TYPE STANDARD TABLE OF /SPE/RET_EXP_TMS_INT_RANGE ,
wa_it_inexd  LIKE LINE OF it_it_inexd,
it_ct_postab  TYPE STANDARD TABLE OF LIPOV ,
wa_ct_postab  LIKE LINE OF it_ct_postab,
it_ct_postab_kodat  TYPE STANDARD TABLE OF LIPOV_KODAT ,
wa_ct_postab_kodat  LIKE LINE OF it_ct_postab_kodat,
it_it_rstnr  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_rstnr  LIKE LINE OF it_it_rstnr,
it_it_cronr  TYPE STANDARD TABLE OF RANGE_C10 ,
wa_it_cronr  LIKE LINE OF it_it_cronr,
it_it_rmavd  TYPE STANDARD TABLE OF RANGE_C20 ,
wa_it_rmavd  LIKE LINE OF it_it_rmavd.

ld_if_proctype = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_vstel to it_it_vstel.
ld_if_flag_inbound = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_route to it_it_route.

SELECT single PARVW
FROM VBPA
INTO ld_if_parvw.


"populate fields of struture and append to itab
append wa_it_aulwe to it_it_aulwe.
ld_if_item_add = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_spdnr to it_it_spdnr.
ld_if_anzpos = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_kunag to it_it_kunag.
ld_if_spdnr_add = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_kunwe to it_it_kunwe.
ld_if_flag_wm = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_partn to it_it_partn.

"populate fields of struture and append to itab
append wa_it_vkorg to it_it_vkorg.
ld_if_flag_fix = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_kdgrp to it_it_kdgrp.
ld_if_refnum_add = 'Check type of data required'.
ld_if_lgnum_head = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_matnr to it_it_matnr.

ld_if_ref_gewei = Check type of data required

"populate fields of struture and append to itab
append wa_it_wadat to it_it_wadat.

ld_if_ref_voleh = Check type of data required

"populate fields of struture and append to itab
append wa_it_wadat_ist to it_it_wadat_ist.

ld_if_uncha = some text here

"populate fields of struture and append to itab
append wa_it_lddat to it_it_lddat.
ld_if_no_additional_data = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_tddat to it_it_tddat.
ld_if_select_code = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_lfdat to it_it_lfdat.

"populate fields of struture and append to itab
append wa_it_kodat to it_it_kodat.

"populate fields of struture and append to itab
append wa_it_sammg to it_it_sammg.

"populate fields of struture and append to itab
append wa_it_tknum to it_it_tknum.

"populate fields of struture and append to itab
append wa_it_lfart to it_it_lfart.

"populate fields of struture and append to itab
append wa_it_vbeln to it_it_vbeln.

"populate fields of struture and append to itab
append wa_it_lstel to it_it_lstel.

"populate fields of struture and append to itab
append wa_it_lgnum to it_it_lgnum.

"populate fields of struture and append to itab
append wa_it_lgort to it_it_lgort.

"populate fields of struture and append to itab
append wa_it_lgtor to it_it_lgtor.

"populate fields of struture and append to itab
append wa_it_ablad to it_it_ablad.

"populate fields of struture and append to itab
append wa_it_vsbed to it_it_vsbed.

"populate fields of struture and append to itab
append wa_it_lprio to it_it_lprio.

"populate fields of struture and append to itab
append wa_it_kostk to it_it_kostk.

"populate fields of struture and append to itab
append wa_it_wbstk to it_it_wbstk.

"populate fields of struture and append to itab
append wa_it_fkstk to it_it_fkstk.

"populate fields of struture and append to itab
append wa_it_koquk to it_it_koquk.

"populate fields of struture and append to itab
append wa_it_lvstk to it_it_lvstk.

"populate fields of struture and append to itab
append wa_it_trsta to it_it_trsta.

"populate fields of struture and append to itab
append wa_it_pkstk to it_it_pkstk.

"populate fields of struture and append to itab
append wa_it_bestk to it_it_bestk.

"populate fields of struture and append to itab
append wa_it_ernam to it_it_ernam.

"populate fields of struture and append to itab
append wa_it_erdat to it_it_erdat.

"populate fields of struture and append to itab
append wa_it_vtweg to it_it_vtweg.

"populate fields of struture and append to itab
append wa_it_spart to it_it_spart.

"populate fields of struture and append to itab
append wa_it_ebeln to it_it_ebeln.

"populate fields of struture and append to itab
append wa_it_ebelp to it_it_ebelp.

"populate fields of struture and append to itab
append wa_it_traid to it_it_traid.

"populate fields of struture and append to itab
append wa_it_exidv to it_it_exidv.

"populate fields of struture and append to itab
append wa_it_lifex to it_it_lifex.

"populate fields of struture and append to itab
append wa_it_lifnr to it_it_lifnr.

"populate fields of struture and append to itab
append wa_it_kdmat to it_it_kdmat.

"populate fields of struture and append to itab
append wa_it_ean11 to it_it_ean11.

"populate fields of struture and append to itab
append wa_it_charg to it_it_charg.

"populate fields of struture and append to itab
append wa_it_prvbe to it_it_prvbe.

"populate fields of struture and append to itab
append wa_it_aufnr to it_it_aufnr.

"populate fields of struture and append to itab
append wa_it_lgbzo_h to it_it_lgbzo_h.

"populate fields of struture and append to itab
append wa_it_xblnr to it_it_xblnr.

"populate fields of struture and append to itab
append wa_it_tragr_h to it_it_tragr_h.

"populate fields of struture and append to itab
append wa_it_abeln to it_it_abeln.

"populate fields of struture and append to itab
append wa_it_vgsys to it_it_vgsys.

"populate fields of struture and append to itab
append wa_it_vlstk to it_it_vlstk.

"populate fields of struture and append to itab
append wa_it_bwlvs to it_it_bwlvs.

"populate fields of struture and append to itab
append wa_it_werks to it_it_werks.

"populate fields of struture and append to itab
append wa_it_imwrk to it_it_imwrk.

"populate fields of struture and append to itab
append wa_it_lduhr to it_it_lduhr.

"populate fields of struture and append to itab
append wa_it_wauhr to it_it_wauhr.

"populate fields of struture and append to itab
append wa_it_lfuhr to it_it_lfuhr.

"populate fields of struture and append to itab
append wa_it_vgbel to it_it_vgbel.

"populate fields of struture and append to itab
append wa_it_vgpos to it_it_vgpos.

"populate fields of struture and append to itab
append wa_it_rmano to it_it_rmano.

"populate fields of struture and append to itab
append wa_it_exexd to it_it_exexd.

"populate fields of struture and append to itab
append wa_it_inexd to it_it_inexd.

"populate fields of struture and append to itab
append wa_ct_postab to it_ct_postab.

"populate fields of struture and append to itab
append wa_ct_postab_kodat to it_ct_postab_kodat.

"populate fields of struture and append to itab
append wa_it_rstnr to it_it_rstnr.

"populate fields of struture and append to itab
append wa_it_cronr to it_it_cronr.

"populate fields of struture and append to itab
append wa_it_rmavd to it_it_rmavd.

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