cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with formatting on ALV component

Former Member
0 Kudos

Hello Experts

I have come across rather annoying issue with displaying initial amounts on ALV component of Web Dynpro for Abap. Basically instead of getting 0.00 I am getting blank fields. I tried several combinations (null value, retain zeros, default value etc) of context attribute settings but with no luck so far. Data type I am using for mentioned attributes is BETRH_KK. I have also tried populating fields with initial value with zero but that did not work either.

Does anyone have some idea how to solve it?

Regards

Michael

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Michael,

If everything fails You can always change the data type to char / string type and populate it with 0.00 values.

Thanks,

Abhishek

Former Member
0 Kudos

Abhishek

Thanks for your suggestion. Unfortunately I am using aggregation rule on that column (total) so I dont think its a good idea to use character/string format for that field.

Regards

Michael

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Take a look at the formatting options in the context attribute. For some data types you can use the display leading zeros formatting option:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3a/2232666aeb45f4b759848a4caf9c8b/frameset.htm

It could also be a field conversion exit on this data type. You might have create your own domain (of the same elemental data type) and use a custom field conversion exit to get the formatting exactly the way you want it.

Former Member
0 Kudos

Thomas

Thanks for your suggestions.

I have tried several things:

1. I have added following code in the WDDOINIT method of the View

DATA: nd_assessments TYPE REF TO IF_WD_CONTEXT_NODE,

nd_assessments_info TYPE REF TO IF_WD_CONTEXT_NODE_INFO,

ls_format_props TYPE WDY_ATTRIBUTE_FORMAT_PROP.

nd_assessments = wd_context->get_child_node( name = wd_this->wdctx_assessments ).

nd_assessments_info = nd_assessments->get_node_info( ).

ls_format_props-null_as_blank = ' '.

ls_format_props-condense = ' '.

nd_assessments_info->set_attribute_format_props( NAME = 'TAXBAMNT' FORMAT_PROPERTIES = ls_format_props ).

2. I have tried to manipulate displayed amounts by adding code in method WDDOMODIFYVIEW of the View. Code works perfectly fine as long as I am not trying to display zero amounts

3. I have also tried to use conversion exits for my amount data type. However I did not get far with that (tried several types with no luck). Please note that when printing zero amount in standard ABAP screen (using WRITE command) I do get expected result (0.00).

Please do share any additional advice you might have.

Regards

Michael

Former Member
0 Kudos

Thomas

Further fiddling with data types helped (without having to use conversion exits).

Thanks for sharing your ideas.

Regards

Michael

Answers (0)