2010 Apr 21 3:57 PM
Hi!
I created a transportation schedule program which finally prints the output onto a smartform. There is a text editor box in the output from where the text eneterd is read onto the form. I decalred a variable as buffer where I concatenate all the text read line by line form the internal table having text and pass that onto the form which prints it. My problem is that even though I have several linesin the text box , it just collects only first few lines and after that it cuts of the lines. In debugging mode I saw a message when I tried increasing teh text in debugging mode , it siad only 255 chars are allowed, dont know why or wheer I am going wrong. PLease help.
Thanks
FORM print_sched .
DATA: ltp_func TYPE rs38l_fnam. " Name of Function Module.
LOOP AT TA_TLINE.
CONCATENATE LTP_BUFFER TA_TLINE-TDLINE INTO LTP_BUFFER RESPECTING BLANKS .<<<<<<<<Here
ENDLOOP.
CONDENSE LTP_BUFFER.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSD_TRANS_SCHED'
IMPORTING
fm_name = ltp_func
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION ltp_func
EXPORTING
tp_vttk = vttk
tp_sname = tp_sname
tp_date = oia05-schddt
buffer = ltp_buffer
TABLES
ita_transch = ta_transch
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " PRINT_SCHED
Hi!
I created a transportation schedule program which finally prints the output onto a smartform. There is a text editor box in the output from where the text eneterd is read onto the form. I decalred a variable as buffer where I concatenate all the text read line by line form the internal table having text and pass that onto the form which prints it. My problem is that even though I have several linesin the text box , it just collects only first few lines and after that it cuts of the lines. In debugging mode I saw a message when I tried increasing teh text in debugging mode , it siad only 255 chars are allowed, dont know why or wheer I am going wrong. PLease help.
Thanks
FORM print_sched .
DATA: ltp_func TYPE rs38l_fnam. " Name of Function Module.
LOOP AT TA_TLINE.
CONCATENATE LTP_BUFFER TA_TLINE-TDLINE INTO LTP_BUFFER RESPECTING BLANKS .<<<<<<<<Here
ENDLOOP.
CONDENSE LTP_BUFFER.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSD_TRANS_SCHED'
IMPORTING
fm_name = ltp_func
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION ltp_func
EXPORTING
tp_vttk = vttk
tp_sname = tp_sname
tp_date = oia05-schddt
buffer = ltp_buffer
TABLES
ita_transch = ta_transch
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " PRINT_SCHED
2010 Apr 21 5:23 PM
Why don't you try a search in SCN "Declare string more than 255 characters".
Its discussed lots of times.
2010 Apr 21 5:38 PM
Yes , tahst correct , I did go through those posts but the problem with my thing is that while I am looping through the
LOOP AT TA_TLINE.
CONCATENATE LTP_BUFFER TA_TLINE-TDLINE+0(48) INTO LTP_BUFFER RESPECTING BLANKS .
ENDLOOP.here itself the ltp_buffer dosent take in all the texts, theer are actually 9 lines of text in the ta_tline table, it concatenates only 5 lines and after that its not doing , so finally in lktp_buffer I am getting only half of teh text . I want to get all the text in that ltp_buffer but its not coming on here itself. I ahve passed this ltp_buffer itself in my smartform to print so it prints only half of te text.
Thanks
2010 Apr 21 7:15 PM
You say it won't take more than 255 characters, but you haven't provided the data declaration?? And you haven't said which function module is actually being called.
Rob
Edited by: Rob Burbank on Apr 21, 2010 2:16 PM
2010 Apr 21 9:47 PM
LTP_BUFFER type string. Thats is what I ahve declared and teh function module called is mentioned in the code above as mentioned , bsically its calling the smartforms and its FM. The problem is that its not concatinating all of the lines from the internal table ta_tline, only half of teh text is concatenated until 255 char. I wanted to know why is it not taking all of them present there.
Thanks
2010 Apr 21 9:51 PM
No - I meant - what is the value of ltp_func?
OK - I see. It's your Smartform FM. How is this declared in that FM?
Rob
Edited by: Rob Burbank on Apr 21, 2010 4:55 PM
2010 Apr 21 10:32 PM
Are you saying that the CONCATENATE doesn't work? If so, that's incorrect. It does.
Rob
2010 Apr 21 11:39 PM
The FM works fine , teh concatenate also works fine but at the end of concatenation it shows up only 255 chars, even in debug mode if I try increasing it wont accept , I beleive its declkared as string so maybe thats why but I have no idea how to do it the other way so that text of any lenght it takes can be concatenate dinto one and printed.
Thanks
2010 Apr 22 2:00 PM
>
> ... teh concatenate also works fine but at the end of concatenation it shows up only 255 chars,
Which is it? does it work or not?
Rob
2010 Apr 22 6:49 PM
NO , it does not work , I meant it goes through the loop but at teh end of loop only 255 chars come in . So it does not take in all the text . I wnat all teh text to come in.
IT does not work.
Thanks,
2010 Apr 22 6:55 PM
So after:
LOOP AT TA_TLINE.
CONCATENATE LTP_BUFFER TA_TLINE-TDLINE INTO LTP_BUFFER RESPECTING BLANKS .<<<<<<<<Here
ENDLOOP.There are only 255 characters in LTP_BUFFER. Is that correct?
Rob
2010 Apr 22 8:13 PM
2010 Apr 22 8:22 PM
Please run this and let me know the result. You will have to scroll the output right.
report ztest message-id 00 line-size 520.
data: begin of itab occurs 0,
tdline type tdline,
end of itab.
data: buffer type string.
itab-tdline = 'From the information contained in your message to us,'.
append itab.
itab-tdline = 'we conclude that this is a Consulting issue, and not a'.
append itab.
itab-tdline = 'product-related issue. The issue you have reported can'.
append itab.
itab-tdline = 'be solved using the online help, SAP Notes, WebEx '.
append itab.
itab-tdline = 'sessions, the knowledge database, and so on'.
append itab.
itab-tdline = 'To ensure that we can provide you and other customers '.
append itab.
itab-tdline = 'with the best support, and to reduce processing times,'.
append itab.
itab-tdline = 'we recommend that you check all of the information'.
append itab.
itab-tdline = 'available to you before opening a message.'.
append itab.
itab-tdline = 'We look forward to working with you again in the future'.
append itab.
loop at itab.
concatenate buffer itab-tdline into buffer respecting blanks.
endloop.
condense buffer.
write: /001 buffer.Rob
2010 Apr 22 9:02 PM
Yes , it does show me the entire text till the end . This does bring in all the text , but I dont understnd why its not doing it my program . I have checked in debugging mode and it brings in just a part of the text not the whole text.
Thanks.
2010 Apr 22 9:06 PM
I suggest you do what I did. afterthe LOOP, WRITE the field. Make sure the report is wide enough to display the full width you want.
Rob
2010 Apr 22 9:16 PM
Well I could have done that , but I am not writing the report in the output as such , instead when the program is run it outputs teh details and on left there is a text editor box where we input the text . This text is then saved and after that when we click on the print tab it reads teh text and copies this very text onto a Notes window in the smartform . I ahve checked the size of the Notes window and its large enough to take in double the text that I have entered , so there is no spacing issue at all , yet the entire text is not copied onto the form.
Thanks
2010 Apr 22 9:20 PM
2010 Apr 22 9:22 PM
2010 Apr 22 9:27 PM
I did that and ran the report , it still did not take in all the text , it says it can take only 255 units of the text for output . Half of the text were left behind.
Thanks.
2010 Apr 22 9:31 PM
We're not looking at the SmartForm, just the output from the WRITE.
Rob
2010 Apr 22 9:36 PM
Its not bringing in all teh text in after teh write statment in the output. Only half of teh text shows up.
Thanks
2010 Apr 22 9:39 PM
2010 Apr 22 9:43 PM
This is a module pool program and I dont have any line size specified on here in the program .
Thanks
2010 Apr 22 9:43 PM
2010 Apr 22 9:44 PM
With data type c you can actually split the data upto the line size and print the remaining data on the next line...
2010 Apr 22 9:47 PM
I did try using that too and it did bring me in the complete text onto the output form , but then I had a different problem with that , the line was ending abrubtly , men words ending on the line eg: "insatlling" was splitting into two word if the line was chnaging to inst and then next line started wit "alling".
data: ltp_buffer1 type tchar255,
ltp_buffer2 TYPE char255,
ltp_buffer3 TYPE char255.
data: w_len type i,
w_len1 TYPE i.
ta_prevl[] = ta_tline[].
LOOP AT TA_TLINE.
ltp_buffer3 = ta_tline-tdline.
w_len = 80 - strlen( ltp_buffer2 ).
w_len1 = strlen( ltp_buffer3 ).
IF w_len > w_len1.
CONCATENATE LTP_BUFFER2 TA_TLINE-TDLINE INTO LTP_BUFFER2 SEPARATED BY space.
SHIFT LTP_buffer2 LEFT BY 1 PLACES.
ELSE.
IF w_len EQ 0.
CONCATENATE LTP_BUFFER2 TA_TLINE-TDLINE INTO LTP_BUFFER2 SEPARATED BY space.
ELSE.
CONCATENATE LTP_BUFFER2 TA_TLINE-TDLINE+0(w_len) INTO LTP_BUFFER2 SEPARATED BY space.
ENDIF.
APPEND ltp_buffer2 to ltp_buffer1.
CLEAR ltp_buffer2.
CONCATENATE LTP_BUFFER2 TA_TLINE-TDLINE+w_len INTO LTP_BUFFER2 SEPARATED BY space.
ENDIF.
ENDLOOP.
CONDENSE ltp_buffer2.
APPEND ltp_buffer2 to ltp_buffer1.
2010 Apr 22 9:48 PM
You have to LEAVE TO LIST PROCESSING.
It doesn't really matter. The full data should be there. The problem is likely that the SmartForm FM cannot handle the text more than 255 characters. You should take the first advice you got and search the forums for Smartform+255.
Rob
2010 Apr 23 12:13 AM
Hello,
Smartform does not print more than 255 characters for STRING type variables.
You just break the string into pieces of 255 or whatever, store it in a internal table of type something like TDLINE, loop it and and print it.
Make sure, in the text element you are giving START as - A (Append Directly)
2010 Apr 23 11:38 AM
Hi,
You can use LCHR data type.
LCHR: Character string of any length, but has to be declared with a minimum of 256 characters. Fields of this type must be located at the end of transparent tables (in each table there can be only one such field) and must be preceded by a length field of type INT2. If there is an INSERT or UPDATE in ABAP programs, this length field must be filled with the length actually required. If the length field is not filled correctly, this may lead to a data loss in the LCHR field! A fields of this type cannot be used in the WHERE condition of a SELECT statement.
Refere this link for more details.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cf/21f2e5446011d189700000e8322d00/content.htm
See if its useful.
2010 Apr 23 2:26 PM
You see, you've made the same mistake you quite often make when you post your questions. Your program does something wonky; you think you see a problem and you frame your question in terms of what you think the problem is rather than the actual behavior of the program.
Then you remain focused on that and concentrate on answers that try to solve what you think is the problem.
When responders answers don't work exactly as promised, rather than trying to do further analysis and figure out what is going on, you just ask another then another then another follow up question. You're questions tend to be like this one; they go on and on without much thought on your part.
Given that you have so many posts in the forum, in the future, I'd really like to see some evidence that you have:
a) thought about your problem
b) tried to solve it before asking here
c) searched for answers before asking here.
Rob
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |