‎2008 Jun 25 7:13 AM
hi experts,
what is mean by flag? how we know the using method? pl explain breifly & clearly.
for good answer points reward.
thanks.
‎2008 Jun 25 7:22 AM
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
‎2008 Jun 25 7:15 AM
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..
‎2008 Jun 25 7:22 AM
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
‎2008 Jun 25 7:27 AM
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**********&
‎2008 Jun 25 7:27 AM
Flags can be used for validation.Also used for checking the conditions.It is declared as a variable of lenght 1(char/int) type.
‎2008 Jun 25 7:31 AM
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
......
......