Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP script problem

Former Member
0 Likes
708

Hi all,

I have an issue in SAP script. I have a table which have 7 quantity field of decimal type. it can have value 0 also. so if it any field is having 0 value it shud print '-' there.

i have done coding on form but its not working. Can any body please guide me how to compare decimal fields. ii have done like

if &v_amount1& = ' 0.0000 '

' - '

Else.

amount first = &v_amount1&

ENDIF.

thanks in advance.

Varu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
685

The easiest way is to activate the script debugger (SE71: Utilities->Activate debugger) and stop at the point in the script with this coding. Then take a look at the contents of your &v_amount1& field. You then can find out what should be exactly between the ' ' quotes.

Regards,

John.

6 REPLIES 6
Read only

Former Member
0 Likes
685

Hello,

Check like this:


if &v_amount1& is initial " Check here
' - '
Else.
amount first = &v_amount1&
ENDIF.

Regards,

Vasanth

Read only

0 Likes
685

no vasanth its not working.

Read only

0 Likes
685

hi ' 0.0000 '

<b>

1.check the number of decimals in ur code</b>

or it should be '0.000'

If < symbol> has the value 123456789. &symbol(3)& -> 123 &symbol(7)& -> 1234567 You can combine an output length specification with an offset specification. The specified length is then counted from the specified offset position. &symbol+4(3)& -> 567 If a length specified is greater than the current length of the value, then spaces are appended to the symbol value. You can use the character * to specify the length of a program symbol. The value of the symbol is then printed using the output length defined in the ABAP Dictionary. Syntax &symbol(*)&

<b>&v_amount(1) = '0'</b> .

means to capture <b>0</b>.000

only the integer part as 0 and make the if true .

regards,

Vijay

Read only

Former Member
0 Likes
686

The easiest way is to activate the script debugger (SE71: Utilities->Activate debugger) and stop at the point in the script with this coding. Then take a look at the contents of your &v_amount1& field. You then can find out what should be exactly between the ' ' quotes.

Regards,

John.

Read only

0 Likes
685

Thanks John its working now.

Read only

Former Member
0 Likes
685

Hi

I had the same problem i wrote like this it worked for me.

Just try this.

loop at i_final.

if not i_final-qsatz is initial.

write i_final-qsatz to i_final-qsatz1.

modify i_final.

else.

write '-' to i_final-qsatz.

endif.

endloop.

Regards

Haritha.