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

flags

Former Member
0 Likes
1,591

hi experts,

what is mean by flag? and why it is used in reports, explain with ex.

thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
1,357

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

Read only

Former Member
0 Likes
1,357

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

Read only

Former Member
0 Likes
1,357

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

Read only

Former Member
0 Likes
1,357

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