Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

new page in smartform

Hi,

While working with smartforms, for each delivery note (vbeln), a new page should be printed with corresponding item level information.

Now the internal table is having all the data.

How to generate new page for each new VBELN....??????

Regards

Pavan

Tags:
Former Member
Former Member replied

Hi ,

You can use following tips to print multiple delivery note for individual sales order using select-options.

To print the sales order range in smartform do the following things:

1.Define the structure,workarea and internal table for sales order header and details and also define

select-options for sales order.

2.Also define the one STRUCTURE which has type as ssfctrlop.

e.g. control type ssfctrlop.

This variable we have to define because we are going to use this in

SSF_OPEN function.This is used to avoid print preview while openning smartform

for every sales order.

3. Select data from vbak for sales header.

4. Call function SSF_FUNCTION_MODULE_NAME.

e.g.*CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = w_formname

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = w_functionname

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.

5.Now here define the various features or field in control structure.

This is controls for smartform.

e.g. control-no_dialog = 'X'.

control-preview = 'X'.

control-no_open = 'X'.

control-no_close = 'X'.

6. Call function SSF_OPEN.

Here you have to pass the control structure which you have define in declaration.

e.g.

CALL FUNCTION 'SSF_OPEN'

EXPORTING

  • ARCHIVE_PARAMETERS =

  • USER_SETTINGS = 'X'

  • MAIL_SENDER =

  • MAIL_RECIPIENT =

  • MAIL_APPL_OBJ =

  • OUTPUT_OPTIONS =

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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

7. Take loop at header internal table .

8. Select data from vbak for sales details. Also select data from respective tables

like makt,kna1 here.

9.Then call function module which generated after executing smartform. And also pass the control structure

in import parameter in this function module.

e.g. CALL FUNCTION '/1BCDWB/SF00000397'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = control

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

wa_vbak = wa_vbak

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

it_vbak = it_vbak

it_vbap = it_vbap

  • 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.

10.After endloop call function SSF_CLOSE.

Regards,

Santosh.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question