Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Help me -pls

Former Member
0 Likes
1,840

Hi Experts

I have done a program and smartform.

I give the docno and just execute only, i want the form to be printed in the paper without display any dialog boxes.

Is it possible, if so how to use GET_PRINT_PARAMETERS function and what r the parameters to be passed.

Thanks in advance

Regards

Rajaram

Hi Experts

I have done a program and smartform.

I give the docno and just execute only, i want the form to be printed in the paper without display any dialog boxes.

Is it possible, if so how to use GET_PRINT_PARAMETERS function and what r the parameters to be passed.

Thanks in advance

Regards

Rajaram

14 REPLIES 14
Read only

Former Member
0 Likes
1,791

Hi follow these steps:

How to create a New smartfrom, it is having step by step procedure

http://sap.niraj.tripod.com/id67.html

step by step good ex link is....

http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.h...

Here is the procedure

1. Create a new smartforms

Transaction code SMARTFORMS

Create new smartforms call ZSMART

2. Define looping process for internal table

Pages and windows

First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)

Here, you can specify your title and page numbering

&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)

Main windows -> TABLE -> DATA

In the Loop section, tick Internal table and fill in

ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2

3. Define table in smartforms

Global settings :

Form interface

Variable name Type assignment Reference type

ITAB1 TYPE Table Structure

Global definitions

Variable name Type assignment Reference type

ITAB2 TYPE Table Structure

4. To display the data in the form

Make used of the Table Painter and declare the Line Type in Tabstrips Table

e.g. HD_GEN for printing header details,

IT_GEN for printing data details.

You have to specify the Line Type in your Text elements in the Tabstrips Output options.

Tick the New Line and specify the Line Type for outputting the data.

Declare your output fields in Text elements

Tabstrips - Output Options

For different fonts use this Style : IDWTCERTSTYLE

For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&

5. Calling SMARTFORMS from your ABAP program

REPORT ZSMARTFORM.

  • Calling SMARTFORMS from your ABAP program.

  • Collecting all the table data in your program, and pass once to SMARTFORMS

  • SMARTFORMS

  • Declare your table type in :-

  • Global Settings -> Form Interface

  • Global Definintions -> Global Data

  • Main Window -> Table -> DATA

  • Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming

  • http://sapr3.tripod.com

TABLES: MKPF.

DATA: FM_NAME TYPE RS38L_FNAM.

DATA: BEGIN OF INT_MKPF OCCURS 0.

INCLUDE STRUCTURE MKPF.

DATA: END OF INT_MKPF.

SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.

SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.

MOVE-CORRESPONDING MKPF TO INT_MKPF.

APPEND INT_MKPF.

ENDSELECT.

  • At the end of your program.

  • Passing data to SMARTFORMS

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSMARTFORM'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

if sy-subrc <> 0.

WRITE: / 'ERROR 1'.

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

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

endif.

call function FM_NAME

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

GS_MKPF = INT_MKPF

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.

Smartform

you can check this link here you can see the steps and you can do it the same by looking at it..

http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.h...

SMARTFORMS STEPS.

1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.

2. Create Table type(t_struct) of stracture in se11.

3. In your program declare Internal table(Itab) type table of structure(struct).

4. Define work area(wa) like line of internal table.

5. Open Tcode Smartforms

6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).

7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).

8. In form pages and window, create Page node by default Page1 is available.

9. In page node you can create numbers of secondary window. But in form there is only one Main window.

10. By right click on page you can create windows or Go to Edit, Node, Create.

11. After creating the window right click on window create table for displaying the data that you are passing through internal table.

12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).

13. In table there are three areas Header, Main Area, Footer.

14. Right click on the Main area create table line by default line type1 is there select it.

15. Divide line into cells according to your need then for each cell create Text node.

16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.

17. Save form and activate it.

18. Then go to Environment, function module name, there you get the name of function module copy it.

19. In your program call the function module that you have copied from your form.

20. In your program in exporting parameter of function pass the internal table(itab).

SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.

SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can

configure forms with data from an SAP System for the relevant business processes.

To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.

You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.

You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.

SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.

SAP Smart Forms also support postage optimizing.

Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C

What Transaction to start SAP Smart Forms?

Execute transaction SMARTFORMS to start SAP Smart Forms.

Key Benefits of SAP Smart Forms:

SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.

You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.

To make changes, use Drag & Drop, Copy & Paste, and select different attributes.

These actions do not include writing of coding lines or using a Script language.

Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.

For Web publishing, the system provides a generated XML output of the processed form.

Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.

SmartForms System Fields

Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.

System fields of Smart Forms

&SFSY-DATE&

Displays the date. You determine the display format in the user master record.

&SFSY-TIME&

Displays the time of day in the form HH:MM:SS.

&SFSY-PAGE&

Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.

&SFSY-FORMPAGES&

Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.

&SFSY-JOBPAGES&

Contains the total page number of all forms in the currently processed print request.

&SFSY-WINDOWNAME&

Contains the name of the current window (string in the Window field)

&SFSY-PAGENAME&

Contains the name of the current page (string in the Page field)

&SFSY-PAGEBREAK&

Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])

&SFSY-MAINEND&

Is set as soon as processing of the main window on the current page ends

&SFSY-EXCEPTION&

Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception <exception name >).

Example Forms Available in Standard SAP R/3

SF_EXAMPLE_01

Simple example; invoice with table output of flight booking for one customer

SF_EXAMPLE_02

Similar to SF_EXAMPLE_01 but with subtotals

SF_EXAMPLE_03

Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request

Advantages of SAP Smart Forms

SAP Smart Forms have the following advantages:

1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.

2. Displaying table structures (dynamic framing of texts)

3. Output of background graphics, for form design in particular the use of templates which were scanned.

4. Colored output of texts

5. User-friendly and integrated Form Painter for the graphical design of forms

6. Graphical Table Painter for drawing tables

7. Reusing Font and paragraph formats in forms (Smart Styles)

8. Data interface in XML format (XML for Smart Forms, in short XSF)

9. Form translation is supported by standard translation tools

10. Flexible reuse of text modules

11. HTML output of forms (Basis release 6.10)

12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)

with regards,

Hema Sundara.

pls reward if found helpful.

Read only

Former Member
0 Likes
1,791

hi,

there is one parameter

control_parameters-no_dialog = 'X'.

Edited by: Will smith on Jan 3, 2008 12:45 PM

Read only

Former Member
0 Likes
1,791

DATA: PARAMS LIKE PRI_PARAMS,

DAYS(1) TYPE N VALUE 2,

COUNT(3) TYPE N VALUE 1,

VALID TYPE C.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING DESTINATION = 'LP01'

COPIES = COUNT

LIST_NAME = 'TEST'

LIST_TEXT = 'SUBMIT ... TO SAP-SPOOL'

IMMEDIATELY = 'X'

RELEASE = 'X'

NEW_LIST_ID = 'X'

EXPIRATION = DAYS

LINE_SIZE = 79

LINE_COUNT = 23

LAYOUT = 'X_PAPER'

SAP_COVER_PAGE = 'X'

COVER_PAGE = 'X'

RECEIVER = 'SAP*'

DEPARTMENT = 'System'

NO_DIALOG = ' '

IMPORTING OUT_PARAMETERS = PARAMS

VALID = VALID.

awrd points if useful

Bhupal

Read only

0 Likes
1,791

Hi Bhupal

I have used ur code yar, but still its asking the dialog window.

what could be the reason, can you tell me pls.

Regards

Rajaram

Read only

0 Likes
1,791

Hai,

Raj Ram

Bhupal has given no-dialog = ' ' instead no-dialog = 'x'.

However try this.

DATA: LX_OUTPUT TYPE SSFCOMPOP,

LX_CNTL TYPE SSFCTRLOP.

LX_CNTL-NO_DIALOG = 'X'.

LX_OUTPUT-TDDEST = 'printer name'.

*call smart form function module

CALL FUNCTION '/1BCDWB/SF00000038'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = LX_CNTL

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

OUTPUT_OPTIONS = LX_OUTPUT

  • USER_SETTINGS = 'X'

  • BOL_NUM =

  • CARRIER_NAME =

  • SHIP_FROM_ADR =

  • SHIP_TO_ADR =

  • THIRD_PARTY_ADR =

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

.

.

.

.

.

IF sy-subrc <> 0.

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

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

ENDIF.

Hope this help u.

Reward if helpful.

Regards,

Swetha

Read only

0 Likes
1,791

It returns the error as follows while trying the below code.

No output request open. Document processing not possible

help me pls.

Regards

Rajaram

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = w_formname

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = fm_name

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.

control-no_dialog = 'X'.

control-preview = 'X'.

control-no_open = 'X'.

control-no_close = 'X'.

CALL FUNCTION fm_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = control

  • rtim = rtim

  • mode = mode

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS = gfl_compop

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

it_final = it_final

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.

Read only

0 Likes
1,791

Hi Swetha

Problem Solved, thank you very much.

But whats the difference between the GET_PRINT_PARAMETERS and urs.

And if i want to set the number of copies, whats the parameter you suggest me.

Anyway thank all who have supported me entirely.

Thank you very much.

Regards

Rajaram

Read only

former_member188827
Active Contributor
0 Likes
1,791

try dis:

DATA print type SSFCOMPOP.

data control_parameters TYPE SSFCTRLOP.

control_parameters-device = 'PRINTER'.

control_parameters-no_dialog = 'X'.

control_parameters-preview = ' '.

print-tddest = '2571'.

print-TDIMMED = 'X'.

print-tdnoprev = ' '.

print-tdnoprev = 'X'.

CALL FUNCTION '/1BCDWB/SF00000053'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = CONTROL_PARAMETERS

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

OUTPUT_OPTIONS = print

USER_SETTINGS = ' '

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

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

*CALL FUNCTION 'SSF_CLOSE'

    • IMPORTING

    • JOB_OUTPUT_INFO =

    • EXCEPTIONS

    • FORMATTING_ERROR = 1

    • INTERNAL_ERROR = 2

    • SEND_ERROR = 3

    • OTHERS = 4

  • .

*IF sy-subrc <> 0.

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

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

*ENDIF.

Read only

Former Member
0 Likes
1,791

Hi Rajaram,

I have done ur program.

i used GET_PRINT_PARAMETERS function and i used one parameter and it passed and gave correct result.i.e.,control_parameters-no_dialog = 'X'.

Other wise u fallow the below steps.

these are all there in google search.

How to create a New smartfrom, it is having step by step procedure

http://sap.niraj.tripod.com/id67.html

step by step good ex link is....

http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.h...

so many procedures and programs are there but better u fallow which is very easy.

Reward me if it useful.

takecare.bye.

Read only

Former Member
0 Likes
1,791

hi,

try like this

TABLES : mara.

DATA : fm_nam TYPE rs38l_fnam,

control TYPE ssfctrlop.

DATA : BEGIN OF tab_mat OCCURS 0,

matnr LIKE mara-matnr,

END OF tab_mat.

SELECT-OPTIONS : mat FOR mara-matnr.

SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE tab_mat

WHERE matnr IN mat.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZSF_RANGES'

IMPORTING

fm_name = fm_nam

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.

control-no_dialog = 'X'.

control-preview = 'X'.

control-no_open = 'X'.

control-no_close = 'X'.

CALL FUNCTION fm_nam

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = control

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

matno = tab_mat-matnr

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

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

reward if usefull

Edited by: Dhwani shah on Jan 3, 2008 1:47 PM

Read only

0 Likes
1,791

Hi Dhwani

This what i tried by ur coding, but it returns the value sy-subrc = 2 after the fm fm_name. what could be the reason , pls advise me.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = w_formname

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = fm_name

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.

control-no_dialog = 'X'.

control-preview = 'X'.

control-no_open = 'X'.

control-no_close = 'X'.

CALL FUNCTION fm_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = control

rtim = rtim

mode = mode

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS = gfl_compop

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

it_final = it_final

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.

Read only

0 Likes
1,791

Hai,

If u dont want printpreview then set

control- PREVIEW = ' '.

And also

lx_output-TDNOPREV = 'x'

lx_output-TDIMMED = 'x'.

where lx_output is of type SSFCOMPOP

(LX_OUTPUT TYPE SSFCOMPOP)

Regards,

Swetha

Read only

0 Likes
1,791

This is my entire coding, pls check it revert back.

what could be the reason actually pls.

Thanks in advance.

Regards

Rajaram

REPORT ZSAB5.

tables : vbrp, vbrk, vbap.

DATA : BEGIN OF it_final OCCURS 0.

INCLUDE STRUCTURE ZINV_ORG.

DATA : END OF it_final.

data : wa like line of it_final.

data : mode type string.

data : flag type i,

flag1 type i.

DATA : fm_name TYPE rs38l_fnam.

DATA : w_formname TYPE tdsfname. "form name

w_formname = 'Z_POLY_ORGINAL'.

DATA : fm_nam TYPE rs38l_fnam,

control TYPE ssfctrlop.

SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.

PARAMETERS vbeln TYPE vbrk-vbeln matchcode object ZINVOICE.

PARAMETERS rtim TYPE vbrk-ERZET.

SELECTION-SCREEN END OF BLOCK bk1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

parameter : p_org as checkbox,

p_dup as checkbox,

p_tri as checkbox,

p_qua as checkbox.

SELECTION-SCREEN END OF BLOCK b2.

select a~vbeln

a~bukrs

b~posnr

b~werks

a~stceg

a~FKDAT

a~INCO1

a~INCO2

b~MATNR

b~ARKTX

b~FKIMG

b~UEPOS

from vbrk as a

inner join vbrp as b on avbeln = bvbeln

into corresponding fields of table it_final

where a~vbeln = vbeln.

break pro01.

if p_org is not initial and p_dup is not initial

and p_tri is not initial and p_qua is not initial.

mode = 'Original for Buyer'.

perform original.

mode = 'Duplicate'.

perform original.

mode = 'Triplicate'.

perform original.

mode = 'Quadruplicate'.

perform original.

elseif p_org is not initial and p_dup is not initial

and p_tri is not initial.

mode = 'Original for Buyer'.

perform original.

mode = 'Duplicate'.

perform original.

mode = 'Triplicate'.

perform original.

elseif p_dup is not initial and p_tri is not initial

and p_qua is not initial.

mode = 'Duplicate'.

perform original.

mode = 'Triplicate'.

perform original.

mode = 'Quadruplicate'.

perform original.

elseif p_org is not initial and p_dup is not initial.

mode = 'Original for Buyer'.

perform original.

mode = 'Duplicate'.

perform original.

elseif p_tri is not initial and p_qua is not initial.

mode = 'Triplicate'.

perform original.

mode = 'Quadruplicate'.

perform original.

elseif p_org is not initial and p_tri is not initial.

mode = 'Original for Buyer'.

perform original.

mode = 'Triplicate'.

perform original.

elseif p_dup is not initial and p_tri is not initial

and p_qua is not initial.

mode = 'Original for Buyer'.

perform original.

mode = 'Duplicate'.

perform original.

mode = 'Triplicate'.

perform original.

elseif p_org is not initial.

mode = 'Original for Buyer'.

perform original.

endif.

&----


*& Form original

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM original .

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = w_formname

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = fm_name

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.

control-no_dialog = 'X'.

control-preview = 'X'.

control-no_open = 'X'.

control-no_close = 'X'.

CALL FUNCTION fm_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = control

  • rtim = rtim

  • mode = mode

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS = gfl_compop

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

it_final = it_final

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.

ENDFORM. " original

Read only

0 Likes
1,791

Raja Ram,

I had checked ur Code .

Based on Swetha's Reply ,U have to give the output options in the function module of the Smartform.

ie.,

In the Export parameters, Uncomment the output options and assign the parameters based on Swetha's Reply

Thanks,

Shiva.