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

ALV Layout

Former Member
0 Likes
963

Hi,

When I am using the following code for layout, its getting dumped when I click on Back or Exit or any button.

LV_LAYOUT-ZEBRA = 'X'.

LV_LAYOUT-BOX_FIELDNAME = 'BOX'.

Does anyone know what I am using?

The Dump is "Overwriting a protected Field".

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
936

Can you post the structure of the table being passed to the ALV function.

Also, all the options that are being passed to the ALV functions.

Is this ALV function or Grid or the OO ALV?

Regards,

-Ramesh

Can you post the structure of the table being passed to the ALV function.

Also, all the options that are being passed to the ALV functions.

Is this ALV function or Grid or the OO ALV?

Regards,

-Ramesh

7 REPLIES 7
Read only

Former Member
0 Likes
937

Can you post the structure of the table being passed to the ALV function.

Also, all the options that are being passed to the ALV functions.

Is this ALV function or Grid or the OO ALV?

Regards,

-Ramesh

Read only

0 Likes
936

Ramesh,

I am just using Function Modules not Containers.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = REPID

  • I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'

  • I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'

IS_LAYOUT = LV_LAYOUT

IT_FIELDCAT = LV_FIELDCAT[]

  • I_SAVE = 'A'

IT_EVENTS = LV_EVENTS[]

TABLES

T_OUTTAB = C_TAB.

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

0 Likes
936

Can you post me the structure of C_TAB and all the options that you are setting for LV_LAYOUT.

I am guessing that C_TAB contains a field named BOX.

Just for testing purposes, can you change that to C_BOX.

My test program works fine with both options set.

Thanks,

-Ramesh

Message was edited by: Ramesh Adusumilli

Read only

0 Likes
936

Ramesh,

My C_TAB does not contain field BOX. It contains just some 5 fields.Do you know where I am missing.

Thanks.

Read only

0 Likes
936

Aha. That my friend is the problem.

I take it you want a checkbox in the beginning.

To the ALV function, you should tell it which field you want to use as a checkbox.

Ex:

BEGIN OF C_TAB OCCURS 0,

fld1,

fld2,

fld3,

fld4,

fld5,

END OF C_TAB.

Now, you put in LV_LAYOUT = 'BOX'.

The function canot find the "field" 'BOX' in the C_TAB structure.

This should solve your problem:

BEGIN OF C_TAB OCCURS 0,

fld1,

fld2,

fld3,

fld4,

fld5,

BOX TYPE C,

END OF C_TAB.

You don't have to define the field 'BOX' in the field catalog.

Try it and let me know if it worked.

Cheers,

-Ramesh

Read only

0 Likes
936

It worked Ramesh. Thanks.

Read only

0 Likes
936

Glad that it worked.

Cheers,

-Ramesh