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: 

alv list display column width not adjusting

rohit0101
Explorer
0 Kudos
807

I have added new field in vkm1 standard tcode but when the size of the column is increasing the header is not adjusting to that value size.

below is the code for filedcat:

DATA: wa_fcat like LINE OF u_kr_fieldcat.


kr_layout-colwidth_optimize = 'X'.

BREAK ibs.

CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZSEG_TOT'.
ls_fieldcat-col_pos = 113.
* ls_fieldcat-datatype = 'CURR '.
* ls_fieldcat-outputlen = 15. "comm by rohit m 15-06-2023
* ls_fieldcat-rollname = 'SBGRP_CM'.
* ls_fieldcat-sp_group = 'A'.
APPEND ls_fieldcat TO u_kr_fieldcat.

*----Added By Rohitm:addition Of Credit Limit Column From Zita_seg_cust_lm:12-06-2023:tr:DVLK913031----.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZCRED_LIMIT'.
ls_fieldcat-col_pos = 114.
* ls_fieldcat-datatype = 'CURR '.
* ls_fieldcat-outputlen = 10. "com by rohitm
* ls_fieldcat-rollname = 'SBGRP_CM'.
* ls_fieldcat-sp_group = 'A'.
APPEND ls_fieldcat TO u_kr_fieldcat.
*------Eoa Rohitm------.

LOOP at u_kr_fieldcat INTO wa_fcat.



IF wa_fcat-fieldname = 'ZZSGTXT'.
wa_fcat-no_out = ''.
endif.

IF wa_fcat-fieldname = 'KNKLI'.
"wa_fcat-column = 'Cred.Acct'.
wa_fcat-seltext_m = 'Customer A/C'.
wa_fcat-seltext_l = 'Customer A/C'.
wa_fcat-seltext_s = 'Customer A/C'.
wa_fcat-reptext_ddic = 'Customer A/C'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.
endif.



if wa_fcat-fieldname = 'KLPRZ'.
"wa_fcat-column = 'Use'.
wa_fcat-seltext_m = 'Credit limit Used %'.
wa_fcat-seltext_l = 'Credit limit Used %'.
wa_fcat-seltext_s = 'Credit limit Used %'.
wa_fcat-reptext_ddic = 'Credit limit Used %'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.
" clear wa_fcat-seltext_s .
endif.
IF wa_fcat-fieldname = 'ZTERM'.
"wa_fcat-column = 'PayT'.
wa_fcat-seltext_m = 'Payment Terms'.
wa_fcat-seltext_l = 'Payment Terms'.
wa_fcat-seltext_s = 'Payment Terms'.
wa_fcat-reptext_ddic = 'Payment Terms'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.
endif.
"clear wa_fcat-seltext_s .
IF wa_fcat-fieldname = 'CTCPC'.
"wa_fcat-column = 'Ri'.
wa_fcat-seltext_m = 'Risk Category'.
wa_fcat-seltext_l = 'Risk Category'.
wa_fcat-seltext_s = 'Risk Category'.
wa_fcat-reptext_ddic = 'Risk Category'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.
endif.
"clear wa_fcat-seltext_s .
IF wa_fcat-fieldname = 'ERDAT'.
"wa_fcat-column = 'Created On'.
wa_fcat-seltext_m = 'Order Date'.
wa_fcat-seltext_l = 'Order Date'.
wa_fcat-seltext_s = 'Order Date'.
wa_fcat-reptext_ddic = 'Order Date'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.
endif.
"clear wa_fcat-seltext_s .

"clear wa_fcat-seltext_s .
IF wa_fcat-fieldname = 'NAME1'.
"wa_fcat-column = 'Name1'.
wa_fcat-seltext_m = 'Customer Name'.
wa_fcat-seltext_l = 'Customer Name'.
wa_fcat-seltext_s = 'Customer Name'.
wa_fcat-reptext_ddic = 'Customer Name'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.
endif.
"clear wa_fcat-seltext_s .
IF wa_fcat-fieldname = 'CMPSB'.
"wa_fcat-column = 'DYNA'.
wa_fcat-seltext_m = 'Dynamic Check'.
wa_fcat-seltext_l = 'Dynamic Check'.
wa_fcat-seltext_s = 'Dynamic Check'.
wa_fcat-reptext_ddic = 'Dynamic Check'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.
"clear wa_fcat-seltext_s .
endif.
IF wa_fcat-fieldname = 'CMPSG'.
"wa_fcat-column = 'OlIt'.
wa_fcat-seltext_m = 'Oldest Open items'.
wa_fcat-seltext_l = 'Oldest Open items'.
wa_fcat-seltext_s = 'Oldest Open items'.
wa_fcat-reptext_ddic = 'Oldest Open items'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.

"clear wa_fcat-seltext_s .
endif.

IF wa_fcat-fieldname = 'KWKKC'.
"wa_fcat-column = 'OlIt'.
wa_fcat-seltext_m = 'Order Value'.
wa_fcat-seltext_l = 'Order Value'.
wa_fcat-seltext_s = 'Order Value'.
wa_fcat-reptext_ddic = 'Order Value'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.

"clear wa_fcat-seltext_s .
endif.

IF wa_fcat-fieldname = 'CSTAT'.
"wa_fcat-column = 'OlIt'.
wa_fcat-seltext_m = 'Block Reason'.
wa_fcat-seltext_l = 'Block Reason'.
wa_fcat-seltext_s = 'Block Reason'.
wa_fcat-reptext_ddic = 'Block Reason'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.

"clear wa_fcat-seltext_s .
endif.
IF wa_fcat-fieldname = 'CMPSB'.
"wa_fcat-column = 'OlIt'.
wa_fcat-seltext_m = 'Limit Full'.
wa_fcat-seltext_l = 'Limit Full'.
wa_fcat-seltext_s = 'Limit Full'.
wa_fcat-reptext_ddic = 'Limit Full'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.

"clear wa_fcat-seltext_s .
endif.

IF wa_fcat-fieldname = 'CTLPC'.
"wa_fcat-column = 'OlIt'.
wa_fcat-seltext_m = 'Class'.
wa_fcat-seltext_l = 'Class'.
wa_fcat-seltext_s = 'Class'.
wa_fcat-reptext_ddic = 'Class'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.

"clear wa_fcat-seltext_s .
endif.

IF wa_fcat-fieldname = 'CMPSG'.
"wa_fcat-column = 'OlIt'.
wa_fcat-seltext_m = 'Overdue'.
wa_fcat-seltext_l = 'Overdue'.
wa_fcat-seltext_s = 'Overdue'.
wa_fcat-reptext_ddic = 'Overdue'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.

"clear wa_fcat-seltext_s .
endif.

IF wa_fcat-fieldname = 'VBELN'.
"wa_fcat-column = 'OlIt'.
wa_fcat-seltext_m = 'Sales Order'.
wa_fcat-seltext_l = 'Sales Order'.
wa_fcat-seltext_s = 'Sales Order'.
wa_fcat-reptext_ddic = 'Sales Order'.
wa_fcat-outputlen = '15'.
wa_fcat-intlen = '15'.
wa_fcat-ddic_outputlen = '15'.

"clear wa_fcat-seltext_s .
endif.

IF wa_fcat-fieldname = 'ZBKREF'.
"wa_fcat-column = 'Cred.Acct'.
wa_fcat-seltext_m = 'Security Cheque No.'.
wa_fcat-seltext_l = 'Security Cheque No.'.
wa_fcat-seltext_s = 'Security Chq. No.'.
wa_fcat-reptext_ddic = 'Security Cheque No.'.
wa_fcat-outputlen = '20'.
wa_fcat-intlen = '20'.
wa_fcat-ddic_outputlen = '20'.
endif.

IF wa_fcat-fieldname = 'ZBANKN'.
"wa_fcat-column = 'Cred.Acct'.
wa_fcat-seltext_m = 'Bank Account Number'.
wa_fcat-seltext_l = 'Bank Account Number'.
wa_fcat-seltext_s = 'Bank Acc. No.'.
wa_fcat-reptext_ddic = 'Bank Account Number'.
wa_fcat-outputlen = '18'.
wa_fcat-intlen = '18'.
wa_fcat-ddic_outputlen = '18'.
endif.

IF wa_fcat-fieldname = 'ZBANKA'.
"wa_fcat-column = 'Cred.Acct'.
wa_fcat-seltext_m = 'Name Of Bank'.
wa_fcat-seltext_l = 'Name Of Bank'.
wa_fcat-seltext_s = 'Name Of Bank'.
wa_fcat-reptext_ddic = 'Name Of Bank'.
wa_fcat-outputlen = '60'.
wa_fcat-intlen = '60'.
wa_fcat-ddic_outputlen = '60'.
endif.

IF wa_fcat-fieldname = 'ZBRNCH'.
"wa_fcat-column = 'Cred.Acct'.
wa_fcat-seltext_m = 'Bank Branch'.
wa_fcat-seltext_l = 'Bank Branch'.
wa_fcat-seltext_s = 'Bank Branch'.
wa_fcat-reptext_ddic = 'Bank Branch'.
wa_fcat-outputlen = '40'.
wa_fcat-intlen = '40'.
wa_fcat-ddic_outputlen = '40'.
endif.

IF wa_fcat-fieldname = 'ZSEG_TOT'.
"wa_fcat-column = 'Cred.Acct'.
* wa_fcat-seltext_m = 'Seg. wise Tot'.
wa_fcat-seltext_l = 'Seg. wise Tot'.
wa_fcat-seltext_s = 'Seg. wise Tot'.
wa_fcat-reptext_ddic = 'Seg. wise Tot'.
wa_fcat-outputlen = '09'.
wa_fcat-intlen = '10'.
wa_fcat-ddic_outputlen = '10'.
ENDIF.
*----Added By Rohitm:addition Of Credit Limit Column From Zita_seg_cust_lm:12-06-2023:tr:DVLK913031----.
IF wa_fcat-fieldname = 'ZCRED_LIMIT'.
"wa_fcat-column = 'Cred.Acct'.
wa_fcat-seltext_m = 'Credit Limit'.
wa_fcat-seltext_l = 'Credit Limit'.
wa_fcat-seltext_s = 'Credit Limit'.
wa_fcat-reptext_ddic = 'Credit Limit'.
wa_fcat-outputlen = '10'.
wa_fcat-intlen = '10'.
wa_fcat-ddic_outputlen = '10'.
ENDIF.
*----Eoa Rohit---.
MODIFY u_kr_fieldcat FROM wa_fcat TRANSPORTING seltext_m seltext_l seltext_s reptext_ddic
outputlen intlen ddic_outputlen.

"APPEND wa_fcat to it_final.
ENDLOOP.

1.CORRECT SIZE

2.INCORRECT SIZE

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
715

Create a correct field catalog, at least provide

with ddic reference

  • REF_TABLE
  • REF_FIELD

without ddic reference

  • INTTYPE
  • OUTPUTLEN
  • COLTEXT
  • SELTEXT
6 REPLIES 6

raymond_giuseppi
Active Contributor
716

Create a correct field catalog, at least provide

with ddic reference

  • REF_TABLE
  • REF_FIELD

without ddic reference

  • INTTYPE
  • OUTPUTLEN
  • COLTEXT
  • SELTEXT

0 Kudos
715

Thankyou for the answer will check this.

715

rohit0101 You are replying 6 months after the answer was posted, so I can't believe you "will check this". But let see...

Sandra_Rossi
Active Contributor
0 Kudos
715

Do you mean that the problem arises only with negative sign?

Sandra_Rossi
Active Contributor
715

Your catalog seems inconsistent. Length but no type!?

Probably the standard considers that the columns without data element/domain are always positive?

If you link the column to the DDIC, it can detect automatically the correct types, lengths and detect that the negative signs are allowed. Probably it will then behave correctly.

rohit0101
Explorer
0 Kudos
715

Thannkyou for the suggestions