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

Fill fields

Former Member
0 Likes
715

Hi,

I have separated every elements of sdata of an idoc to a internal table. and now i want to fill the field that are empty with zeros. for example i have a field with size 8 that is empty, i want to fill it with eight zeros.

6 REPLIES 6
Read only

Former Member
0 Likes
680

use the statement:

if itab-field1 is initial.

replace all occurances of space with '0' in itab-field1.

endif.

Regards,

Ravi

Read only

Former Member
0 Likes
680

If they are CHAR fields you can assign '00000000' value to the field.

Regards,

Ravi

Read only

Former Member
0 Likes
680

You can declare it as a field of type N.. which will place zeroes if there is no value!

Read only

0 Likes
680

hi,

Declare the <b>field as type N</b>

Read only

Former Member
0 Likes
680

Hi,

Loop at the internal table (ITAB)

If ITAB-FIELD is initial

ITAB-FIELD = '0'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = ITAB-FIELD

IMPORTING

OUTPUT = ITAB-FIELD.

Endif.

Endloop.

This way you don’t need to worry about the length of the field.

Regards,

Sameena

Read only

Former Member
0 Likes
680

Hi,

Loop at the internal table (ITAB)

If ITAB-FIELD is initial

ITAB-FIELD = '0'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = ITAB-FIELD

IMPORTING

OUTPUT = ITAB-FIELD.

Endif.

Endloop.

<b>This way you don’t need to worry about the length of the field.</b>

Regards,

Sameena