‎2008 Apr 25 12:35 PM
hi experts,
what is mean by flag? and why it is used in reports, explain with ex.
thanks.
‎2008 Apr 25 12:40 PM
Hi,
Flag is nothing but a variable use to ser the value True or False
Data : gt_flag type c value 'X'.
you can set value as 'X' for True and ' ' for False
and check it for its value for your condition.
eg:
data: gt_a type i value '20'.
Data : gt_flag type c value 'X'.
if gt_a > 10.
gt_flag = ' '.
endif.
if gt_flag = ' '.
write: 'Value is gretaer tahn 10'.
endif.
Regards,
Raj
‎2008 Apr 25 12:40 PM
Hi
Flags are nothing but a single CHAR fields
We can define them as SIngle char fields and use it in the code based on the requirement, like a condition based value of a single CHAR field.
Regards
Raghav
‎2008 Apr 25 12:41 PM
hi shirish,
flag is counter, it's a variable used differentiate the proccessed and non proccd items.
suppose if we upload the records from a internal table to database table by some method(call transaction or session) we place a flag variable in internal table .
initally all records have sam eflag after proccesing a record we change the flag to particuar record. it differantiates proccessed and non-proccessed records..
regards,
chandu
REWARD if helpful
‎2008 Apr 25 12:42 PM
HI
don't confuse with name they are simple variables which we can set (i mean give value) on certain conditions in report and then use their value to take further decisions.
EX.
data: v1 type c.
loop at mara.
if mara-matnr = '123'.
v1 = 'X'.
endif.
endloop.
-
-
if v1 = 'X'.
exit.
endif.
Here v1 acts as flag.
Thanks
Aditya