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 with assignment

Former Member
0 Likes
881

Hi

DATA: BEGIN OF wa_file,

matnr(15) TYPE c,

v1 TYPE c VALUE ',',

maktx(30) TYPE c,

v2 TYPE c VALUE ',',

v3(15) TYPE c VALUE '""',

END OF wa_file.

is correct this type of declaration with assignments?

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
847

Ok. thanks.

However, these values inserted are cancelled by a clear wa_file.

Is there a command that blocks these values inserted in the declarations(as constants for example)?

7 REPLIES 7
Read only

Former Member
0 Likes
847

yes it looks ok , did u get any problem

REPORT ABC.

DATA: BEGIN OF WA_FILE,
MATNR(15) TYPE C,
V1 TYPE C VALUE ',',
MAKTX(30) TYPE C,
V2 TYPE C VALUE ',',
V3(15) TYPE C VALUE '""',
END OF WA_FILE.

WRITE : WA_FILE-V1.

Read only

Former Member
0 Likes
847

declaration is correct but ur output will be , & " ".

Read only

Former Member
0 Likes
847

the declaration is perfect...

u can go ahead writing ur additional code.

Read only

Former Member
0 Likes
847

Hi Tony,

Use <b>TYPES</b> in place of <b>data</b> in declaration.

Refer this code :

Types: BEGIN OF wa_file,

matnr(15) TYPE c,

v1 TYPE c VALUE ',',

maktx(30) TYPE c,

v2 TYPE c VALUE ',',

v3(15) TYPE c VALUE '""',

END OF wa_file.

Reward points if helpful.

Regards,

Hemant

Read only

Former Member
0 Likes
847

Hi Tony,

ya, Its Correct. You can Simplify your code like,

data : Begin of wa_file,

matnr(15), -


> System knows that its a type c.

v1 type c value ' ',

maktx(30),

v2 TYPE c VALUE ' ',

v3(15) TYPE c VALUE ' ',

end of wa_file.

Thanks.

Reward if Helpful.

Read only

Former Member
0 Likes
848

Ok. thanks.

However, these values inserted are cancelled by a clear wa_file.

Is there a command that blocks these values inserted in the declarations(as constants for example)?

Read only

0 Likes
847

you can use a temporary workarea and use that

data : wa_file_temp type wa_file.

move-corresponding wa_file to wa_file_temp.

then use wa_file_temp for calculation purposes and u can use

CLEAR wa_file_temp.