Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Pull a list of Functional Location from SAP using BAPI
When working with SAP BAPI to pull a list of Functional Locations, you need to properly configure the function parameters before making the call. The BAPI_FUNCLOC_GETLIST function requires specific table parameters to filter and retrieve the desired functional location data.
After you set objRfcFunc, you should configure the funcloc_ra table parameter with the appropriate selection criteria before calling the BAPI function.
Setting Up Function Location Range Parameters
The funcloc_ra table contains the selection criteria for functional locations. Each row specifies the selection options including the sign, option, and value parameters ?
With objRfcFunc.tables("funcloc_ra")
If .RowCount < 1 Then .Rows.Add
.cell(1, 1) = "I"
.cell(1, 2) = "EQ"
.cell(1, 3) = "Your Func Loc"
End With
Parameter Explanation
The three parameters in the table correspond to ?
- Sign (Column 1): "I" for Include, "E" for Exclude
- Option (Column 2): "EQ" for Equal, "BT" for Between, "CP" for Contains Pattern
- Low Value (Column 3): The actual functional location ID or pattern to search for
Complete Example
Here's a more comprehensive example showing how to set up multiple selection criteria ?
' Set up the RFC function object
Set objRfcFunc = objRfcConn.CreateFunction("BAPI_FUNCLOC_GETLIST")
' Configure the selection range for functional locations
With objRfcFunc.tables("funcloc_ra")
' Add first selection criteria
If .RowCount < 1 Then .Rows.Add
.cell(1, 1) = "I" ' Include
.cell(1, 2) = "EQ" ' Equal
.cell(1, 3) = "FL-001" ' Specific functional location
' Add second selection criteria for range
.Rows.Add
.cell(2, 1) = "I" ' Include
.cell(2, 2) = "BT" ' Between
.cell(2, 3) = "FL-100" ' Low value
.cell(2, 4) = "FL-199" ' High value (for BT option)
End With
' Execute the BAPI function
objRfcFunc.Call
Conclusion
By properly configuring the funcloc_ra table parameters with the appropriate sign, option, and value combinations, you can effectively filter and retrieve specific functional location data from SAP using the BAPI function.
