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

error in fieldcat reference field for quantity

Former Member
0 Likes
1,840

hi to all experts,

in the output of an alv there is a field menge for that what will be the reference field if i give the reference field as menge and reference table mseg . Im getting the error that description not matched ....please help

5 REPLIES 5
Read only

Former Member
0 Likes
1,060

Hi,

Give field name in capital letters,

Check this

Eg.

clear fieldcat_in.

fieldcat_ln-fieldname = 'FIELD3'.

fieldcat_ln-tabname = 'ITAB1'.

fieldcat_ln-ref_fieldname = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY

fieldcat_ln-ref_tabname = 'MSEG'. "<- REF TABLE IN THE DICTIONNARY

fieldcat_ln-no_out = ' '.

fieldcat_ln-do_sum = 'X'. "SUM UPON DISPLAY

append fieldcat_ln to gt_fieldcat.

Read only

0 Likes
1,060

hi selva,

one more query can i change the menge field from packed decimal to char it is editable in alv output . for example i got the menge as 0.0002 when i changed it to 5 it should reflect as 5 not 0.0005 after calling the method checked_changed_data . is this possible

Read only

0 Likes
1,060

Hi,

U can change the data type from packed decimal to char, but u can't do total and sub-total on char field.

If u don't have any requirement on total and sub total for menge field then u can change.

Read only

kamesh_g
Contributor
0 Likes
1,060

hi

please copy paste the code where u r getting error .

field catalog rules : in quotations use capital letters for fileds .

for system fileds like sy-uname ,sy-repid dont use quotations .

if u can post ut code snippet easily can solve probelm .

Read only

Former Member
0 Likes
1,060

Mozam ,

u need to specify likewise in the filedcatalog..


fs_fcat-fieldname = 'MENGE'.
fs_fcat-qfieldname = 'MSEHI'.
modify t_fcat frm fs_fcat transporting qfieldname where fieldname = 'MENGE'.

QFIELDNAME

type- LVC_QFNAME

length- Char(30)

value range - SPACE, name of a field in the output table

Defining a reference to quantity units. The ALV links the field specified in FIELDNAME to the field for quantity units specified in QFIELDNAME . The field specified in QFIELDNAME must have a separate entry in the field catalog.

Hope this helps..

Regards,

Mdi.Deeba