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

Customizable ALV?

Former Member
0 Likes
990

Hello everybody,

it is possible to create a ALV dynamiccylly be referenzing to a strukture or a table of the dictionary.

I find it very expensive to maintain the field-catalogue in the coding.

  • Field can have a color
  • visible/not visible
  • editable
  • etc.

Is there a solution provided to maintain the fieldcatalogue via a customizing table, where the ABAP loops and defines des fieldcatalogue from the customizing-table?

Thanks

Regards

Mario

1 ACCEPTED SOLUTION
Read only

former_member585060
Active Contributor
0 Likes
943

Hi,

Try with CL_SALV_TABLE class. Search for demo programs in SE38 starting with SALV_DEMO*.

Thanks & Regards

Bala Krishna

6 REPLIES 6
Read only

former_member585060
Active Contributor
0 Likes
944

Hi,

Try with CL_SALV_TABLE class. Search for demo programs in SE38 starting with SALV_DEMO*.

Thanks & Regards

Bala Krishna

Read only

0 Likes
943

Hi Bala,

sorry, I can't find an ABAP in ALVDEMO* where the ALV is customizable. All  Settings are made in the coding.

Regards Mario

Read only

0 Likes
943

Hi Mario,

You could have achieved your functionality easily using the class: cl_salv_table. But it does not support 'EDIT' functionality. Please read documentation in SE24 for this class 'cl_salv_table'. It provides an easy example too in the docu.

please refer this doc for displaying dynamic ALV,

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50cd262d-76b3-2d10-d388-dab5abc10...

Read only

Former Member
0 Likes
943

Create a structure of the desired fields in SE11, than invoke FM LVC_FIELDCATALOG_MERGE / REUSE_ALV_FIELDCATALOG_MERGE.

Also CL_SALV_TABLE will be able to complete the fieldcat automatically if all the data types in the internal table is standard / is defined in the dictionary. Moreover making ALV OM(CL_SALV_TABLE) is a tiresome process. You can look for examples by having a search in SE38 with parameters SALV_DEMO*

Thanks, Abhinab

Read only

ThangaPrakash
Active Contributor
0 Likes
943

Hello Mario,

You can build Fieldcatalog using the FM " REUSE_ALV_FIELDCATALOG_MERGE".

You can pass either internal table or structure as below and fieldcatalog will be build in the result table.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

     EXPORTING

       i_program_name         = c_lv_repid

       i_internal_tabname     = <Internal table>    " pass this incase of internal table

       I_STRUCTURE_NAME =  <SE11 structure> "Pass this in case of structure which defined in SE11

       i_inclname             = c_lv_repid

     CHANGING

       ct_fieldcat            = itab_lt_fieldcat

     EXCEPTIONS

       inconsistent_interface = 1

       program_error          = 2

       OTHERS                 = 3.

   IF sy-subrc <> 0.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   ENDIF.


Regards,

Thanga

Read only

0 Likes
943

Hi,

Thank you all. It seems that I have to code it.

I was looking for a ready to use solution which is not available.

Regards Mario