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

Former Member

Please tell me what is a flag , and its purpose and how it is used.

Thanks in advance.

5 REPLIES 5

Former Member
0 Kudos

Hi hemal,

1. Flag is nothing but a variable of just one character.

It can have value X or space

to denote Yes or no

True of false.

2. eg.

data : foundflag type c.

If some condition is true.

foundflag = 'X'.

endif.

if foundflag = 'X'.

*----- code.

endif.

regards,

amit m.

Former Member
0 Kudos

Hi,

FLAG is a Single charecter field which we will declare the ABAP code .

DATA: FLAG. " a Single Charecter field.

Lets say you want to check a YES or NO situvation, then this will be very usefull, you can check this FLAG is X or SPACE, based on this we can write the Program

Regards

Sudheer

varma_narayana
Active Contributor

Hi...

Flag is nothing but a variable to Store values like TRUE or FALSE.

Generally we use a SINGLE CHAR field as a FLAG (' ' for False and 'X' for True)

Data : v_flag type c.

IF v_flag = 'X'.

ENDIF.

<b>reward if helpful.</b>

Former Member
0 Kudos

Hi Hema,

Flag is just a temporary variable which stores value X or space..

Depending on the value of a flag you can perform some code...

Former Member
0 Kudos

Hi,

FLag could be a single character variable of type C. You can use flag for any purpose if you want to store some sort of counter. Flag is not mandatory for call transaction. Flag is generally a temp variable defined withn the program to check the status if its TRUE or FLASE.

you declare like this.

data : flag(1) type c.

check this link for more info...

<b>Reward points</b>

regards