cancel
Showing results for 
Search instead for 
Did you mean: 

ADOBE form - page reset for the second SO

Former Member
0 Kudos

Hi all,

Iam working on sales order form ( ADOBE Form). Nneed to display SO header and item details.But it is not for a single SO and it is for multiple SOs.First i need to display one sales order and its items after completing the all items of the first SO , the second SO details should come in the next page. This is fine, i have done this, but for the second SO the page numbers should start from 1. That means the page no has to be reset for each SO change.Suppose assume that, if the first SO is taking 2 pages for printing item details and second SO is taking 3 pages for printing item details then the page nos should follows the below sequence:

First SO : 1 of 2

2 of 2

second SO : 1 of 3

2 of 3

3 of 3.

but it is printing as 1 of 5, 2 of 5 ..... like this. Because we are using the system field for this.Can we reset the page numbers according to the condition?

Regards ,

Vineel.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vineel,

Try opening job and closing job for each sales order in the loop of the sales orders then you would get as per your requirement.

Regards,

Ram

Former Member
0 Kudos

Hi,

One addition to the previous answer. You need to set the Output device in the program itself and the nodialog field of the outputparams should be set to 'X'. For example you can go through the below code.

DATA:

w_formname TYPE fpname,

w_function TYPE funcname.

DATA : docparams TYPE sfpdocparams.

DATA : formoutput TYPE fpformoutput.

DATA : outputparams TYPE sfpoutputparams.

DATA:

BEGIN OF fs_orders,

vbeln TYPE vbak-vbeln,

END OF fs_orders,

t_orders LIKE STANDARD TABLE OF fs_orders.

SELECT vbeln

FROM vbak

INTO TABLE t_orders

UP TO 5 ROWS.

CHECK sy-subrc EQ 0.

w_formname = 'YH297_FORM_SALESORDER'.

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

EXPORTING

i_name = w_formname

IMPORTING

e_funcname = w_function

  • E_INTERFACE_TYPE =

.

outputparams-dest = 'PDF1'.

outputparams-nodialog = 'X'.

LOOP AT t_orders INTO fs_orders.

CALL FUNCTION 'FP_JOB_OPEN'

CHANGING

ie_outputparams = outputparams

EXCEPTIONS

cancel = 1

usage_error = 2

system_error = 3

internal_error = 4

OTHERS = 5.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL FUNCTION w_function

EXPORTING

  • /1bcdwb/docparams =

document = fs_orders-vbeln

  • IMPORTING

  • /1BCDWB/FORMOUTPUT =

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL FUNCTION 'FP_JOB_CLOSE'

  • IMPORTING

  • e_result =

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDLOOP.

Regards,

Ram

gautam_totekar
Active Participant
0 Kudos

hi

Try using a variable of your own on the display form and update it after every page print