‎2006 Jun 05 9:33 PM
Hi everyone.
I have the below statement in report program.WHEN I SYNTAX CHECK I DOESN'T SHOW ANY ERRORS
write:/ 'zorder : ', itab-zorder,
' with quantity ', itab-zQUAN.
BUT WHEN I DO THE EXTENDED SYNTAX CHECK AT SE10 OR SE09 I.E WHEN I DO THE EXTENDED CHECK TO THE TRANSPORT OF THAT REPORT I GET THE FOLLWING ERROR.
Use addition UNIT when outputting ITAB-ZQUAN
Use auxiliary field when outputting with MESSAGE
ZQUANT IS THE QUANTITY OF MATERIAL
PLEASE LET ME KNOW IF I NEED TO DO ANY THING TO OVERCOME THIS.
Thanks in advance
‎2006 Jun 06 10:14 PM
Hi
Even i use the unit the o/p dosn't show any thing
This is my write statement
write:/ 'zorder : ', itab-zorder,
' with quantity ', itab-zmenge UNIT itab-z340b-meins.
o/p
zorder : 5700002246 with quantity 90
let me know if iam wrong.
‎2006 Jun 05 9:38 PM
‎2006 Jun 05 9:43 PM
With quantity and currency value fields, you have to specify the unit when you are doing the WRITE for the system to get the correct number of decimal places to output. Without that, system will just use the default two decimals to output. If you are 200% sure that your values will always be of two decimal places, you don't have to worry about this, but if you are not sure, then you need a unit along with the quantity.
‎2006 Jun 05 9:53 PM
Thanks for your replies
Can you please tell me then how does my write looks like
This is my orginal write statement.
write:/ 'zorder : ', itab-zorder,
' with quantity ', itab-zQUAN.
Thanks in advance.
‎2006 Jun 05 11:06 PM
Taken from ABAP Help.....
<i>
<b>... UNIT unit</b>
This addition cannot be used together with the addition TIME ZONE.
<b>Effect</b>
This addition cuts off decimal places that have the value 0 and are outside the exactness of a unit of measure during output of data objects of data type p. For all other data types, except f, this addition is ignored. For unit, a three-digit, character-type field is expected that contains a unit key from the column MSEHI in the database table T006 in uppercase letters. The system determines the number of decimal places from the column DECAN in the corresponding row in the database table T006. If the content of unit is not found in T006, the addition is ignored.
If the data type of dobj is p and has at least as many decimal places as specified by unit, and if no positions are thus cut off that are not equal to 0, then dobj is output with this number of decimal places.
In the case of data objects of type f, the addition UNIT will be treated like the addition DECIMALS (see above). Here, the number of decimal places is determined by unit.
If the addition UNIT is used with the length specification * or ** after AT, it is used first, and the output length is determined from the result.
If the addition CURRENCY is used at the same time, this is used first for data type p and then the addition UNIT is used. In the case of data type f, the addition UNIT is ignored.
Example
If no decimal places are specified for the number "PC" in T006, the output of the WRITE statement is "1234".
DATA pack TYPE p DECIMALS 4 VALUE '1234.0000'.
WRITE pack NO-GROUPING UNIT 'PC'.
</i>
REgards,
Rich Heilman
‎2006 Jun 06 7:47 AM
Hi Suchi ,
can u tell which field ur ref.for the Qty Field.
regards
Rao
‎2006 Jun 06 3:44 PM
Hi Prabhu,
iam using a z field which is like menge.
please let me how would my write should look like
this is my orginal statment.
write:/ itab-zorder,
50 itab-zmenge.
waiting for ur replies
Thanks in advance
suchi
‎2006 Jun 06 3:48 PM
Suchitra,
Check Rich's reply.
Check in your Z-table, you must have UoM field associated with your menge field. Check in the tab 'Currency/Quantity Fields' in SE11. Select that field also and store in your internal table itab. And then do this:
WRITE: itab-menge UNIT itab-uom.
Where uom is the actual field name of the UoM field in Z-table.
‎2006 Jun 06 3:49 PM
Hi suchitra,
write:/ 'zorder:',itab-zorder,
'with quantity :',itab-zquan UNIT c_un.
Here c_un is any dummy unit that you can use.
Cheers,
Bujji
‎2006 Jun 06 10:10 PM
Hi
Even i use the unit the o/p dosn't show any thing
This is my write statement
write:/ 'zorder : ', itab-zorder,
' with quantity ', itab-zmenge UNIT itab-z340b-meins.
o/p
zorder : 5700002246 with quantity 90
let me know if iam wrong.
Thanks
‎2006 Jun 06 10:14 PM
Hi
Even i use the unit the o/p dosn't show any thing
This is my write statement
write:/ 'zorder : ', itab-zorder,
' with quantity ', itab-zmenge UNIT itab-z340b-meins.
o/p
zorder : 5700002246 with quantity 90
let me know if iam wrong.
‎2006 Jun 06 10:54 PM
Suchitra,
Your o/p looks quite good. What's the problem?
Note that WRITE ..UNIT.. statement willl not output the UoM itself, it will just help output the quantity in a correct format and value.