SAP AFWCH_ACTIVE_DATASTR_GET Function Module for AFW: liefert aktive Analysestruktur und ggf. interne Sicht
AFWCH_ACTIVE_DATASTR_GET is a standard afwch active datastr get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for AFW: liefert aktive Analysestruktur und ggf. interne Sicht 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 afwch active datastr get FM, simply by entering the name AFWCH_ACTIVE_DATASTR_GET into the relevant SAP transaction such as SE37 or SE38.
Function Group: AFWCH_STR
Program Name: SAPLAFWCH_STR
Main Program: SAPLAFWCH_STR
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function AFWCH_ACTIVE_DATASTR_GET 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 'AFWCH_ACTIVE_DATASTR_GET'"AFW: liefert aktive Analysestruktur und ggf. interne Sicht.
IMPORTING
E_DATASTR = "Name der aktiven Analysestruktur
E_SEGM_CHAR_TYPE = "Typ der Merkmalsverwendung (space: flexibel, 1: fest)
E_INTERNAL_VIEW = "Name der internen Sicht (wenn eindeutig)
EXCEPTIONS
NO_ACTIVE_DATASTRUCTURE = 1 NO_INTERNAL_VIEW = 2 ACTIVE_DATASTRUCTURE_NOT_FOUND = 3
EXPORTING Parameters details for AFWCH_ACTIVE_DATASTR_GET
E_DATASTR - Name der aktiven Analysestruktur
Data type: JBRRMBIDOptional: No
Call by Reference: Yes
E_SEGM_CHAR_TYPE - Typ der Merkmalsverwendung (space: flexibel, 1: fest)
Data type: AFWCH_SEGMCHARTYPEOptional: No
Call by Reference: Yes
E_INTERNAL_VIEW - Name der internen Sicht (wenn eindeutig)
Data type: JBRSICHTIDOptional: No
Call by Reference: Yes
EXCEPTIONS details
NO_ACTIVE_DATASTRUCTURE - Im aktuellen Mandanten ist keine Analysestruktur aktiv
Data type:Optional: No
Call by Reference: Yes
NO_INTERNAL_VIEW - Für aktive Analysestruktur existiert keine interne Sicht
Data type:Optional: No
Call by Reference: Yes
ACTIVE_DATASTRUCTURE_NOT_FOUND - Analysestruktur ist aktiv, existiert aber nicht
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for AFWCH_ACTIVE_DATASTR_GET 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_e_datastr | TYPE JBRRMBID, " | |||
| lv_no_active_datastructure | TYPE JBRRMBID, " | |||
| lv_e_segm_char_type | TYPE AFWCH_SEGMCHARTYPE, " | |||
| lv_no_internal_view | TYPE AFWCH_SEGMCHARTYPE, " | |||
| lv_e_internal_view | TYPE JBRSICHTID, " | |||
| lv_active_datastructure_not_found | TYPE JBRSICHTID. " |
|   CALL FUNCTION 'AFWCH_ACTIVE_DATASTR_GET' "AFW: liefert aktive Analysestruktur und ggf. interne Sicht |
| IMPORTING | ||
| E_DATASTR | = lv_e_datastr | |
| E_SEGM_CHAR_TYPE | = lv_e_segm_char_type | |
| E_INTERNAL_VIEW | = lv_e_internal_view | |
| EXCEPTIONS | ||
| NO_ACTIVE_DATASTRUCTURE = 1 | ||
| NO_INTERNAL_VIEW = 2 | ||
| ACTIVE_DATASTRUCTURE_NOT_FOUND = 3 | ||
| . " AFWCH_ACTIVE_DATASTR_GET | ||
ABAP code using 7.40 inline data declarations to call FM AFWCH_ACTIVE_DATASTR_GET
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.Search for further information about these or an SAP related objects