‎2015 Dec 28 12:40 PM
Hi all,
I'm currently coding a method to check serveral authorizations off company code - BUKRS.
My method can only have 1 changing parameter.
Input will be the input from the selection screen, single value 0002 or select options 0002 - 4100.
How can i set the parameter so it can process a single value and and itab with type selopt?
Thanks in advance!
‎2015 Dec 28 1:18 PM
Hi Mathieu,
Recently I have done the logic for sales organization. Please check in below.
SVKORG is the select option for sales organization. Instead of TVKO you have to fetch the company code details from T001 table.
DATA : lr_vkorg TYPE RANGE OF vkorg,
ls_vkorg LIKE LINE OF lr_vkorg.
IF svkorg IS NOT INITIAL.
CLEAR :lt_tvko,ls_tvko,lr_vkorg,ls_vkorg.
SELECT vkorg bukrs
INTO TABLE lt_tvko
FROM tvko WHERE vkorg IN svkorg.
IF sy-subrc = 0.
CLEAR svkorg[].
LOOP AT lt_tvko INTO ls_tvko.
AUTHORITY-CHECK OBJECT 'V_VBAK_VKO'
ID 'VKORG' FIELD ls_tvko-vkorg
ID 'ACTVT' FIELD '3'.
IF sy-subrc = 0.
ls_vkorg-sign = 'I'.
ls_vkorg-option = 'EQ'.
ls_vkorg-low = ls_tvko-vkorg.
APPEND ls_vkorg TO lr_vkorg.
ENDIF.
CLEAR ls_tvko.
ENDLOOP.
svkorg[] = lr_vkorg[].
CLEAR lr_vkorg[].
IF svkorg[] IS INITIAL.
MESSAGE text-016 TYPE 'E'.
ENDIF.
ELSE.
CLEAR svkorg.
MESSAGE text-020 TYPE 'E'.
ENDIF.
ENDIF.
It will solve your problem.
Thanks,
Satya
‎2015 Dec 28 3:20 PM
Thank you Satya,
Now it works indeed!
I want to reward you points but I don't know how..
‎2015 Dec 28 4:52 PM
You cannot award points if you don't mark the discussion as a question.
Rob
‎2015 Dec 28 5:38 PM
Mark as answered to my answer. Then only this thread will be closed.
Thanks,
Satya