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

Variable in SAPScript standard text

Former Member
0 Likes
1,163

Dear All,

Can we call a variable from SAPScript? For eg. standard text ZTEST has a text "My Name is &NAME&" in it. I want to pass value ATANU from SAPScript so that final output contains "My Name is ATANU". Is it possible?

Best wishes,

Atanu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
869

I hope you can do that. Before calling standard text first you have the assign the value

Regards

Sasi

6 REPLIES 6
Read only

Former Member
0 Likes
870

I hope you can do that. Before calling standard text first you have the assign the value

Regards

Sasi

Read only

0 Likes
869

Dear Sasikumar,

I am really looking for a quick solution. Do you have anything in mind that can be of help?

Best wishes,

Atanu

Read only

0 Likes
869

Just try,

Your standard text 'Nametxt' contains My name &Name&

In print program/ you define 'Name = 'xxxxxx' or in the sapscript

than call the standard text like include 'nametxt' lang......

Regards

Sasi

Read only

0 Likes
869

It has not worked. I have already tried that. You will have to give object ID. I am really interested how to pass the value to the standard text.

Best wishes,

Atanu

Read only

0 Likes
869

You try like this

/: PERFORM GETTOTVAL IN PROGRAM Z_TEST
/: CHANGING &FINAL&
/: ENDPERFORM
/: INCLUDE Z_TEST OBJECT TEXT ID ST LANGUAGE EN

In Se38 Program :

FORM GETTOTVAL TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY. "#EC CALLED
DATA : VAL(10) TYPE C.
SELECT SINGLE EBELN FROM EKKO INTO VAL .
READ TABLE OUT_TAB WITH KEY NAME = 'FINAL'.
IF SY-SUBRC IS INITIAL..
OUT_TAB-VALUE = VAL.
MODIFY OUT_TAB INDEX SY-TABIX.
ENDIF.
ENDFORM.

In SO10(Standard Text)

This is standard text &FINAL& only 

O/P : This is standard text 8378377 only

Regards

Sasi

Read only

0 Likes
869

Hi Sasi,

Just excellent. I will give you full 10 points.

Best wishes,

Atanu