on 06-10-2011 9:19 PM
Hi,
I have fields in a table in a form created using SFP. When these fields have 0 or 0.0 I do not want to print any values, I just want a space to print. I've tried numerous attempts using PATTERN without any success. The fields in the interface defines these fields numeric and/or decimal.
Any help would be appreciated.
Helen
try this code
temp = your field
Replace all Occurrences of '0.0' in temp with space.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Take a variable of type c with length same as your original variable (If original variable have 10 charactes and two decimal with sign then declare new vriable text_new of type char13).
Note : this TEXT_NEW should be declared in global definition of smartform type char13.
Now take a program logic just befor this text being printed and assign value to this new variable and in program logic write a condition
clear text_new.
text_new = original_value " assigned original value
if text_new is initial.
text_new = space.
endif.
Now print this new variable.
It should definitly resolve your issue.
Please try and confirm.
Regards,
Umang Mehta
Hi,
first you do the coding as below
Replace all Occurrences of '0.0' in <variable> with space.
then
Before writing in the form you assign that value to character field
then from that character field you write into the form(text field)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Both of these solutions work if I'm working with ABAP only but the value after it is replaced with spaces is passed to a form which is developed using SAP SFP Adobe LiveCycle. Once the value is passed to the form I think the form by way of how the field is defined is changing the values to zeros instad of spaces. I believe I have to use PATTERN or FormCalc in tcode SFP to change the field from zero to spaces.
I did a test in my form and used the following FormCalc function to replace the value in a field and it works.
$record.MISCFIELDS.WS_TESTFIELD = Replace($data.data.MISCFIELDS.WS_TESTFIELD, "DOG", "COW")
I think the issue with the field I'm having a problem with is the fact that it is a field within a table. If someone can provide guidence on how to use PATTERN or the syntax for the above statement when trying to reference a value in a table I think that would solve my problem.
Regards,
Helen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The field you are defining in SFP to display numeric value, must be having some data type.
You change the data type as type character as I think it is of type numeric and hence at the time of form printing, it is taking initial value as 0, if you will take a variable with character type then will take initial value as space.
Please check and confirm.
Regards,
Umang Mehta
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.