Skip to Content
0
Former Member
Mar 27, 2007 at 09:11 AM

remove decimals for menge

420 Views

Hi all,

I need to remove the decimal places below 200,000 for menge(open qty).

please advise me how can i remove it.

file layout :

"B","12345-DEV","5500000028"," 200,000","20070323","20070310","0000001009",

code below.

FORM DOWNLOAD.

DATA : L_MENGE(20) TYPE C,

L_TEXT(300) TYPE C,

L_TAB VALUE ',',

L_QUOTE VALUE '"',

L_EINDT(8),

L_LINES TYPE I,

L_AEDAT(8).

OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT ITAB.

WRITE : ITAB-MENGE TO L_MENGE RIGHT-JUSTIFIED.

CONDENSE : ITAB-PRDHA,

ITAB-MATNR,

ITAB-EBELN,

ITAB-LIFNR,

ITAB-PRDHA_1 NO-GAPS.

L_EINDT = ITAB-EINDT+0(8).

L_AEDAT = ITAB-AEDAT+0(8).

CONCATENATE L_QUOTE ITAB-PRDHA L_QUOTE L_TAB

L_QUOTE ITAB-MATNR L_QUOTE L_TAB

L_QUOTE ITAB-EBELN L_QUOTE L_TAB

L_QUOTE L_MENGE L_QUOTE L_TAB

L_QUOTE L_AEDAT L_QUOTE L_TAB

L_QUOTE L_EINDT L_QUOTE L_TAB

L_QUOTE ITAB-LIFNR L_QUOTE L_TAB

L_QUOTE ITAB-PRDHA_1 L_QUOTE INTO L_TEXT.

TRANSFER L_TEXT TO P_FILE.

ENDLOOP.

CLOSE DATASET P_FILE.