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

One parameter for variable OR itab

Former Member
0 Likes
705

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!

4 REPLIES 4
Read only

Former Member
0 Likes
661

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


Read only

0 Likes
661

Thank you Satya,

Now it works indeed!

I want to reward you points but I don't know how..

Read only

0 Likes
661

You cannot award points if you don't mark the discussion as a question.

Rob

Read only

0 Likes
661

Mark as answered to my answer. Then only this thread will be closed.

Thanks,

Satya