cancel
Showing results for 
Search instead for 
Did you mean: 

shifting minus sign in SAP script

Former Member
0 Kudos

Hi,

I am working on SAP script which is getting called from a report.

Coding in script is as below.

Sign shifting is working for statement 'INCLUDE Z_L_NL_FIN_TOTAL OBJECT TEXT ID ST LANGUAGE &KNA1-SPRAS&'.

Issue 1:

But after that if condition is not getting checked, even if value of variable V_PERVAT1 is '0', it is getting executed and getting displayed in the print preview.

Issue 2:

And if variable V_PERVAT1 contains value, minus sign is not getting shifted to left for the include statements written after that, even though i am using same command again i.e. 'SET SIGN LEFT'.


/:	 	IF &KNA1-SPRAS& NE 'EN' AND &KNA1-LAND1& NE 'NL'.
/:	 	SET SIGN LEFT
/:	 	INCLUDE Z_L_NL_FIN_TOTAL OBJECT TEXT ID ST LANGUAGE 'EN'
/:	 	ELSE.
/:	 	SET SIGN LEFT
/:	 	INCLUDE Z_L_NL_FIN_TOTAL OBJECT TEXT ID ST LANGUAGE &KNA1-SPRAS&
/:	 	ENDIF.
/:	 	IF &V_PERVAT1& <> '           0.00' AND &V_PERVAT1& <> '           0,00'
/:	 	IF &KNA1-SPRAS& NE 'EN' AND &KNA1-LAND1& NE 'NL'.
/:	 	SET SIGN LEFT
/:	 	INCLUDE Z_L_NL_FIN_VAT1 OBJECT TEXT ID ST LANGUAGE 'EN' PARAGRAPH 'P8'
/:	 	ELSE.
/:	 	SET SIGN LEFT
/:	 	INCLUDE Z_L_NL_FIN_VAT1 OBJECT TEXT ID ST LANGUAGE &KNA1-SPRAS&
/:	 	ENDIF.
/:	 	ENDIF

please help me with these issues.

Thanks,

Archana

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Problem is solved. For character type variables, command set sign left does not work in SAP Script.

SO, in print program i used SHIFT TEXT LEFT CIRULAR so that '-' sign gets shifted to left and it is passed to script.

Former Member
0 Kudos

Hi,

I think you are using = symbol in if condition instead of that use 'EQ' at the same place. i think this should resolve or else use the &symbol(<)& this will make the sign to left.

Regards

Sarves

Former Member
0 Kudos

Hi Sarves,

I am using not equal to sign (<>) in if condition, i also tried using 'NE'. But result is still the same.

And i am not able to use &symbol(<)& as include statement is fetching some text along with the value of the variable.

Can there be any other reason for this condition fail?

Thanks,

Archana

Former Member
0 Kudos

Hi,

u can do call like &VARIABLE(<)& to get the sign on left side of the number.

Hope it helps!!

Rgds,

Pavan