SAP PK_CHECK_CONTAINER Function Module for Behaelterpruefung bei Statusänderung









PK_CHECK_CONTAINER is a standard pk check container SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Behaelterpruefung bei Statusänderung processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for pk check container FM, simply by entering the name PK_CHECK_CONTAINER into the relevant SAP transaction such as SE37 or SE38.

Function Group: MPKB
Program Name: SAPLMPKB
Main Program: SAPLMPKB
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function PK_CHECK_CONTAINER pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'PK_CHECK_CONTAINER'"Behaelterpruefung bei Statusänderung
EXPORTING
* AUFNR = ' ' "Auftragsnummer
* PABNUM = ' ' "Produktionsabrufsnummer
* PABPOS = ' ' "Produktionsabrufposition
* PKKEY = ' ' "Identifikationsnummer eines Kanbans
* XSTBW = ' ' "Stornobewegungsart
* AKTYP = ' ' "Aktivitätstyp in der Transaktion
* XSIMU_IV = ' ' "
* LGORT = "Lagerort
* MBLNR = "Nummer des Materialbelegs
* SHKZG = ' ' "Debit/Credit Indicator
* KZUML = ' ' "Stock transfer/transfer posting
* PLNUM = ' ' "Nummer des Planauftrags
* MATNR = "Materialnummer
* KBNKZ = ' ' "Art der Produktionsversorgung
* XBAPI_IV = "Indicates caller as BAPI
* VBELN_EWM = "Delivery
* VBELP_EWM = "Delivery Item
* RSNUM = ' ' "Nummer der Reservierung / des Sekundärbedarfs
* EBELN = ' ' "Belegnummer des Einkaufsbelegs
* EBELP = ' ' "Positionsnummer des Einkaufsbelegs
* PKNUM = ' ' "Regelkreisnummer
* PKPOS = ' ' "Kanbanpositionsnummer / Regelkreisposition
* LGNUM = ' ' "Lagernummer/Lagerkomplex
* TBNUM = ' ' "Transportbedarfsnummer

IMPORTING
KBNDR = "Feld zum Ankreuzen
E_EXIT_FLAG = "Feld zum Ankreuzen
WEMNG_KANBAN = "Goods Receipt Quantity

CHANGING
* CV_LGNUM = "Warehouse Number / Warehouse Complex
* CV_LGTYP = "Storage Type
* CV_LGPLA = "Storage Bin
* CV_UMLGT = "Storage type for stock transfer
* CV_UMLGP = "Storage bin for stock transfer
* CV_ELIKZ = "'Delivery Completed' Indicator

TABLES
MENGEN_CHARGEN = "Chargen und Mengen im Kanban
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLMPKB_001 DE-EN-LANG-SWITCH-NO-TRANSLATION

IMPORTING Parameters details for PK_CHECK_CONTAINER

AUFNR - Auftragsnummer

Data type: AFPO-AUFNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

PABNUM - Produktionsabrufsnummer

Data type: PKPS-PABNUM
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

PABPOS - Produktionsabrufposition

Data type: PKPS-PABPOS
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

PKKEY - Identifikationsnummer eines Kanbans

Data type: PKPS-PKKEY
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

XSTBW - Stornobewegungsart

Data type: DM07M-XSTBW
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

AKTYP - Aktivitätstyp in der Transaktion

Data type: T063-AKTYP
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

XSIMU_IV -

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

LGORT - Lagerort

Data type: EKPO-LGORT
Optional: Yes
Call by Reference: No ( called with pass by value option)

MBLNR - Nummer des Materialbelegs

Data type: PKPS-MBLNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

SHKZG - Debit/Credit Indicator

Data type: DM07M-RSHKZ
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

KZUML - Stock transfer/transfer posting

Data type: DM07M-KZUML
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

PLNUM - Nummer des Planauftrags

Data type: PLAF-PLNUM
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

MATNR - Materialnummer

Data type: EKPO-MATNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

KBNKZ - Art der Produktionsversorgung

Data type: EKPO-KANBA
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

XBAPI_IV - Indicates caller as BAPI

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

VBELN_EWM - Delivery

Data type: VBELN_VL
Optional: Yes
Call by Reference: No ( called with pass by value option)

VBELP_EWM - Delivery Item

Data type: POSNR_VL
Optional: Yes
Call by Reference: No ( called with pass by value option)

RSNUM - Nummer der Reservierung / des Sekundärbedarfs

Data type: RESB-RSNUM
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EBELN - Belegnummer des Einkaufsbelegs

Data type: EKPO-EBELN
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EBELP - Positionsnummer des Einkaufsbelegs

Data type: EKPO-EBELP
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

PKNUM - Regelkreisnummer

Data type: PKPS-PKNUM
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

PKPOS - Kanbanpositionsnummer / Regelkreisposition

Data type: PKPS-PKPOS
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

LGNUM - Lagernummer/Lagerkomplex

Data type: PKHD-LGNUM
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TBNUM - Transportbedarfsnummer

Data type: PKPS-TBNUM
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for PK_CHECK_CONTAINER

KBNDR - Feld zum Ankreuzen

Data type: AFPKB-FLG01
Optional: No
Call by Reference: No ( called with pass by value option)

E_EXIT_FLAG - Feld zum Ankreuzen

Data type: AFPKB-FLG01
Optional: No
Call by Reference: No ( called with pass by value option)

WEMNG_KANBAN - Goods Receipt Quantity

Data type: RFPKB-WEMNG
Optional: No
Call by Reference: No ( called with pass by value option)

CHANGING Parameters details for PK_CHECK_CONTAINER

CV_LGNUM - Warehouse Number / Warehouse Complex

Data type: PKHD-LGNUM
Optional: Yes
Call by Reference: Yes

CV_LGTYP - Storage Type

Data type: PKHD-LGTYP
Optional: Yes
Call by Reference: Yes

CV_LGPLA - Storage Bin

Data type: PKHD-LGPLA
Optional: Yes
Call by Reference: Yes

CV_UMLGT - Storage type for stock transfer

Data type: IMSEG-UMLGT
Optional: Yes
Call by Reference: Yes

CV_UMLGP - Storage bin for stock transfer

Data type: IMSEG-UMLGP
Optional: Yes
Call by Reference: Yes

CV_ELIKZ - 'Delivery Completed' Indicator

Data type: MSEG-ELIKZ
Optional: Yes
Call by Reference: Yes

TABLES Parameters details for PK_CHECK_CONTAINER

MENGEN_CHARGEN - Chargen und Mengen im Kanban

Data type: PKCH
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for PK_CHECK_CONTAINER Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_aufnr  TYPE AFPO-AUFNR, "   SPACE
lv_kbndr  TYPE AFPKB-FLG01, "   
lv_cv_lgnum  TYPE PKHD-LGNUM, "   
lt_mengen_chargen  TYPE STANDARD TABLE OF PKCH, "   
lv_pabnum  TYPE PKPS-PABNUM, "   SPACE
lv_pabpos  TYPE PKPS-PABPOS, "   SPACE
lv_pkkey  TYPE PKPS-PKKEY, "   SPACE
lv_xstbw  TYPE DM07M-XSTBW, "   SPACE
lv_aktyp  TYPE T063-AKTYP, "   SPACE
lv_xsimu_iv  TYPE C, "   SPACE
lv_lgort  TYPE EKPO-LGORT, "   
lv_mblnr  TYPE PKPS-MBLNR, "   
lv_shkzg  TYPE DM07M-RSHKZ, "   SPACE
lv_kzuml  TYPE DM07M-KZUML, "   SPACE
lv_plnum  TYPE PLAF-PLNUM, "   SPACE
lv_cv_lgtyp  TYPE PKHD-LGTYP, "   
lv_e_exit_flag  TYPE AFPKB-FLG01, "   
lv_matnr  TYPE EKPO-MATNR, "   
lv_kbnkz  TYPE EKPO-KANBA, "   SPACE
lv_xbapi_iv  TYPE C, "   
lv_vbeln_ewm  TYPE VBELN_VL, "   
lv_vbelp_ewm  TYPE POSNR_VL, "   
lv_rsnum  TYPE RESB-RSNUM, "   SPACE
lv_cv_lgpla  TYPE PKHD-LGPLA, "   
lv_wemng_kanban  TYPE RFPKB-WEMNG, "   
lv_ebeln  TYPE EKPO-EBELN, "   SPACE
lv_cv_umlgt  TYPE IMSEG-UMLGT, "   
lv_ebelp  TYPE EKPO-EBELP, "   SPACE
lv_cv_umlgp  TYPE IMSEG-UMLGP, "   
lv_pknum  TYPE PKPS-PKNUM, "   SPACE
lv_cv_elikz  TYPE MSEG-ELIKZ, "   
lv_pkpos  TYPE PKPS-PKPOS, "   SPACE
lv_lgnum  TYPE PKHD-LGNUM, "   SPACE
lv_tbnum  TYPE PKPS-TBNUM. "   SPACE

  CALL FUNCTION 'PK_CHECK_CONTAINER'  "Behaelterpruefung bei Statusänderung
    EXPORTING
         AUFNR = lv_aufnr
         PABNUM = lv_pabnum
         PABPOS = lv_pabpos
         PKKEY = lv_pkkey
         XSTBW = lv_xstbw
         AKTYP = lv_aktyp
         XSIMU_IV = lv_xsimu_iv
         LGORT = lv_lgort
         MBLNR = lv_mblnr
         SHKZG = lv_shkzg
         KZUML = lv_kzuml
         PLNUM = lv_plnum
         MATNR = lv_matnr
         KBNKZ = lv_kbnkz
         XBAPI_IV = lv_xbapi_iv
         VBELN_EWM = lv_vbeln_ewm
         VBELP_EWM = lv_vbelp_ewm
         RSNUM = lv_rsnum
         EBELN = lv_ebeln
         EBELP = lv_ebelp
         PKNUM = lv_pknum
         PKPOS = lv_pkpos
         LGNUM = lv_lgnum
         TBNUM = lv_tbnum
    IMPORTING
         KBNDR = lv_kbndr
         E_EXIT_FLAG = lv_e_exit_flag
         WEMNG_KANBAN = lv_wemng_kanban
    CHANGING
         CV_LGNUM = lv_cv_lgnum
         CV_LGTYP = lv_cv_lgtyp
         CV_LGPLA = lv_cv_lgpla
         CV_UMLGT = lv_cv_umlgt
         CV_UMLGP = lv_cv_umlgp
         CV_ELIKZ = lv_cv_elikz
    TABLES
         MENGEN_CHARGEN = lt_mengen_chargen
. " PK_CHECK_CONTAINER




ABAP code using 7.40 inline data declarations to call FM PK_CHECK_CONTAINER

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single AUFNR FROM AFPO INTO @DATA(ld_aufnr).
DATA(ld_aufnr) = ' '.
 
"SELECT single FLG01 FROM AFPKB INTO @DATA(ld_kbndr).
 
"SELECT single LGNUM FROM PKHD INTO @DATA(ld_cv_lgnum).
 
 
"SELECT single PABNUM FROM PKPS INTO @DATA(ld_pabnum).
DATA(ld_pabnum) = ' '.
 
"SELECT single PABPOS FROM PKPS INTO @DATA(ld_pabpos).
DATA(ld_pabpos) = ' '.
 
"SELECT single PKKEY FROM PKPS INTO @DATA(ld_pkkey).
DATA(ld_pkkey) = ' '.
 
"SELECT single XSTBW FROM DM07M INTO @DATA(ld_xstbw).
DATA(ld_xstbw) = ' '.
 
"SELECT single AKTYP FROM T063 INTO @DATA(ld_aktyp).
DATA(ld_aktyp) = ' '.
 
DATA(ld_xsimu_iv) = ' '.
 
"SELECT single LGORT FROM EKPO INTO @DATA(ld_lgort).
 
"SELECT single MBLNR FROM PKPS INTO @DATA(ld_mblnr).
 
"SELECT single RSHKZ FROM DM07M INTO @DATA(ld_shkzg).
DATA(ld_shkzg) = ' '.
 
"SELECT single KZUML FROM DM07M INTO @DATA(ld_kzuml).
DATA(ld_kzuml) = ' '.
 
"SELECT single PLNUM FROM PLAF INTO @DATA(ld_plnum).
DATA(ld_plnum) = ' '.
 
"SELECT single LGTYP FROM PKHD INTO @DATA(ld_cv_lgtyp).
 
"SELECT single FLG01 FROM AFPKB INTO @DATA(ld_e_exit_flag).
 
"SELECT single MATNR FROM EKPO INTO @DATA(ld_matnr).
 
"SELECT single KANBA FROM EKPO INTO @DATA(ld_kbnkz).
DATA(ld_kbnkz) = ' '.
 
 
 
 
"SELECT single RSNUM FROM RESB INTO @DATA(ld_rsnum).
DATA(ld_rsnum) = ' '.
 
"SELECT single LGPLA FROM PKHD INTO @DATA(ld_cv_lgpla).
 
"SELECT single WEMNG FROM RFPKB INTO @DATA(ld_wemng_kanban).
 
"SELECT single EBELN FROM EKPO INTO @DATA(ld_ebeln).
DATA(ld_ebeln) = ' '.
 
"SELECT single UMLGT FROM IMSEG INTO @DATA(ld_cv_umlgt).
 
"SELECT single EBELP FROM EKPO INTO @DATA(ld_ebelp).
DATA(ld_ebelp) = ' '.
 
"SELECT single UMLGP FROM IMSEG INTO @DATA(ld_cv_umlgp).
 
"SELECT single PKNUM FROM PKPS INTO @DATA(ld_pknum).
DATA(ld_pknum) = ' '.
 
"SELECT single ELIKZ FROM MSEG INTO @DATA(ld_cv_elikz).
 
"SELECT single PKPOS FROM PKPS INTO @DATA(ld_pkpos).
DATA(ld_pkpos) = ' '.
 
"SELECT single LGNUM FROM PKHD INTO @DATA(ld_lgnum).
DATA(ld_lgnum) = ' '.
 
"SELECT single TBNUM FROM PKPS INTO @DATA(ld_tbnum).
DATA(ld_tbnum) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!