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

Sapscript : Printing Text In same line

Former Member
0 Likes
4,788

Hi Friends,

I have created 2 standard text.

I want to print the follwing in the same line -

First standard text + <A hard coded value> + Second standard text.

<b> I have coded like this -</b>

/: INCLUDE SLP OBJECT TEXT ID ST LANGUAGE ZH

= : 999

/: INCLUDE YEARS OBJECT TEXT ID ST LANGUAGE ZH

First two are coming in the same line but third one is coming in second line.

Please suggest.

Regards

Kishor

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,759

hii

dont use the newline character '/'

Only one control command is allowed per line

Lines with control commands are not affected by the editor formatting

<b>So do not use '/:' but use '=:'</b><b></b>

Revert back for more help

Regards

Naresh

15 REPLIES 15
Read only

Former Member
0 Likes
2,760

hii

dont use the newline character '/'

Only one control command is allowed per line

Lines with control commands are not affected by the editor formatting

<b>So do not use '/:' but use '=:'</b><b></b>

Revert back for more help

Regards

Naresh

Read only

0 Likes
2,759

then what to use ?????

Read only

0 Likes
2,759

Hi All,

'=:' displays the code as text , '/' creates a new line. to execute a command i must have to use /: ( command line )so i cannot use '=' also , this also writes the code as text.

kishor

Read only

Former Member
0 Likes
2,759

Hi,

increase your Window Size. and see ...that might be because of window size it is appearing in next window.

Regards

vijay

Read only

Former Member
0 Likes
2,759

Hi,

use =: again. do nto use '/'.

Regards,

Aswin

Read only

Former Member
0 Likes
2,759

Hi nand,

use = for the second include also and also make sure of the window size so that both the text elements atre printed in the same line.

regards,

keerthi.

Read only

Former Member
0 Likes
2,759

Hi Kishore,

Write the code like this:


/: INCLUDE SLP OBJECT TEXT ID ST LANGUAGE ZH
=: 999
=: INCLUDE YEARS OBJECT TEXT ID ST LANGUAGE 

Then it will display according to your requirement.

<i>Hope This Info Helps YOU.</i>

Regards,

Lakshmi

Read only

0 Likes
2,759

Hi Lakshmi,

Tried. It is displaying the code as text.

Can we use the format other than what available in the drop down ???

kishor

Read only

0 Likes
2,759

Hi,

what ever you gave is correct. but only thing is the window size is less. to avoid that you have to increase the size of the window so that every thing will come in one line. or else.

you need to create another window and collapse both in such a way that they should appear the in the same line.

now in one window you call one include , other window call another one.

Best thing is to increase the window size.(may be your window size is less)

Regards

vijay

Read only

0 Likes
2,759

Hi Kishore,

Yes you are right, it is displaying as text only. Then there were two ways 1.while including the text , make check mark in the check box "expand immediately" .

2. In the print program it self use read_text and pass it to the script.

<i>Hope This Info Helps YOU.</i>

Regards,

Lakshmi

Read only

0 Likes
2,759

Hi friends,

I have created single standard text including these three . Now its fine.

Thanx for your response.

kishor

Read only

0 Likes
2,759

Hi Nandkishor,

Please close the thread if your problem solved completely..,and Reward Points for helpful answers .

Regards

vijay

Read only

Former Member
0 Likes
2,759

Hi,

Probable what you can do is use two seperate windows for the standard texts and then call FM read_text separately twice for both the windows.Check that.

Thanks.

Aswin

Read only

Former Member
0 Likes
2,759

I dont think u can achieve the same in scripts...wat u can do is use "READ_TEXT" in ur program n fetch both the standard textts,...then use concatenate to get the desired text ..n use it in scripts....

last resort if u r not able to do using scripts..m curious to know too if its possible ther itself..

Read only

Former Member
0 Likes
2,759

Hii

'=:' works but try it by increasing your window size

otherwise use READ_TEXT fm

You pass it the Text Identification Details

and it will retrieve the texts into the internal table (IT_TEXTS).

Internal table to store standard texts

DATA: IT_TEXTS like T_LINE occurs o with header line.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = "Text ID

language = "Laguage

name = "Text name

object = "text object

  • ARCHIVE_HANDLE = 0

  • IMPORTING

  • HEADER =

tables

lines = IT_TEXTS "Internal table

  • EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

  • NOT_FOUND = 4

  • OBJECT = 5

  • REFERENCE_CHECK = 6

  • WRONG_ACCESS_TO_ARCHIVE = 7

  • OTHERS = 8

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

The main inputs for the FM are Text name, Language, Text ID and Text object and can be located using the following procedure.

<b>Step 1 Display the desired text with transaction (i.e. ME23)

Step 2 Show long text for a particular text (i.e. Deliver To)

Step 3 Select ‘Header’ from the Goto menu (Goto->Header). The following screen should appear displaying info needed to retrieve text using the ‘READ_TEXT’ function module (Text name, Language, Text ID, Text object)</b>

Regards

Naresh