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

field catalog macro

Former Member
0 Likes
1,829

hi to all experts ,

im writing a macro to populate the field catalogue

but facing this problem

DEFINE m_fieldcat.
    add 1 to wa_fcat-col_pos.
    wa_fcat-checkbox.
    wa_fcat-fieldname.
    wa_fcat-seltext_m.
    wa_fcat-edit.
    wa_fcat-reftabname.
    append wa_fcat to it_fcat.
    CLEAR wa_fcat.

but when passing 'X' to checkbox.

m_fieldcat : 'X' 'CHECKBOX''SELECTION' 'X' ' ' .

im getting an error message that unable to intrepret "X" comma or spelling error .

help me out of this

1 ACCEPTED SOLUTION
Read only

kiran_k8
Active Contributor
0 Likes
1,019

Khan,

Do it this way



DEFINE m_fieldcat.
    itfieldcat-fieldname = &1.
    itfieldcat-col_pos = &2.
    itfieldcat-seltext_l = &3.
    itfieldcat-emphasize = &4.
    itfieldcat-outputlen = &5.
    append itfieldcat to itfieldcat.
    clear itfieldcat.
END-OF-DEFINITION.


  m_fieldcat 'AENNR'    '' 'Change Number'  '' 12.
  m_fieldcat 'REVLV'    '' 'Revision Level' '' 02.
  m_fieldcat 'TEXT1'    '' 'Description'    '' 250.

K.Kiran.

4 REPLIES 4
Read only

kiran_k8
Active Contributor
0 Likes
1,020

Khan,

Do it this way



DEFINE m_fieldcat.
    itfieldcat-fieldname = &1.
    itfieldcat-col_pos = &2.
    itfieldcat-seltext_l = &3.
    itfieldcat-emphasize = &4.
    itfieldcat-outputlen = &5.
    append itfieldcat to itfieldcat.
    clear itfieldcat.
END-OF-DEFINITION.


  m_fieldcat 'AENNR'    '' 'Change Number'  '' 12.
  m_fieldcat 'REVLV'    '' 'Revision Level' '' 02.
  m_fieldcat 'TEXT1'    '' 'Description'    '' 250.

K.Kiran.

Read only

Former Member
0 Likes
1,019

hi kiran if i have to use checkbox

Read only

mvoros
Active Contributor
0 Likes
1,019

Hi,

obviously you don't know how to use macro. Why don't you start with reading documentation for ABAP statement DEFINE? It has a nice example of simple macro with good explanation. You should try to understand solution for your problem, not just copy and paste solution from different sources such as this forum.

Good luck

Read only

Former Member
0 Likes
1,019

thanks for u r reply.....