SAP TWZLA_READ Function Module for NOTRANSL: Lesen der Tabelle TWZLA









TWZLA_READ is a standard twzla read SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Lesen der Tabelle TWZLA 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 twzla read FM, simply by entering the name TWZLA_READ into the relevant SAP transaction such as SE37 or SE38.

Function Group: WSOS
Program Name: SAPLWSOS
Main Program: SAPLWSOS
Appliation area: W
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function TWZLA_READ 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 'TWZLA_READ'"NOTRANSL: Lesen der Tabelle TWZLA
EXPORTING
PI_ATTYP = "Material Category
PI_KEYTR = "Transaction Key
PI_VLFKZ = "Plant Category
* PI_VKORG = "Sales Organization
* PI_VTWEG = "Distribution Channel
* PI_WERKS = "Plant
* PI_KUNNR = "Customer Number
* PI_MATNR = "Material Number

IMPORTING
PE_TWZLA = "DE-EN-LANG-SWITCH-NO-TRANSLATION

EXCEPTIONS
NO_TWZLA_FOUND = 1
.




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_SAPLWSOS_001 Function Module Exit for Calculating Header Material PO Quantity

IMPORTING Parameters details for TWZLA_READ

PI_ATTYP - Material Category

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

PI_KEYTR - Transaction Key

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

PI_VLFKZ - Plant Category

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

PI_VKORG - Sales Organization

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

PI_VTWEG - Distribution Channel

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

PI_WERKS - Plant

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

PI_KUNNR - Customer Number

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

PI_MATNR - Material Number

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

EXPORTING Parameters details for TWZLA_READ

PE_TWZLA - DE-EN-LANG-SWITCH-NO-TRANSLATION

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

EXCEPTIONS details

NO_TWZLA_FOUND - DE-EN-LANG-SWITCH-NO-TRANSLATION

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

Copy and paste ABAP code example for TWZLA_READ 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_pe_twzla  TYPE TWZLA, "   
lv_pi_attyp  TYPE MARA-ATTYP, "   
lv_no_twzla_found  TYPE MARA, "   
lv_pi_keytr  TYPE TWZLA-KEYTR, "   
lv_pi_vlfkz  TYPE T001W-VLFKZ, "   
lv_pi_vkorg  TYPE T001W-VKORG, "   
lv_pi_vtweg  TYPE T001W-VTWEG, "   
lv_pi_werks  TYPE T001W-WERKS, "   
lv_pi_kunnr  TYPE KNA1-KUNNR, "   
lv_pi_matnr  TYPE MARA-MATNR. "   

  CALL FUNCTION 'TWZLA_READ'  "NOTRANSL: Lesen der Tabelle TWZLA
    EXPORTING
         PI_ATTYP = lv_pi_attyp
         PI_KEYTR = lv_pi_keytr
         PI_VLFKZ = lv_pi_vlfkz
         PI_VKORG = lv_pi_vkorg
         PI_VTWEG = lv_pi_vtweg
         PI_WERKS = lv_pi_werks
         PI_KUNNR = lv_pi_kunnr
         PI_MATNR = lv_pi_matnr
    IMPORTING
         PE_TWZLA = lv_pe_twzla
    EXCEPTIONS
        NO_TWZLA_FOUND = 1
. " TWZLA_READ




ABAP code using 7.40 inline data declarations to call FM TWZLA_READ

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 ATTYP FROM MARA INTO @DATA(ld_pi_attyp).
 
 
"SELECT single KEYTR FROM TWZLA INTO @DATA(ld_pi_keytr).
 
"SELECT single VLFKZ FROM T001W INTO @DATA(ld_pi_vlfkz).
 
"SELECT single VKORG FROM T001W INTO @DATA(ld_pi_vkorg).
 
"SELECT single VTWEG FROM T001W INTO @DATA(ld_pi_vtweg).
 
"SELECT single WERKS FROM T001W INTO @DATA(ld_pi_werks).
 
"SELECT single KUNNR FROM KNA1 INTO @DATA(ld_pi_kunnr).
 
"SELECT single MATNR FROM MARA INTO @DATA(ld_pi_matnr).
 


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!