SAP SAP_QUERY_AD_HOC_ROLE Function Module for









SAP_QUERY_AD_HOC_ROLE is a standard sap query ad hoc role SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 sap query ad hoc role FM, simply by entering the name SAP_QUERY_AD_HOC_ROLE into the relevant SAP transaction such as SE37 or SE38.

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



Function SAP_QUERY_AD_HOC_ROLE 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 'SAP_QUERY_AD_HOC_ROLE'"
EXPORTING
I_ROLE = "Role Name
* I_INFOSET = ' ' "
* I_QUERY = ' ' "Name of a Query
* I_CHECK_ONLY = ' ' "
* I_USER_CHECK = ' ' "

EXCEPTIONS
ILLEGAL_ROLE = 1 ILLEGAL_QUERY_ENVIRONMENT = 2 USER_NOT_ASSIGNED = 3
.



IMPORTING Parameters details for SAP_QUERY_AD_HOC_ROLE

I_ROLE - Role Name

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

I_INFOSET -

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

I_QUERY - Name of a Query

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

I_CHECK_ONLY -

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

I_USER_CHECK -

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

EXCEPTIONS details

ILLEGAL_ROLE -

Data type:
Optional: No
Call by Reference: Yes

ILLEGAL_QUERY_ENVIRONMENT -

Data type:
Optional: No
Call by Reference: Yes

USER_NOT_ASSIGNED -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for SAP_QUERY_AD_HOC_ROLE 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_i_role  TYPE AGR_NAME, "   
lv_illegal_role  TYPE AGR_NAME, "   
lv_i_infoset  TYPE AQADEF-SGNAME, "   SPACE
lv_illegal_query_environment  TYPE AQADEF, "   
lv_i_query  TYPE AQADEF-QUNAME, "   SPACE
lv_user_not_assigned  TYPE AQADEF, "   
lv_i_check_only  TYPE AQADEF-FLAG, "   SPACE
lv_i_user_check  TYPE AQADEF-FLAG. "   SPACE

  CALL FUNCTION 'SAP_QUERY_AD_HOC_ROLE'  "
    EXPORTING
         I_ROLE = lv_i_role
         I_INFOSET = lv_i_infoset
         I_QUERY = lv_i_query
         I_CHECK_ONLY = lv_i_check_only
         I_USER_CHECK = lv_i_user_check
    EXCEPTIONS
        ILLEGAL_ROLE = 1
        ILLEGAL_QUERY_ENVIRONMENT = 2
        USER_NOT_ASSIGNED = 3
. " SAP_QUERY_AD_HOC_ROLE




ABAP code using 7.40 inline data declarations to call FM SAP_QUERY_AD_HOC_ROLE

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 SGNAME FROM AQADEF INTO @DATA(ld_i_infoset).
DATA(ld_i_infoset) = ' '.
 
 
"SELECT single QUNAME FROM AQADEF INTO @DATA(ld_i_query).
DATA(ld_i_query) = ' '.
 
 
"SELECT single FLAG FROM AQADEF INTO @DATA(ld_i_check_only).
DATA(ld_i_check_only) = ' '.
 
"SELECT single FLAG FROM AQADEF INTO @DATA(ld_i_user_check).
DATA(ld_i_user_check) = ' '.
 


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!