2011 Dec 14 2:18 PM
Hi,
I want to display default value 'NA' for blank fields in ALV .I tried to populate 'NA' for blank values in internal table but it goes into dump for numeric fields and some fields are single character .pls advise.
Rgds
2011 Dec 14 2:41 PM
if u have to display 'NA' u need to have atleast 2 character field.Without that i would not be possible
2011 Dec 14 2:57 PM
ok..atleast tell me how to display default 'NA' without populating internal table for 2 char fields
2011 Dec 14 3:05 PM
If you have non-character fields or 1-character fields, then the requirement is absolutely nonsensical, isn't it? You must either convert your numerics to character and convert your 1 character fields to 2 character (or is it 3 for 'N/A'). It should be obvious to even the dumbest PhD end user that a blank field means there is no value for that column and particular entity.
2011 Dec 14 3:41 PM
ok..forget abt replacing Space with NA ,suppose there is a value 'BD' to be replaced by 'GD' in alv without modifying itab. can we achieve it ,pls tell me .
2011 Dec 14 5:05 PM
There is no way of dynamically transforming values when generating the ALV if that is what you mean...
You will just have to loop through your itab making changes to the itab that way. If you need the original value for later processing, perhaps consider including an extra field in the itab that can store the value to be displayed (GD) while keeping the actual value (BD) in another field. Then, you can make your own field catalogue to only show the display field in the ALV
2011 Dec 14 5:09 PM
How about defining the output length of the data element as 2 and use a conversion routine to display NA? Common practice of SAP: example MATNR, internal length 18, display length 40.