‎2007 Jan 18 7:45 AM
HI EXPERTS,
I'VE CREATED A Z TABLE WHICH CONTAINS A QUANTITY FIELD "ZQTY1" WHOSE DATA ELEMENT IS MENGE_D AND ITS REFERENCE FIELD IS MEINS OF MSEG TABLE.
THE CODE AS WRITTEN BELOW:
PERFORM fill_catalog TABLES it_fieldcatalog
USING 'ITAB' 'ZQTY1' ' ' 'Quantity Sent' 'X' 'X' 'QUAN'.
FORM fill_catalog TABLES fieldcatalog STRUCTURE it_fieldcatalog
USING p_tabname
p_fieldname
p_key
p_fielddesc
p_edit
p_fix_clm
p_daty.
.
fieldcatalog-tabname = p_tabname.
fieldcatalog-fieldname = p_fieldname.
fieldcatalog-key = p_key.
fieldcatalog-seltext_l = p_fielddesc.
fieldcatalog-edit = p_edit.
fieldcatalog-fix_column = p_fix_clm.
fieldcatalog-datatype = p_daty.
fieldcatalog-col_pos = i.
APPEND fieldcatalog.
i = i + 1.
ENDFORM. " fill_catalog
THE PROBLEM IS WHEN I ENTER 20 IN EDITABLE alv IT BECOMES 0.020.
HOW SHOULD I GO ABOUT IT.
PLZ HELP.
‎2007 Jan 18 8:03 AM
As you use internal table and nor REUSE_ALV_FIELDCATALOG_MERGE nor refrerence to the internal table, but build your field catalog, you MUST explicit the link between MENGE and MEINS, QUAN and UNIT in the catalog. And both fields must appear in your internal table.
fieldcatalog-QFIELDNAME = 'MEINS'
Regards
‎2007 Jan 18 1:48 PM
I'VE TRIED PUTTING THE VALUE "MEINS" INTO THE FIELD QFIELDNAME.
I'VE ALSO TRIED CREATING MY OWN UNIT FIELD "ZMEINS" AND 'VE ASSIGNED THIS ALSO. but to no use. in both cases THE SYSTEM GENERATED ERROR COMES "Too many decimal places (maximum 0)" and its long text says "You specified 2 decimal places, but the field allows only 0 decimal places."
i gave 20.20.
how should i go about it.
plz help its urgent.
‎2007 Jan 18 1:59 PM
Hi annie,
1. I just tried the same thing, and its working perfectly fine.
2. There is no need to even specify reference field.
regards,
amit m.
‎2007 Jan 18 2:00 PM
‎2007 Jan 19 4:18 AM
I'VE TAKEN MY QUANTITY FIELD OF DATA ELEMENT "MENGE_D" AND ITS REFERENC TABLE AND REFERENCE UNIT AS "MSEG" "MEINS".
I'VE STILL NOT GOT THE OUTPUT.
HAVE I TO FILL SOME OTHER COLUMN OF FIELDCATALOG.
OR IS THE SEQUENCE WRONG.
PLZ HELP.
‎2007 Jan 19 4:25 AM
Hi,
in field catalog inttype as p and and exponent(3) = '0'.
mention the above in ur ALV this will work
Thanks
Shiva
‎2007 Jan 19 4:23 AM
Hi Annie ,
In this case what i feel is since you are giving the data type so it gets automatically converted to the default format.
So what you can try is for this specific case do not specify the data type , keep it as blank and see .
Hope this will solve the issue , please do revert back with the result.
Regards
Arun
‎2007 Jan 19 5:06 AM
I'VE TRIED BOTH WAYS:
1) WITHOUT SPECIFYING THE DATA TYPE
2.) AND WITH SPECIFYING THE INTTYPE AND EXPONENT FIELD BUT IT STILL DOESN'T WORK.
FORM fill_catalog TABLES fieldcatalog STRUCTURE it_fieldcatalog
USING p_tabname
p_fieldname
p_key
p_fielddesc
p_edit
p_fix_clm
p_daty
P_INT
P_EXP. .
.
fieldcatalog-tabname = p_tabname.
fieldcatalog-fieldname = p_fieldname.
fieldcatalog-key = p_key.
fieldcatalog-seltext_l = p_fielddesc.
fieldcatalog-edit = p_edit.
fieldcatalog-fix_column = p_fix_clm.
fieldcatalog-datatype = p_daty.
fieldcatalog-inttype = P_INT.
fieldcatalog-EXPONENT(3) = P_EXP.
fieldcatalog-col_pos = i.
APPEND fieldcatalog.
i = i + 1.
CLEAR fieldcatalog.
ENDFORM.
PERFORM fill_catalog TABLES it_fieldcatalog
USING 'ITAB' 'MATNR' 'X' 'Material Code' 'X' 'X' ' ' ' ' ' '.
PERFORM fill_catalog TABLES it_fieldcatalog
USING 'ITAB' 'ZMATDES' ' ' 'Material Description' 'X' 'X' ' ' ' ' ' '.
PERFORM fill_catalog TABLES it_fieldcatalog
USING 'ITAB' 'ZMEINS' ' ' 'UNIT' 'X' 'X' ' ' ' ' ' '.
PERFORM fill_catalog TABLES it_fieldcatalog
USING 'ITAB' 'ZQTY1' ' ' 'Quantity Sent' 'X' 'X' 'QUAN' 'P' '0'.
PERFORM fill_catalog TABLES it_fieldcatalog
USING 'ITAB' 'ZEXPVAL' ' ' 'Expected Value' 'X' 'X' 'CURR' ' ' ' ' .
PLZ HELP.
‎2007 Jan 19 5:11 AM
Hi Annie ,
How is the data comming when you display it first i.e. before you edit the content .
Does it occur only when you edit a field or in the intial display it self this is the case.
I basically tried an editable alv with data from MARD table and it does not display any such behaviour.
Regards
Arun