cancel
Showing results for 
Search instead for 
Did you mean: 

check that a text is not found in Sapscript

Former Member
0 Kudos

Hi experts;

Its my first message on this forum, hope I'll be well come.

my question is how to check that a text is not found in sapscript without display it.

I use &SAPSCRIPT-SUBRC&.

my source code is:

/: INCLUDE &VBDKA-TDNAME& OBJECT VBBK ID ZDTM LANGUAGE &VBDKA-SPRAS& " I dont want to display it

/: IF &SAPSCRIPT-SUBRC& ' 0'

  • Performance DTM réalisée

/: ENDIF

I want that if the text existes I show text "Performance DTM réalisée", else show blank

and I don't want to modifie the program associated.

thanks advance.

Edited by: Mohamed Bachir KADRI on May 19, 2011 4:40 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Call subroutine created in a new subroutine pool which will get the text object details and returns the existence of the text object and include it ( /: PERFORM <form> IN PROGRAM <prog>... )just before the IF condition. Based on the returned valued you can display the needed text.

Former Member
0 Kudos

hi Mr.

thanks for your speed answer;

I don't want to create a new subroutine (Perform); is there another solution using sapscript only (don't go to program)?

if it not existe Im obliged to create new progam Ztext.

thank you again.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I´m not sure, but do you have forgotten the operand?

/: IF &SAPSCRIPT-SUBRC& ' 0'

/: IF &SAPSCRIPT-SUBRC& = '0'

Regards,

Christian

Former Member
0 Kudos

Hi christian;

I dont forget that sign '=' coz it work with this syntax (you can try it)

/: IF &SAPSCRIPT-SUBRC& ' 0'

Now I want to test if the text is empty or not without display it on the form.

regards.

Mohamed.

Former Member
0 Kudos

OK, sorry for my post, now I have learned something new ))

I haven`t tried this before and have written the post in the train where I have no connect to a SAP system.

Regards,

Christian

Former Member
0 Kudos

Hi,

If you use INCLUDE statement in script editor, it will always display the text on output layout. The functioning of the INCLUDE is same READ_TEXT function module.

Anyway, you have to either write a perform routine in script editor or you can call READ_TEXT fm in your print prgm. if you finds it through FM (Means sy-subrc = 0 in print prgm),, put a TEXT (Whatever you have to) in a variable and print on layout.

Regards,

Lokesh

Former Member
0 Kudos

hi experts;

thankx for all your answers.

I think that the only solution is to create a perform routine in the program associated.

thanks again.