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

No initial value for data type n

Former Member
0 Likes
800

I have merchandiseamt(10) TYPE n,

When I display this without making any changes to it, it obviously displays 10 zeros as its initial value. How do I get rid of the initial value as I need to display it as space instead of zeros if it has no value .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
700

merchandiseamt(10) is a part of a field string fs_invoice_summary_record and I transfer fs_invoice_summary_record to an output file, so write statement will not work. Can I not set it during declaration to be no-zero or perhaps a similar solution ?

3 REPLIES 3
Read only

Former Member
0 Likes
700

Hi Megan,

think you mean display in a list!? Then try write merchandiseamt no-zero.

Best regards

Stephan

Read only

Former Member
0 Likes
701

merchandiseamt(10) is a part of a field string fs_invoice_summary_record and I transfer fs_invoice_summary_record to an output file, so write statement will not work. Can I not set it during declaration to be no-zero or perhaps a similar solution ?

Read only

0 Likes
700

Hi,

In this case you can use the write your code like this.

You must be passing the value to merchandiseamt(10) from some variable. Let's say this variable is FIELD, then you can have your code like this.

Let me know if you have any question.

DATA: field(10) TYPE n.

DATA: BEGIN OF fs_invoice_summary_record,
        merchandiseamt(10) TYPE n,
      END OF fs_invoice_summary_record.

BREAK-POINT.

IF field IS INITIAL.
  WRITE field TO fs_invoice_summary_record-merchandiseamt NO-ZERO.
ELSE.
  fs_invoice_summary_record-merchandiseamt = field.
ENDIF.

Regards,

RS