cancel
Showing results for 
Search instead for 
Did you mean: 

Putting Brackets for Negative Value in SmartForms

Former Member
0 Kudos

Hi Experts,

I want to display all the negative value, in a bracket.

For e.g., The Output value from a Driver Program is 1000- or -1000. But i want to display it as (1000) and the font color should be Red.

I don't want to insert any program statement, inside smart forms, for doing this.

Whether any other formatting option is available, for doing this?

Thanks in Advance.

Vijay G

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If you don't want to do this in the Program Statement and you need to modify the internal table only in the print program.

while updating the internal table itself with the values do this.

if wa_itab-value < 0.

concatenate ' (' wa_itab-value ')' into wa_itab-value.

append wa_itab to itab.

endif.

Br,

Laxmi.

Former Member
0 Kudos

Hi.

I don't want to change my driver program, as well. Whether any other way, we can make this possible?

Former Member
0 Kudos

hi Vijay,

have u concidered my previous post. any way u have to modify the data. it can't be possible with formating options.

you can do it in the smartform GLOBAL DIFINATIONS-->INITIALIZATIONS .

if u r unable to change the ITAB structure u r using presently then create another ITAB same as existin but with extra field.

Please Close this thread.. when u r problem is solved

Reward if Helpful

Regards

Naresh Reddy K

Former Member
0 Kudos

Hi,

You can try doing by keeping an alternative conditions. In that give the conditions for that particular value in the conditions tab. if wa_itab-value < 0.

'(' &wa_itab-value& ')'.

Br,

Laxmi

Former Member
0 Kudos

But in the above case you will be able to see the sign.

Former Member
0 Kudos

hi vijay

even if you don;t want to modify the ITAB then follow the laxmi sloution.... I want to add something here

USE

<b>(' &WA_ITAB-VALUE(S)& ')'.</b> to remove the operator.

in this case u have to create 2 text elements in 1st one CONDITIONS tab give WA_ITAB-VALUE > 0. here print <b> &WA_ITAB-VALUE&.</b>

and for the second text element give the condition WA_ITAB-VALUE < 0. in this print <b>(' &WA_ITAB-VALUE(S)& ')'.</b>

hope ur problem will be solved

Former Member
0 Kudos

hi

I don't think there are formating options for this.

any way you need to modify the value either by using the program lines or modifyling the ITAB.

if you don'r want to use the program line in the table.. then modify the ITAB bye maintaining Extra char type field in the ITAb. then in the INITIALIZATION tab..

loop the itab into wa_itab.

if wa_itab-num < 0 .
concatenate '('  wa_itab-num ')' into wa_itab-chrtypfield.
else.
wa_itab-chrtypfield = wa_itab-num.
endif.
modify itab from wa_itab.
endloop.

in the table printhe char type field instad of nuber field.