2014 Nov 06 10:28 AM
Hi Gurus,
Does FIELDNAME not allowed lower case? Please refer to the below code.
'Cause I meet the weird situation, totalofsoqtys will show the value of MATNR, and the left 4 fields also be the same with the value of TOTALOFMOQTYS.
Could anyone share with me the cause? Thanks.
***************************************************************************************
FORM FIELDS .
DATA: V_COL TYPE I.
REFRESH I_FIELDCAT_ALV.
V_COL = 0.
PERFORM SET_FIELDS USING 'MATNR' 'Material'.
PERFORM SET_FIELDS USING 'totalofsoqtys' 'SO qty'.
PERFORM SET_FIELDS USING 'TOTALOFMOQTYS' 'MO qty'.
PERFORM SET_FIELDS USING 'totalOfPoQtys' 'PO qty'.
PERFORM SET_FIELDS USING 'totalOfInventory' 'Stock'.
PERFORM SET_FIELDS USING 'totalOfMMDoc' '261 qty'.
ENDFORM. " FIELDS
FORM SET_FIELDS USING P_IN_FNAME P_IN_SELTEXT.
CLEAR I_FIELDCAT.
ADD 1 TO V_COL .
I_FIELDCAT-COL_POS = V_COL .
I_FIELDCAT-FIELDNAME = P_IN_FNAME .
I_FIELDCAT-SELTEXT_L = P_IN_SELTEXT .
i_fieldcat-LOWERCASE ='X'.
APPEND I_FIELDCAT TO I_FIELDCAT_ALV .
CLEAR I_FIELDCAT.
ENDFORM . "SET_FIELDS
Jamie
2014 Nov 06 10:37 AM
Hello.
Only caps are allowed.
To find out any inconsistency in ALV, just press SHIFT button and double click the right mouse button in the blank area.
Regards.
2014 Nov 07 1:50 AM
Hi K.Arun,
Yes, I know it only allowed uppercase, I just wanna sure about that I can't assign lowercase into fieldname. Thanks
2014 Nov 06 1:21 PM
Pass the ref_tabname and ref_fieldname also to the field catalog
I_FIELD_CAT-REF_TABNAME = 'MSEG'.
I_FIELD_CAT-REF_FIELDNAME = 'MENGE'.
I_FIELD_CAT-LOWERCASE = 'X'.
I_FIELD_CAT-QFIELDNAME = 'MEINS'.
2014 Nov 06 4:48 PM
Hi.
Probably you'll have to check out DOMAIN type.
From SE11 check out your Field Domain.
Here you can see a flag LOWERCASE in the section Output Characteristics (definition). You should activate this.
Hope to help.
BYe
Rob
2014 Nov 07 2:05 AM
Hi Rob,
After I tick the flag LOWERCASE and activate it, it doesn't work, also get the value from the preceding field...
Any help? Thanks.
2014 Nov 06 5:04 PM
Hi,
the only field not valorized that i see is TABLENAME.
are you sure that in your internal table there are the correct values?
could i see your internal table (alv table) before that you call the output?
let me know,
AI
2014 Nov 07 2:09 AM
Hi AI,
Yes, it got the correct data that I see on the debug screen .
2014 Nov 06 7:14 PM
Hi,
You can define filed type for that field as CHAR18 and convert to lower case.
Or
You can define new domain with same characteristics as MATNR and check box for lowercase.
Create new data element with new domain. Use new data element as type for the field which you want to display.
Santosh
2014 Nov 10 11:06 AM
Ok. Well there's something not clear in your code. You declare the V_COL variable as local in FORM FIELDS and you use it like a global variable in FORM SET_FIELDS. That shouldn't be declared in such way.
By the way I suggest you this code for your output so you'll not have to configure manual fieldcatalog:
DATA: lr_func TYPE REF TO CL_SALV_FUNCTIONS_LIST.
DATA : lt_columns TYPE REF TO cl_salv_columns_table,
lr_column TYPE REF TO cl_salv_column_table.
DATA: gd_alv_table TYPE REF TO cl_salv_table.
* Create ALV grid instance
TRY.
CALL METHOD cl_salv_table=>factory
* EXPORTING
* LIST_DISPLAY = IF_SALV_C_BOOL_SAP=>FALSE
* R_CONTAINER =
* CONTAINER_NAME =
IMPORTING
r_salv_table = gd_alv_table
CHANGING
t_table = gt_yourtable "YOUR global internal table
"Functions
lr_func = gd_alv_table->get_functions( ).
lr_func->set_all( ).
*- Get all the Columns
lt_columns = gd_alv_table->get_columns( ).
*- Set Column optimization
lt_columns->set_optimize( C_X ).
lr_column ?= lt_columns->get_column( 'MATNR' ).
lr_column->set_lowercase( value = if_salv_c_bool_sap=>true ).
gd_alv_table->display( ).
CATCH cx_salv_msg .
CATCH cx_salv_not_found.
ENDTRY.
Let me know if this can help you.
Bye