If you want to adjust the width for Dynpros generated by the table maintenance generator, follow this guide.
- Create a new package for the objects created in this guide (e. g. Z_ADJUST_GEN_DYNPRO_WIDTH)
- Right-click on the new package and choose "Create -> Other (1) -> SET/GET Parameter ID" and name it Z_DYNPRO_GEN_WIDTH (or whatever name you choose). This will contain the new width-value for the generated dynpros.
- Open include MSVIMF21. This include contains the ABAP coding which generates Dynpros for maintenance views. Show the implicit enhancement options via Edit -> Enhancement Options -> Show Implicit Enhancement Options and click the Enhance button (swirl icon; shortcut is Shift+F4).
- Find the end of form CREATE_DYNP_HEADER, click on the enhancement line (""""""...) and create a new enhancement implementation for coding. Insert the coding from code snippet below.
- Find the end of form CREATE_DYNP_CONT, click on the enhancement line (""""""""...) and create a new enhancement implementation for coding. Insert the coding from the other code snippet below.
- Add parameter Z_DYNPRO_GEN_WIDTH to every user who wants to generate dynpros with the adjusted width and set the parameter value to the new width you desire (200 worked well for me).
- Activate both enhancement implementations, if not done
You might want to provide a different source for the dynpro width, e. g. a customizing table or even a fixed value.
Code snippet for CREATE_DYNP_HEADER enhancement:
DATA lv_dynpro_gen_width(3) TYPE c.
" By default dynpros are limitted to a width of 83 characters.
" Modern screens are larger, so we can extend the max. width.
" The width is determined by user parameter Z_DYNPRO_GEN_WIDTH.
GET PARAMETER ID 'Z_DYNPRO_GEN_WIDTH' FIELD lv_dynpro_gen_width.
IF sy-subrc = 0.
p_header-columns = CONV #( lv_dynpro_gen_width ).
ENDIF.
Code snippet for CREATE_DYNP_CONT enhancement:
IF p_mode = '11'.
READ TABLE p_cont ASSIGNING <w_cont> WITH KEY
type = rpyty_dynp_ctype-table_control name = cont_name.
IF sy-subrc <> 0. rc = sy-subrc. EXIT. ENDIF.
DATA lv_dynpro_gen_width(3) TYPE c.
" By default dynpros are limitted to a width of 83 characters.
" Modern screens are larger, so we can extend the max. width.
" The width is determined by user parameter Z_DYNPRO_GEN_WIDTH.
GET PARAMETER ID 'Z_DYNPRO_GEN_WIDTH' FIELD lv_dynpro_gen_width.
IF sy-subrc = 0.
<w_cont>-length = CONV #( lv_dynpro_gen_width ).
ENDIF.
ENDIF.
Enjoy! Feedback is welcome.