on 06-18-2009 7:07 PM
I have a SAPScript form with multiple paragraphs. In the original version I put a footnote at the bottom of a page by doing something like:
>/E FOOT_NOTE
>/: BOTTOM
>B1 <NR><I0><HL><IT> Some fixed text.</>
>/: ENDBOTTOM
That worked correctly. Now I am changing the form so that a number of paragraphs may or may not appear at the bottom of the page. Since I donu2019t know which paragraph may be first, I tried creating two new paragraphs:
>/E START_BOTTOM
>/: BOTTOM
>/*
>/E END_BOTTOM
>/: ENDBOTTOM
I call START_BOTTOM, then conditionally call whatever paragraphs are needed and finally call END_BOTTOM.
The problem is that the paragraphs simply continue on from the last line that was printed, not at the end of the page.
(I had also tried putting:
>/E START_BOTTOM
At the beginning of each paragraph that could appear at the end, and it worked to a point u2013 each paragraph appeared at the end, but overwrote whatever previous paragraphs were there.)
Can anyone help me with controlling my BOTTOM?
Thanks
Rob
I'm glad that you still remember the solution
I have tried to overcome this error of the BOTTOM .. ENDBOTTOM but no luck yet. I got the same results as you got with all options. I tried to do it by providing this commands from the program using the CONTROL_FORM but as soon as I split the command, it treats that include as the normal text, not the bottom text.
data: la_command type char100.
la_command = 'BOTTOM'.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = la_command.
concatenate '''' 'A1' '''' into la_command.
concatenate 'INCLUDE ZTEST_NP OBJECT TEXT ID ST PARAGRAPH '
la_command into la_command separated by ' '.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = la_command.
The only option, I can think of, is to have some play around with the Include Text. I am not sure, how we would do it.
/: BOTTOM
/: INCLUDE ZTEST_WRAP_TEXT ...
/: ENDBOTTOM
Regards,
Naimesh Patel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naimesh - as I recall, the earlier problem was with PROTECT/ENDPROTECT. I had assumed that both the PROTECT and the ENDPROTECT had to be in the same paragraph. You pointed out that this was incorrect.
However, I think we are seeing that it is true for BOTTOM/ENDBOTTOM.
(Using CONTROL_FORM didn't work.)
Thanks to both for taking the time to look into it.
Rob
Edited by: Rob Burbank on Jun 18, 2009 5:16 PM
Yes that's true, that Split in BOTTOM command doesn't work same as it works with the PROTECT.. ENDPROTECT.
But, after some research I got success.
Don't create any element in your MAIN window for BOTTOM / ENDBOTTOM. Use the FM WRITE_FORM_LINES to append entire BOTTOM .. ENDBOTTOM lines. Like:
data: la_head like THEAD,
lt_lines type standard table of TLINE,
la_lines like line of lt_lines.
select single * from stxh into la_head
where TDOBJECT = 'FORM'
and TDNAME = 'ZTEST_WATERMARK'
and TDID = 'DEF'
and TDSPRAS = sy-langu.
* Bottom Start
la_lines-tdformat = '/:'.
la_lines-TDLINE = 'BOTTOM'.
append la_lines to lt_lines.
* Generic Text
la_lines-tdformat = '*'.
la_lines-TDLINE = 'This is BOTTOM'.
append la_lines to lt_lines.
* Include Text1
la_lines-tdformat = '/:'.
concatenate '''' 'A1' '''' into la_lines-TDLINE.
concatenate 'INCLUDE ZTEST_NP OBJECT TEXT ID ST PARAGRAPH '
la_lines-TDLINE into la_lines-TDLINE separated by ' '.
append la_lines to lt_lines.
* Include Text1
la_lines-tdformat = '/:'.
concatenate '''' 'A1' '''' into la_lines-TDLINE.
concatenate 'INCLUDE ZTEST_NP1 OBJECT TEXT ID ST PARAGRAPH '
la_lines-TDLINE into la_lines-TDLINE separated by ' '.
append la_lines to lt_lines.
* Bottom End
la_lines-tdformat = '/:'.
la_lines-TDLINE = 'ENDBOTTOM'.
append la_lines to lt_lines.
* Append lines to MAIN
CALL FUNCTION 'WRITE_FORM_LINES'
EXPORTING
FUNCTION = 'APPEND'
header = la_head
* TYPE = 'BODY'
WINDOW = 'MAIN'
tables
lines = lt_lines
EXCEPTIONS
FUNCTION = 1
TYPE = 2
UNOPENED = 3
UNSTARTED = 4
WINDOW = 5
BAD_PAGEFORMAT_FOR_PRINT = 6
SPOOL_ERROR = 7
CODEPAGE = 8
OTHERS = 9
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Naimesh Patel
@ Naimesh - it looks like what you try will work; however, I am under some time constraints here. The print program is rather complex in how it determines what to print where. The original version mostly worked. The user asked if it would be possible to combine a number of paragraphs at the bottom of the page. It looked easy so I said I would give it a try. But I don't think I can get all the changes in and tested soon enough for them. But I will try to keep this in mind for the next round of changes (probably in a year or so).
@Frank - I think your idea is a simplified version of Naimesh's idea. I will be looking at both sometime in the not too distant future.
Thanks to everyone for their help.
Rob
For completeness sake:
The behavior didn't seem reasonable to me, so I thought about sending it to OSS. In preparation for that, I created a small SAPScript form with BOTTOM and ENDBOTTOM in different paragraphs. I then did a check of the texts. The check returned an error: Control commands were not closed within the text element. So I decided to try again with PROTECT and ENDPROTECT. This time the check returned only a warning: Control commands were not closed within the text element.
However, it did allow me to activate.
So it may not seem reasonable, but SAP knows all about it and is expected behavior.
Waaah!
Rob
Edited by: Rob Burbank on Jun 19, 2009 5:39 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> Can anyone help me with controlling my BOTTOM?
I'd have some tips in this area, but the issue is solved already.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
maybe i am thinking to easy about (you are both real super cracks)
you want to print several paragraph at the bottom by conditions.
May be it is possible to put your conditions all between /: BOTTOM and /: ENDBOTTOM.
like
/: BOTTOM
/: If &a& EQ &B&
test1
/: endif
if &C& EQ &D&
IL text2
/: endif.
etc
etc
/: ENDBOTTOM.
Gr., Frank
PS: PROTECT ENDPROTECT can be split over several items BOTTOM ENDBOTTOM not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried using CONTROL_FORM instead?
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'BOTTOM'.
<WRITE_FORMS logic>
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'ENDBOTTOM'.
I've never tried it myself but then I've never had multiple text elements in my BOTTOM text. And I've never seen Rob ASKING a question. B)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Michael.
Actually, I've asked lots of questions. One was a similar to this. (I think it was about PROTECT/ENDPROTECT). If I recall correctly, it was Naimesh who solved it and it involved COTROL_FORM.
However, I'm going to wait a bit and see if someone comes up with something that can be done in the form itself.
Rob
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.