on 02-27-2008 3:40 PM
Hi guy,
I try to printout the header text on the packing list form,when I add following code in the SAP printout program,I can printout the text correctly,but I can't printout Current Page Number on the form with system symbols &PAGE&.(It can be printout correctly before adding following code).I don't know what happened,how can I get the right solution?
Can anybody help on this case?Your help is appreciated.
Thanks,
Don
DATA P_LINE1 LIKE TLINE.
DATA P_LINE2 LIKE TLINE.
DATA P_LINE3 LIKE TLINE.
DATA P_LINE4 LIKE TLINE.
DATA P_LINE5 LIKE TLINE.
DATA P_ALL LIKE TLINE.
DATA ITEXT LIKE TLINE OCCURS 0 WITH HEADER LINE.
DATA TEXTNAME LIKE STXH-TDNAME.
DATA TEMPCNTR TYPE I.
DATA POSNR Like VBDPL-POSNR.
DATA LT_TEXT TYPE TDTAB_C132.
DATA WA_TEXT LIKE LINE OF LT_TEXT.
IF POSNR EQ '000000'.
TEXTNAME = VBDKL-VBELN.
ELSE.
CONCATENATE VBELN POSNR INTO TEXTNAME.
ENDIF.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = '0012'
LANGUAGE = 'E'
NAME = TEXTNAME
OBJECT = 'VBBK'
TABLES
LINES = ITEXT
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.
CLEAR ITEXT.
CLEAR P_LINE1.
CLEAR P_LINE2.
CLEAR P_LINE3.
CLEAR P_LINE4.
CLEAR P_LINE5.
EXIT.
ENDIF.
CALL FUNCTION 'CONVERT_ITF_TO_ASCII'
EXPORTING
FORMATWIDTH = 128
IMPORTING
C_DATATAB = LT_TEXT
TABLES
ITF_LINES = ITEXT
EXCEPTIONS
INVALID_TABLETYPE = 1
OTHERS = 2.
LOOP AT LT_TEXT INTO WA_TEXT.
CONCATENATE P_ALL WA_TEXT INTO P_ALL SEPARATED BY SPACE.
SHIFT P_ALL LEFT DELETING LEADING SPACE.
IF TEMPCNTR = 0.
P_LINE1 = WA_TEXT.
ELSEIF TEMPCNTR = 1.
P_LINE2 = WA_TEXT.
ELSEIF TEMPCNTR = 2.
P_LINE3 = WA_TEXT.
ELSEIF TEMPCNTR = 3.
P_LINE4 = WA_TEXT.
ELSEIF TEMPCNTR = 4.
P_LINE5 = WA_TEXT.
ELSE.
EXIT.
ENDIF.
TEMPCNTR = TEMPCNTR + 1.
ENDLOOP.
Hi Don,
It probably is a case of space crunch.
Let's try one thing. Instead of pring page number &PAGE& as it is, format it using: &PAGE(3ZC)&
What this would accomplish is, allot only 3 characters for printing the page number (we can assume your script wont print more than 999 pages in one run), Z would remove any 0s, i.e. if page number is 009, then only 9 would get printed, and C would compress it, instead of ' 9' straight 9 would get printed.
Check it out. Also it is not very clear how you have positioned the new standard text with relation to the page number while printing.
Cheers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aditya,
Thanks for your information.
I put the new standard text and the currenty page number in different window with the same paragraph format.
Page window as:
<S>&PAGE(3ZC)& of &SAPSCRIPT-FORMPAGES&</>
&SAPSCRIPT-FORMPAGES& output correctly,but &PAGE(3ZC)& output is wrong,it is always '0'.If I removed the relevant script,it works fine.
Regards,
Don
Sorry,I missed an important information:
Zero was assigned to &PAGE& .So system show me the currenty page nubmer is '0' on every page.that's my problem.
Thanks,
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, zhang qd
If u have a smartform, try &SFSY-PAGE(3ZC)&
Check OSS Note 779492.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
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.