10-31-2011 9:59 AM
Hi All,
I have created ALV report in the output if i select material coulmn and do sorting then its giving wrong result as materials are without leading zeros and if i add leading zeros then sorting functionality working fine.
Please anyone tell why without leading zeros sorting is not working on material numbers.
Regards,
Sachin
10-31-2011 10:10 AM
What I can analyse by this is, you are using MATNR as datatype, which is CHAR type. If number of leading zeros varies then you can certainly expect this kind of results.
You might want to pass data to NUMC and try with that!
Thanks,
Naveen Inuganti
10-31-2011 11:45 AM
Hi Sachin,
Use the following addition in the field catalog. Then it will work as you want.
X_FCAT-CONVEXIT = 'MATN1'.
Hope This Helps.
Thanks
10-31-2011 12:31 PM
Hello Venkat,
I have define fieldcat type as slis_fieldcat_alv and convexit is not available in slis_fieldcat_alv.
Regards,
Sachin
10-31-2011 12:48 PM
Hi Sachin,
1. If you have used FM REUSE_FIELDCATALOG_MERGE
2. Material number should be declared as CHAR field or actual datatype
Let me know if both are ok
Vivek
10-31-2011 1:10 PM
Hi Vivek,
I have not used REUSE_FIELDCATALOG_MERGE instead i have defined fieldcat manually.
Material number field defined as dictionary type MATNR.
If I remove conversion exit then i use to get leading zeros with material number and sorting functionality works for me but without leading zeros it is giving wrong result.
Regards,
Sachin
10-31-2011 1:17 PM
Sachin,
I would suggest to use REUSE_FIELDCATALOG_MERGE. We had same problem and was solved using this FM.
Still if that is not wished for, try this:
For Material number field, set EDIT_MASK
wa_fieldcat-edit_mask = "=ALPHA"
Regards,
Vivek
10-31-2011 1:19 PM
Sachin ,
Check this:
= '==ALPHA'
If you set a conversion exit (for example, conv = ' ==ALPHA ' for function module CONVERSION_EXIT_ALPHA_OUTPUT ), you enforce output conversion for the associated output field. (See also F1 help for WRITE edit option USING EDIT MASK) .
http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649baf17411d2b486006094192fe3/content.htm
Regards,
Vivek
11-01-2011 1:31 AM
Looks like Lexicographic is activated in your system (TCode: OMSL). I'm thinking you need to create a z structure with a field like MATNR with conversion exit active (maybe a z conversion exit copied from original one) and use that as your definition for fields in your internal table.
11-10-2011 7:43 PM
Hi All,
Solved by myself.
Passing reference table and reference field name in the fieldcatlog.
Thanks all your help.
Regards,
Sachin