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

QUANTITY FIELD IN ALV

Former Member
0 Likes
4,080

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.

9 REPLIES 9
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,993

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

Read only

Former Member
0 Likes
1,993

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.

Read only

0 Likes
1,993

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.

Read only

0 Likes
1,993

Is your quantity field a QUAN field (packed, 13 or so) ?

Have you put and filled the field MEINS in your Z-table ?

Read only

Former Member
0 Likes
1,993

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.

Read only

0 Likes
1,993

Hi,

in field catalog inttype as p and and exponent(3) = '0'.

mention the above in ur ALV this will work

Thanks

Shiva

Read only

Former Member
0 Likes
1,993

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

Read only

Former Member
0 Likes
1,993

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.

Read only

0 Likes
1,993

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