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: 

Modify field catlog table without work area

Former Member
0 Kudos
88

I have a field catlog internal table g_fieldcat without header line and i need to modify field content where SELTEXT_L = 'NAME1' to SELTEXT_L = 'Vendor Name''. Kindly help me

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
70
data: wa_fieldcat like line of g_fieldcat.

read table g_fieldcat into wa_fieldcat with key fieldname = 'NAME1'.
if sy-subrc  = 0.
  wa_fieldcat-seltext_l = 'Vendor Name'.
  modify g_fieldcat from wa_Fieldcat index sy-tabix.
endif.

Regards,

RIch Heilman

4 REPLIES 4

Former Member
0 Kudos
70

you can use field symbols.

field-symbols : <fs> like line of g_fieldcat.

LOOP AT G_FIELDCAT assigning <FS>.

<FS>-SELTEXT_L = 'Vendor Name'.

ENDLOOP.

You can give condition for particular field in the loop.

for example,

IF <FS>-fieldname = 'FIELD1'.

endif.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
71
data: wa_fieldcat like line of g_fieldcat.

read table g_fieldcat into wa_fieldcat with key fieldname = 'NAME1'.
if sy-subrc  = 0.
  wa_fieldcat-seltext_l = 'Vendor Name'.
  modify g_fieldcat from wa_Fieldcat index sy-tabix.
endif.

Regards,

RIch Heilman

0 Kudos
70

RIch Heilman

Thanks it works perfect...

0 Kudos
70

Hi Rich,

For me also same problem came, I have resolved it using your solution. Thanks very much.

Regards,

Mahesh