on 05-08-2009 5:27 AM
Hi All,
I am including text in SAP Script as folows:-
IF LFD_SRNUM IS NOT INITIAL.
INCLUDE TEXT_SRNUM OBJECT TEXT ID ST LANGUAGE &SY-LANGU& PARAGRAPH S1
ENDIF.
Now, the data from variable LFD_SRNUM is being printed.
This variable contains about 120 characters. But, only first 80 characters are being printed (Rest are truncated).
What code should I write so that data is continued from next line (like Wordwrap of NOTEPAD) ?
Regards,
Ashish
Hi Ashish W ,
IF LFD_SRNUM IS NOT INITIAL.
INCLUDE TEXT_SRNUM OBJECT TEXT ID ST LANGUAGE &SY-LANGU& PARAGRAPH S1
ENDIF.
Now, the data from variable LFD_SRNUM is being printed.
Firstly why LFD_SRNUM is being Printed.
This variable contains about 120 characters. But, only first 80 characters are being printed (Rest are truncated).
What is this variable are you speaking abt LFD_SRNUM
Regards,
Suneel G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashish,
First, I don't understand why you had to do a standard text in order to print a variable which is already visible in your script.
I suggest that you write something like:
S1 &lfd_srnum(70)&
S1 &lfd_srnum+70&
This will solve the overflow issue. If you really want to be geeky with this, you can create a procedure which splits this text into multiple rows and call it from the SAPscript. In there, you can also split the text when a word finishes ( so that it looks nicer).
Regards,
George
Hi George,
That is exactly what I was looking for:-
- But, as per your suggestion,
S1 &lfd_srnum(70)&
S1 &lfd_srnum+70&
would take care only of two rows
(whereas in my case data can be of any length - 120 characters is what I am getting currently)
- Also, for the second solution, it would be really great if you could explain it with an example
(Since I dont understand how I would achieve it technically)
Regards,
Ashish
Well, first of all, this is how you are calling a procedure in an ABAP program from a SAPscript:
/: PERFORM PROC_NAME IN PROGRAM Z_YOUR_REPORT
/: USING &var1&
/: USING &var2&
/: CHANGING &var3&
/: CHANGING &var4&
/: CHANGING &var5&
/: ENDPERFORM
There are numerous links even if you search on a general search engine, so I would not explain this any further.
Next, there are two issues that we need to take care of:
- unknown text size
- splitting each row when a word ends(at space I think it's sufficiently well)
Let's take care of the unknown text size first.
If this is really completely unknown and it can take from 100 to 10 000 chars, then there might be another approach that I will explain below. However, if you can reduce the size let's say to 500 chars ( around 8 rows), then you can specify 8 CHANGING parameters and have each row assigned a value in your procedure which splits the text.
If the text size is bigger, I suggest that inside the procedure, you split the text and save the result in a table of type TLINE. Then, you call the function SAVE_TEXT, giving it a name. Then you include this text in the SAPscript. And finally you delete the text with another PERFORM.
Next, splitting each row, here you have to create a small algorithm, basically saying split when you see the closest space to position X(70,140, whatever). I've written something like this last year. I don't have access to the system to get it for you, but as soon as I will, I'll post it.
Regards,
George
OR
If you don't care about separating the rows when a word ends and you just want to have this done NOW, you can just write in your standard text something like this:
S1 &lfd_srnum(70)&
S1 &lfd_srnum+70(70)&
S1 &ld_srnum+140(70)&
S1 &ld_srnum+210(70)&
.....
......
And you go on until you think you have reached a certain limit that is improbable to be reached.
Pretty hardcoded solution, but it does the job.
Regards,
George
P.S. : By the way, you can check in the paragraph format S1 the option No Blank Lines, so that you would not have to deal with 10+ blank lines when the text is only one line long.
I cannot split the text into more fields like text_1 text_2 since i am already using around 20 values for each text - each of them can go up like long text value.
so i cannot split one text_1 to multiple .. that will be more tough.
is there any other way to do it ? to get full 255 chars of text.
I did not get the idea of save_text and delete it .. how i am going to print it ?
Thanks,
Mahesh
Hi,
Check the window size. Try increase the window size and test it,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Avinash,
Increasing the Window size wouldnt be a solution, since the text can be of any length.
What I want is, once the text reaches the window border, it should continue from the next line.
(Presently it is being truncated at the window border - it doesnt continue from next line)
Regards,
Ashish
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.