cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynpro - Display char with leading blanks in ALV or table

Former Member
0 Kudos

Hello,

I want to display char fields with leading blanks in an webdynpro table or alv.

The first column of the table includes chars, that have leading blanks.

In the binded intern table, the chars still have those blanks.

But when they are displayed, webdynpro deleted all the leading blanks and also the blanks between the words, if there are more than one.

How can I achieve to have the formatted text still formatted?

I tried the option Do Not Compress Input but it didn't work.

I also tried to move values to string and then bind the intern table, but didn't work neither.

Thank you very much,

Florian.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I just solved the problem myself the other day.

With

LOOP AT lt_table INTO ls_table.

  TRANSLATE ls_table-column1 USING '  '.

ENDLOOP.

There are two spaces bewteen the '.

The first is a normal, wich one should be replaced.

The second is made with ALT+255 (saved space).

This space is not deleted by WebDynpro.

Thanks a lot for your answers.

Former Member
0 Kudos

Hi Florian,

Even I have the similar requirement of adding the spaces before the actual text.

I'm using concatenate statement as follows:

CONCATENATE lc_space lc_space lv_text INTO lv_text RESPECTING BLANKS.

lc_space is defined as a constant with two spaces. For time being, I have used both the spaces as normal spaces. Can you please tell me how to add the SAVED SPACE? ALT+255 did not really work for me.

As indicated above in your post, if I'm able to concatenate the saved space to a text variable, then web dynpro will not remove the saved space and as a result I should be able to get 2 spaces before my text variable.

Thanks and please help.

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Check 'Pretty Print Options ' section in this link.

https://help.sap.com/saphelp_nwmobile71/helpdata/en/3a/2232666aeb45f4b759848a4caf9c8b/frameset.htm

Hope this helps u.,

Thanks & Regards,

Kiran

Former Member
0 Kudos

Thank you very much for your reply.

I tried it, but found out this:

It does not work with a Textview Ui Element in an ALV. But I tried also, to use a TextEdit Ui Element (read only) and there it is working.

But I realized, that the default settings of formatting are okay, with TextEdit UiE the text is shown with leading blank also without using set_attribute_format_props.

But I don't want to use TextEdit Ui Elements for my solution so maybe you have another idea?

That is the code I used:

  DATA lo_node_info TYPE REF TO  if_wd_context_node_info .

  DATA lo_attr_format TYPE wdy_attribute_format_prop.

   lo_attr_format-condense = ' '.

   lo_node_info = lo_node->get_node_info( ).

   CALL METHOD lo_node_info->set_attribute_format_props

     EXPORTING

       name              = 'ATTR'

       format_properties = lo_attr_format.



former_member184578
Active Contributor
0 Kudos

Hi,

Try changing your attribute data type to NUMC and check.

Regards,

kiran