Application Development 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: 

flag (report)

Former Member
0 Kudos

hi experts,

what is mean by flag? how we know the using method? pl explain breifly & clearly.

for good answer points reward.

thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

Flags are generally used to check the status of something.

For example :

Data : p_repr(1)  type c ,    "Representative 
         p_supr(1)  type c ,    " Supervisor
         p_depl(1)  type c ,    " Demand Planner
         g_flag_role TYPE c.  " Flag

  IF g_ok_code = 'EXEC'.
* This part gets the records from z09_user_roles and sets g_flag_role as either R or S or D.

    CASE 'X'.
      WHEN p_repr .
        g_flag_role = 'R'.
      WHEN p_supr .
        g_flag_role = 'S'.
      WHEN p_depl .
        g_flag_role = 'D'.
    ENDCASE.

    CASE g_flag_role .

      WHEN 'R'.
...........................

     WHEN 'S'.
.............................

     WHEN 'D'.
 .........................

.
.
.
.
ENDCASE.

Hope this will clarify your doubt.

plz reward if useful.

thanks,

dhanashri.

Edited by: Dhanashri Pawar on Jun 25, 2008 8:22 AM

5 REPLIES 5

Former Member
0 Kudos

Generally a flag is used to know whether a particular thing is validated or not.I mean

if a = b

c_flag = x.

Then depending on whether the flag is set or not you can write what action needs to be taken.

Reward Points..

Former Member
0 Kudos

Hi ,

Flags are generally used to check the status of something.

For example :

Data : p_repr(1)  type c ,    "Representative 
         p_supr(1)  type c ,    " Supervisor
         p_depl(1)  type c ,    " Demand Planner
         g_flag_role TYPE c.  " Flag

  IF g_ok_code = 'EXEC'.
* This part gets the records from z09_user_roles and sets g_flag_role as either R or S or D.

    CASE 'X'.
      WHEN p_repr .
        g_flag_role = 'R'.
      WHEN p_supr .
        g_flag_role = 'S'.
      WHEN p_depl .
        g_flag_role = 'D'.
    ENDCASE.

    CASE g_flag_role .

      WHEN 'R'.
...........................

     WHEN 'S'.
.............................

     WHEN 'D'.
 .........................

.
.
.
.
ENDCASE.

Hope this will clarify your doubt.

plz reward if useful.

thanks,

dhanashri.

Edited by: Dhanashri Pawar on Jun 25, 2008 8:22 AM

former_member598013
Active Contributor
0 Kudos

Hi Shirish,

Flag is used as a tag by which you can handle your program.

Suppose if you want to display 7 after 5 then what you need to do is like this.


data: count type i value 1
data: flag type i value 0.
do 7 times.
  if count >= 5.
    flag = 1.
  endif.
  write:/ count.
count = count + 1.

enddo.
if flag = 1.
   count = count + 1.
   write:/ count.
endif.

&***********Reward Point if helpful**********&

Former Member
0 Kudos

Flags can be used for validation.Also used for checking the conditions.It is declared as a variable of lenght 1(char/int) type.

Former Member
0 Kudos

Hi,

Generally flags are used to check the status of some variables in a program and according to the status we proceed our working like if flag is equal to this value do this else do this,

For Eg.

Intialize the flag with 0.

then at some point in program

if x=y

flag = 1.

.........

........

If flag = 1

do

......

......

else

do

......

......