2006 Aug 29 6:20 PM
DATA: BEGIN OF ITAB OCCURS 0,
AUFNR LIKE AFKO-AUFNR, " Purchase Order Number
PLNBEZ LIKE AFKO-PLNBEZ, " Part Number
BISMT like MARA-BISMT, " Old Material
LNO(2),
GAMNG LIKE AFKO-GAMNG, " Production Order Quantity
GLTRP LIKE AFKO-GLTRP,
VDATU LIKE VBAK-VDATU,
KWMENG LIKE VBAP-KWMENG,
MBDAT LIKE VBEP-MBDAT,
GBSTA LIKE VBUK-GBSTK,
PCTBS(5),
*CSHOT
"CDESC
END OF ITAB.
LOOP AT ITAB.
WRITE:/3 ITAB-AUFNR,
13 ITAB-PLNBEZ,
23 ITAB-BISMT,
LNO(2),
45 ITAB-GAMNG,
65 ITAB-GLTRP.
57 ITAB-VDATU.
*63 ITAB-KWMENG,
69 ITAB-MBDAT.
PCTBS(5),
*C
ENDLOOP.
I have a internal table and I have writing the itab in the write statement. I need to format the field in itab.
for eg:
itab-gamng(lenght as 5)
itab-gltrp(its a date) i just need the mm/yy how can I format it.
2006 Aug 29 6:27 PM
You don' need to reformat the itab, just the fields before you write them.
<b>data: monthyear(5) type c.
data: qty(5) type c.</b>
LOOP AT ITAB.
<b>concatenate itab-gltrp+4(2) '/'
itab-gltrp+0(4)
into monthyear.
clear qty.
qty = qty + itab-gamng.</b>
WRITE:/3 ITAB-AUFNR,
13 ITAB-PLNBEZ,
23 ITAB-BISMT,
* LNO(2),
<b>*45 ITAB-GAMNG,
45 qty,
* 65 ITAB-GLTRP.
65 monthyear.</b>
* 57 ITAB-VDATU.
* *63 ITAB-KWMENG,
* 69 ITAB-MBDAT.
* PCTBS(5),
*C
ENDLOOP.
Regards,
Rich Heilman
You don' need to reformat the itab, just the fields before you write them.
<b>data: monthyear(5) type c.
data: qty(5) type c.</b>
LOOP AT ITAB.
<b>concatenate itab-gltrp+4(2) '/'
itab-gltrp+0(4)
into monthyear.
clear qty.
qty = qty + itab-gamng.</b>
WRITE:/3 ITAB-AUFNR,
13 ITAB-PLNBEZ,
23 ITAB-BISMT,
* LNO(2),
<b>*45 ITAB-GAMNG,
45 qty,
* 65 ITAB-GLTRP.
65 monthyear.</b>
* 57 ITAB-VDATU.
* *63 ITAB-KWMENG,
* 69 ITAB-MBDAT.
* PCTBS(5),
*C
ENDLOOP.
Regards,
Rich Heilman
2006 Aug 29 6:27 PM
You don' need to reformat the itab, just the fields before you write them.
<b>data: monthyear(5) type c.
data: qty(5) type c.</b>
LOOP AT ITAB.
<b>concatenate itab-gltrp+4(2) '/'
itab-gltrp+0(4)
into monthyear.
clear qty.
qty = qty + itab-gamng.</b>
WRITE:/3 ITAB-AUFNR,
13 ITAB-PLNBEZ,
23 ITAB-BISMT,
* LNO(2),
<b>*45 ITAB-GAMNG,
45 qty,
* 65 ITAB-GLTRP.
65 monthyear.</b>
* 57 ITAB-VDATU.
* *63 ITAB-KWMENG,
* 69 ITAB-MBDAT.
* PCTBS(5),
*C
ENDLOOP.
Regards,
Rich Heilman
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |