06-29-2012 7:25 AM
Dear experts,
I have smartforms for Delivery note. The input field is delivery note no i.e LIKP-VBELN as select-option. When I am taking printout for one delivery note then the Page No i.e Page - &SFSY-PAGE&(&SFSY-FORMPAGES&) is showing correctly. But when I am giving a range of delivery note, for example - 803000075 to 803000085 then the page no is showing
as in 803000075 as Page - 1(11).
But it should be Page - 1(1) and if in this delivery note has more line items and it contains 2nd page then the page 2 should be Page - 1(2).
in 803000076 as Page - 2(11).
But it should be Page - 1(1) and if in this delivery note has more line items and it contains 2nd page then the page 2 should be Page - 1(2).
Like this...........
Please reply me how can it possible. The clients requirement is like this.
Thanks,
Sanjeeb
06-29-2012 7:33 AM
Hi,
How do you calling the Smartform.
if you are using a drive program and you are passing delivery number to smartform , pass the single del. number in loop to SF.
that will work fine...
Thanks
Deeps
06-29-2012 7:43 AM
Hi Deeps,
Thanks for your reply.
Yes I m using the driver program and I am passing the delivery note as select-option which is requirment of client. The out put is correct for the data, only the page no problem is showing which is mentioned before. If any solution please reply.
Thanks,
Sanjeeb.
06-29-2012 7:48 AM
Just try to paas Delivery number in loop to smartform.
loop at it_likp into is_likp.
lv_vbeln = is_likp-vbeln.
* Now Call the Generated Function Module
CALL FUNCTION fm_name
EXPORTING
w_id = fm_name
control_parameters = wa_control_parameters
wmblnr = lv_vbeln
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
if sy-subrc <> 0.
perform message_build.
endif.
endloop.
06-29-2012 9:29 AM
I have tryed with this code but same result. The page no is showing like before.
06-29-2012 9:53 AM
sanjeeb,
Tell me one thing, are you getting SFSY values in debugger ?
if yes then there is one more way to get all pages like page &SFSY-PAGE& of &SFSY-JOBPAGES&
i think it will work fine with my code in earlier post...
Thanks,
Deeps
06-29-2012 7:33 AM
hi sanjeeb,
its a standard format to display total number of pages in bracket and the page number you are on before the bracket starts.
I dont think it is possible to display in reverse.
regards
uday
06-29-2012 9:03 AM
Hi Uday,
If u don't know, please don't reply like this.
Thanks,
Sanjeeb.
06-29-2012 8:05 AM
06-29-2012 9:01 AM
hi Sanjeeb,
Since you are passing the range of delivery documents in the driver program to the smartform, it will work like this only.
As deepnedra said you have to call the smartform for each time in a loop. Then you will get as you required.
Regards,
Venkat
06-29-2012 9:18 AM
Dear Sanjeeb
There is one work around for this. May be you try this..
1. Find out how many line items the form is printing in a page. Take one big delivery note and find it.
2. Suppose it prints 10 line items per page... for example
3. In your driver program, estimte the number of pages required by dividng it by 10... Pass that variable to the smart form interface variable.
4. Use that variable instead of SY-FORMPAGES
Regards,
Venkat
06-29-2012 9:13 AM
You cannot force change of SFSY-FORMPAGES in a SmartForm run as you can for SFSY-PAGE using General Attributes tab of the page node. The SFSY-PAGE is used "real time" when the SFSF-FROMPAGES is used "at late".
So the easiest solution would be to call the form one document at a time in a loop as some members have already suggested.
With much more effort you could "play" with saving data during normal processing and "some" code in late windows, but I never had the time to do this kind of development.
Regards,
Raymond
06-29-2012 9:40 AM
06-29-2012 9:51 AM
Hi, Follow the below approch.
You need to call the function modules SSF_OPEN and SSF_CLOSE for every new delivery note.
output-tdimmed = ' '.
output-tdnoprev = ' '.
output-tddest = 'LOCL'.
control-no_open = 'X'.
control-no_close = 'X'.
control-no_dialog = 'X'.
ON CHANGE OF LIKP-VBLEN.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
* ARCHIVE_PARAMETERS =
* USER_SETTINGS = 'X'
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJ =
OUTPUT_OPTIONS = output
CONTROL_PARAMETERS = control
* IMPORTING
* JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
END ON
********SMARTFORM CALL*******
AT END OF VBELN.
CALL FUNCTION 'SSF_CLOSE'
* IMPORTING
* JOB_OUTPUT_INFO =
* EXCEPTIONS
* FORMATTING_ERROR = 1
* INTERNAL_ERROR = 2
* SEND_ERROR = 3
* OTHERS = 4
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDAT.
06-29-2012 11:59 AM
06-29-2012 12:04 PM
I have checked with the above approach and it is working for me.
Paste your code for further analysis.
06-29-2012 9:50 AM
Dear Sanjeeb
There is one work around for this. May be you try this..
1. Find out how many line items the form is printing in a page. Take one big delivery note and find it.
2. Suppose it prints 10 line items per page... for example
3. In smartform code estimte the number of pages required by dividng it by 10.(example)..
4. Use that variable instead of SY-FORMPAGES
Regards,
Venkat
06-29-2012 12:03 PM
In line item there is a description field. If the description length is more then the number of line item per page is decrease. so the number of line item in a page is not constant. So we cann't cosider this.
If there is any other solution please reply.