cancel
Showing results for 
Search instead for 
Did you mean: 

Not to display 0.00 value isAdobe form instead it shoud be blank.

0 Kudos

Dear Experts,

I am developing print form using Adobe.

my form is working perfectly as per the requiement  excet one issue.  In my print form I dont want to display the 0.00 value instead it shuld be display as plak.   If any values is that in the cell then only it should display the value.

I saw few threads in SDN before posting this question.

Some one suggested that we need to change the filed to text fiel and write java.script to get this.

I followd tha same but did not get the requried result.

I want my output to look like.

                            

Thanks and Regards

Anees Ahmed Jawad

Accepted Solutions (0)

Answers (3)

Answers (3)

pavan_prabhu
Active Participant
0 Kudos

     The Java script will not work only if the field is of type currency field in the layout. But if the field is of type text field, then it should work.

And also there is a better option if Java script needs to be avoided. What you need to do is, declare the amount fields in the structure of type CHAR of sufficient decimal places corresponding to the actual Currency data element. Then the amount can be checked for the Initial value in ABAP itself and then it can be set to space.

You can follow the below steps to achieve it.

Write a test program in SE38 as below.

PARAMETERS: p_curr TYPE bp_amnt.

DATA: g_char TYPE char20. 

IF p_curr IS NOT INITIAL.
   WRITE p_curr TO g_char.
ELSE.
   g_char = ' '.
ENDIF.

CONDENSE g_char NO-GAPS.

WRITE:/ 'p_curr is', p_curr.
WRITE:/ 'g_char is', g_char.


Now execute this report. Enter the amount in selection screen. In output the entered amount is displayed in variable p_curr and the same amount is displayed in g_char but which is of type CHAR.


First enter the amount as 1000 as below.


The output will be as shown below. Both the variables are displayed and the amount format is retained in g_char variable.




Now enter the zero amount in the selection screen as below.



This time, the output of p_curr will be 0.00 but the amount of g_char will be space as shown below.


So in similar way, use the value of g_char to fill the amounts in the structure and pass it to the Adobe form. And since the Java script is avoided, the performance of the form will be better.

Florian
Active Contributor
0 Kudos

Hi Pavan,

I don't see your solution here. Just because you can do it in that way doesn't mean that it is a good way. I just refer to my very first answer here.

Anyway, I think the issue has enough solutions and let's see, if Anees needs more support.

~Florian

0 Kudos

Thanks for all your quick support.

Because of some other important deliverables, I am not looking in to this issue as testing team is also busy with this output and other things (my output in PDF is 100% coreect other then this issue). After exploring the options given by you people  I will come back.

Thanks and Regards

Anees Ahmed Jawad

pavan_prabhu
Active Participant
0 Kudos

Hello Anees,

     Write the below Java script in the Initialize event of all the 3 fields which are currently showing "0.00".

if ( this.rawValue == "0.00" )

{

     this.rawValue = " ";

}

Florian
Active Contributor
0 Kudos

I think this will not work, because of the external mask...

~Florian

pavan_prabhu
Active Participant
0 Kudos

     The Java script will not work only if the field is of type currency field in the layout. But if the field is of type text field, then it should work.

Florian
Active Contributor
0 Kudos

Hi Anees,

You just can hide the field with a small javascript statement:

It should look like this:

IF (this.field.value == "" )  <-- depends on what the initial value has

this.field.presence = "hidden";

ENDIF;

or my personal way would be

Set the condition in the interface

and do nothing in javascript

~Florian

BTW: There is an own space