Application Development 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: 

SAP ALV wa_fieldcat-ref_tabname ? No table?

Former Member
0 Kudos
2,027

Hey friends !

My question is when we display a field in ALV i m using the following code

wa_fieldcat-fieldname = ' '.

wa_fieldcat-ref_tabname = ' '.

wa_fieldcat-outputlen = .

wa_fieldcat-tabname = ' '.

wa_fieldcat-seltext_m = ' '.

APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.

repeatidly for all fields ..

Now , if i want to add a field which is ""not a field of any database TABLE"" but we have defined it under types .

So My question is what I give in the

wa_fieldcat-ref_tabname

if we do not have any database table for that ...

while debugging im getting the correct value for it but it is not displaying the same in ALV ... pLS SUGGEST

4 REPLIES 4

Former Member
0 Kudos
175

Hi,

No need to pass ref table name, just pass wa_fcat-fieldname - field declared in structure

wa_fcat-tabname - internal table name

wa_fcat-seltext_m - this to display field label in output

Regards,

Ravi

Former Member
0 Kudos
175

hi

u doesnt need to pass table name u can use below code

wa_fcat-fieldname - field declared in structure

wa_fcat-tabname - internal table name given

wa_fcat-seltext_m - text to be display field label in output

regards,

maddy rockstar

0 Kudos
175

Thanks for your explanation.. It was useful to me.

Former Member
0 Kudos
175

Hi,

Please find about the reference field and and reference table as mentioned below:

REF_FIELD:

You must fill this field if:

u2022 the output table field described by the current entry in the field catalog has a corresponding field in the Data Dictionary and

u2022 the field name in the output table is not identical to the field name of the field in the Data Dictionary.

If the field names are identical, it is sufficient to specify the DDIC structure or table in field REF_TABLE of the field catalog.

REF_TABLE:

You must fill this field only if the output table field described by the current entry in the field catalog has a corresponding entry in the Data Dictionary. Using this assignment, the ALV Grid Control can copy the text for the column header from the Dictionary.

Thanks,

Renuka S.