Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Assign authorisation objekt value to a variable for query for SAP Query pro

Former Member
0 Likes
590

Hello,

I know the ABAP Coding for a authorisation check:

"AUTHORITY-CHECK OBJECT 'V_KONH_VKO'

ID 'VKORG' FIELD 'NL00'

ID 'ACTVT' FIELD '03'.

check sy-subrc = 0.

IF sy-subrc <> 0.

MESSAGE 'No authorization' TYPE 'E'.

ENDIF."

And know I am looking for a method to read the value for 'V_KONH_VKO' field 'VKORG' and assign this value to an own z-variable.

Because our problem is that we like to query the table KONH (with sq02) and the users should see only the values from their own sales organization. There is no VKORG. But in KONH-VAKEY there is a value like " NL0010000000000000012752". The four first characters are the value for our sales organisation NL00.Now I will try to assign the V_KONH_VKO-VKORG authorisation field value to a z-variable (ZVKORG) and when we a are querieing the KONH to use in the where condition something like Where KONH-VAKEY=ZVKORG

Is that possible or any better ideas?

Best regards,

Frank

Hello,

I know the ABAP Coding for a authorisation check:

"AUTHORITY-CHECK OBJECT 'V_KONH_VKO'

ID 'VKORG' FIELD 'NL00'

ID 'ACTVT' FIELD '03'.

check sy-subrc = 0.

IF sy-subrc <> 0.

MESSAGE 'No authorization' TYPE 'E'.

ENDIF."

And know I am looking for a method to read the value for 'V_KONH_VKO' field 'VKORG' and assign this value to an own z-variable.

Because our problem is that we like to query the table KONH (with sq02) and the users should see only the values from their own sales organization. There is no VKORG. But in KONH-VAKEY there is a value like " NL0010000000000000012752". The four first characters are the value for our sales organisation NL00.Now I will try to assign the V_KONH_VKO-VKORG authorisation field value to a z-variable (ZVKORG) and when we a are querieing the KONH to use in the where condition something like Where KONH-VAKEY=ZVKORG

Is that possible or any better ideas?

Best regards,

Frank

2 REPLIES 2
Read only

Former Member
0 Likes
538

Hi,

Check for the Tables TOBJ & TACT.

What I will suggest you trhat bring all the Data from the Database into the Internal Table and then Filter the Data from Internal Table by using the Authority Object check in the Loop at Itab.

Read only

0 Likes
538

Hi,

thank for your feedback - but regarding the tables I need the values from the user context (su56 authorisation field V_KONH_VKO-VKORG) during the runtime.

Example:

The user has a authorisation role with the authorisation object V_KONH_VKO and the VKORG field value "NL00".

And this values is required to query the KONH-VAKEY!

How can we realise this?

But I think the suggestion with the internal table will help us later.

Best regards,

Frank