cancel
Showing results for 
Search instead for 
Did you mean: 

Display amount padded with * at beginning

Former Member
0 Kudos

Hi All,

I have a requirement to print amount padded with * at beginning. e.g. if the amount field is 13 + 2 places of decimals and my amount value is 68.75, then it will print '$***********68.75'. Please let me know how can i achieve this.

Thanks in advance.

Ajay

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

i belive you are printing checks,

here is what i did,

GV_AMNT(18) type c,

WRITE reguh-rwbtr TO gv_amnt LEFT-JUSTIFIED.

gv_len = STRLEN( gv_amnt ).

WHILE gv_len < 13 .

CONCATENATE '*' gv_amnt INTO gv_amnt.

gv_len = gv_len + 1.

ENDWHILE..

CONCATENATE '$' gv_amnt INTO gv_amnt.

Former Member
0 Kudos

Hi,

Thanks all for the qick reply. I wish to know if there is any code we can use within SAPSCRIPT for this type of printing. I saw below code mentioned for printing amount in words with '**' at beginning and '*' at end. I am right now working on F110_PRENUM_CHCK SAPSCRIPT changes. I also wish to know if any code is mentioned in RFFOUS_C to print amout with ''.

/ &'*** 'SPELL-WORD& &REGUD-WAERS&&' and 'SPELL-DECIMAL(2)'/100 '&***

Thanks in advance.

Regards

Ajay

Edited by: Ajay Kumar Jha on Jun 16, 2011 6:41 AM

Former Member
0 Kudos

Hi,

We can use the code in sap script like wht your mentioning. for that code prints amount in words '***'

at beginning and '***' at end. It will print like

      • SIX THOUSAND FIFTY PAISE ***

if you want to print amount with before '' use &val(F)&. it will print like

*6,000.50******

Regards,

Dhina.

Edited by: Dhina DMD on Jun 16, 2011 6:44 AM

raymond_giuseppi
Active Contributor
0 Kudos

It depends on the tool used to produce the output : is it classic listing, ALV, SapScript, Smartforms ?

e.g. &field(F*)& in Smartforms

Regards,

Raymond

Former Member
0 Kudos

HI,

Sorry for not mentioning. I am asking this for SAPSCRIPT.

Regards

Ajay

awin_prabhu
Active Contributor
0 Kudos

In sapscripts, leading spaces in a value can be replaced with a fill character. The F option is

used, and the character immediately following the F in the specification is used

as the fill character.

As Raymond suggested, print amount in below format in script.

&amount(F*)&

F stands for Fill character

  • -> fill character