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

problem in perform and form statements

Former Member
0 Likes
1,133

data: r_vkont TYPE RANGE OF fkkvk-vkona,
       e_vkont LIKE LINE OF r_vkont.


So while declaring a subroutine with following parameters and r_vkont a structure of type r_vkont as below

We are getting a syntax error.

So what should be the possible solution.


FORM check_existence_zr021
   TABLES t_zr006sat          STRUCTURE zr006sat
          t_zr021sat          STRUCTURE zr021sat
          t_zr006sat_zr021sat STRUCTURE e_zr006key

          r_vkont STRUCTURE r_vkont.

data: r_vkont TYPE RANGE OF fkkvk-vkona,
       e_vkont LIKE LINE OF r_vkont.


So while declaring a subroutine with following parameters and r_vkont a structure of type r_vkont as below

We are getting a syntax error.

So what should be the possible solution.


FORM check_existence_zr021
   TABLES t_zr006sat          STRUCTURE zr006sat
          t_zr021sat          STRUCTURE zr021sat
          t_zr006sat_zr021sat STRUCTURE e_zr006key

          r_vkont STRUCTURE r_vkont.

9 REPLIES 9
Read only

Sijin_Chandran
Active Contributor
0 Likes
1,102

Hi Subrat ,

What kind error you are getting ?

Read only

satyabrata_sahoo3
Contributor
0 Likes
1,102

Try like this: 

data: r_vkont TYPE RANGE OF fkkvk-vkona,

        e_vkont LIKE LINE OF r_vkont.

FORM check_existence_zr021

    TABLES t_zr006sat          STRUCTURE zr006sat

                  t_zr021sat          STRUCTURE zr021sat

                  t_zr006sat_zr021sat STRUCTURE e_zr006key

                  r_vkont like r_vkont.

   endform.

~SS~

Read only

prince_isaac
Active Participant
0 Likes
1,102

Hi Subrat

Try like this instead:

FORM check_existence_zr021
   TABLES t_zr006sat          STRUCTURE zr006sat
          t_zr021sat          STRUCTURE zr021sat
          t_zr006sat_zr021sat STRUCTURE e_zr006key

          r_vkont STRUCTURE e_vkont.

regards

Prince Isaac

Read only

Former Member
0 Likes
1,102

Hello subrat,

You must be getting syntax error r_vkont is not a structure. Instead of structure use 'LIKE' as below

FORM check_existence_zr021
   TABLES t_zr006sat          STRUCTURE zr006sat
          t_zr021sat          STRUCTURE zr021sat
          t_zr006sat_zr021sat STRUCTURE e_zr006key

          r_vkont LIKE r_vkont.

Read only

0 Likes
1,102

ya ,i changed to like,

But issue is that, inside the subroutine,the r_vkont being populated as values are passed into the sign option low and high.

And the problem is that the r_vkont is a table without header line.

Read only

0 Likes
1,102

ya ,i changed to like,

But issue is that, inside the subroutine,the r_vkont being populated as values are passed into the sign option low and high.

And the problem is that the r_vkont is a table without header line.

R

Read only

0 Likes
1,102

Subrat,

Declare a structure local to your subroutine and read/loop at the entries in r_vkont.  As below:

data: lw_vkont type range of fkkvk-vkona.

regards

Prince Isaac

Read only

0 Likes
1,102

Yeah..then too it will work.

You can append the r_vkont with sign, option, low and high values in routine.

and Access those values using loop at r_vkont...

Regards,

Deepti

Read only

Former Member
0 Likes
1,102

Hello Subrat,

Let me know , whether the subroutine mentioned above are going to used by some other programs or only by the current one. In case of current one you can Declare the ranges at the top of the program and that will be accessiable at any point of time in the program. Once you declare a range the structure will be similar to the select-option .

To avoid this issue you create an structure in SE11 with sign,option, low and high.

Thanks & Regards,

Sumodh.P