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

Declaration

Former Member
0 Likes
1,498

I want to declare a field as blank how to do?

1 ACCEPTED SOLUTION
Read only

former_member195383
Active Contributor
0 Likes
1,475

declare the field and then clear it...

data: wf_char type c.

clear wf_char.

reward points if useful....

11 REPLIES 11
Read only

former_member195383
Active Contributor
0 Likes
1,477

declare the field and then clear it...

data: wf_char type c.

clear wf_char.

reward points if useful....

Read only

0 Likes
1,475

I have to put it in the if codn.In that i have to check 2 codn like if var1 as blank or var2 = var3.In this situation how to do?

Read only

0 Likes
1,475

U can write condition like

if var1 is initial or var2 eq var3.

...

endif.

Reward points if useful,

Regards,

Janani

Read only

0 Likes
1,475

IF VAR1 = SPACE 
 OR VAR2 = VAR3.

You can write your own logic


ENDIF.
Read only

Former Member
0 Likes
1,475

HI,

Don't assign any value(initiate), then it will be INITIAL.

Read only

GauthamV
Active Contributor
0 Likes
1,475

hi,

ex:

itab-matnr = ' '.

if u want it blank under some condition do like this.

if itab-matnr = '1000234568'.

itab-matnr = ' '.

modify itab.

endif.

reward points if hlpful.

Read only

Former Member
0 Likes
1,475

data: v_char type c.

move space to v_char.

Read only

Former Member
0 Likes
1,475

Hi Hema,

Here is the logic.


 Data: var type c value space.

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

Read only

Former Member
0 Likes
1,475

Hi,

If you need to declare the field as blank we can write,

parameters: p_matnr type mara-matnr default ' '.

or In initialization event of report ,

Initialization.

p_matnr = ' '.

if you need to put in condition :

if p_matnr is initial.

.....

endif.

Hope this helps you.

plz reward if useful.

thanks,

dhanashri.

Read only

Former Member
0 Likes
1,475

Hi,

take a look at [Predefined ABAP Types|http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb2fd9358411d1829f0000e829fbfe/frameset.htm]. Here you can see the initial values.

Regards Rudi

Read only

Former Member
0 Likes
1,475

Hi

if u define any variable.it is intially blank only until you pass some value into it.

you execute this code.you will get idea.

data:name type c.

write:/ name.