Skip to Content
author's profile photo Former Member
Former Member

write_form parameter

Hi All ,

What is the use of function exporting parameter in Write_form fm.

Regards

Mohit Bansal

Add a comment
10|10000 characters needed characters exceeded

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 16, 2008 at 04:56 AM

    HI,

    1.Write_form exporting parameters ,calls the window and elements to pass the value from driver program to layout.

    2.The elements in layout = the Write_forms in driver program.

    Refer:

    openform

    Regards,

    Shiva Kumar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 16, 2008 at 05:13 AM

    Hi,

    Incomplete line output

    If a corresponding text is output to the BOTTOM area of the main window (TYPE = BOTTOM), it is possible that this will have no space left on the current output page. It is therefore marked internally only for the BOTTOM output of the next page. The actual output is therefore still due (hangs).

    The parameter value 'X' conveys these facts. For example, at the end of the text this BOTTOM output which is still hanging could be implicitly shifted to the next page with an explicit page break (NEW PAGE).

    Narasimha

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I'm currently having problem as you described. There are several pages printed in the sapscript, and in the main window with the element at the bottom is not printing out on the next page.

      Can you elaborate more on how you explicitly call nextpage?

      in the form or print program?

      Thanks.

      Lily

  • author's profile photo Former Member
    Former Member
    Posted on May 16, 2008 at 05:23 AM

    Hi friend,

    This might help u,

    CALL FUNCTION 'OPEN_FORM'

    • EXPORTING

    • APPLICATION = 'TX'

    • ARCHIVE_INDEX =

    • ARCHIVE_PARAMS =

    • DEVICE = 'PRINTER'

    • DIALOG = 'X'

    • FORM = 'ZSCRIPT1'

    • LANGUAGE = SY-LANGU

    • OPTIONS =

    • MAIL_SENDER =

    • MAIL_RECIPIENT =

    • MAIL_APPL_OBJECT =

    • RAW_DATA_INTERFACE = '*'

    • SPONUMIV =

    • IMPORTING

    • LANGUAGE =

    • NEW_ARCHIVE_PARAMS =

    • RESULT =

    EXCEPTIONS

    CANCELED = 1

    DEVICE = 2

    FORM = 3

    OPTIONS = 4

    UNCLOSED = 5

    MAIL_OPTIONS = 6

    ARCHIVE_ERROR = 7

    INVALID_FAX_NUMBER = 8

    MORE_PARAMS_NEEDED_IN_BATCH = 9

    SPOOL_ERROR = 10

    CODEPAGE = 11

    OTHERS = 12

    .

    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 'START_FORM'

    EXPORTING

    • ARCHIVE_INDEX =

    FORM = 'ZFORM1'

    • LANGUAGE = ' '

    • STARTPAGE = 'X'

    PROGRAM = 'ZSCRIPT1'

    • MAIL_APPL_OBJECT =

    • IMPORTING

    • LANGUAGE =

    • EXCEPTIONS

    • FORM = 1

    • FORMAT = 2

    • UNENDED = 3

    • UNOPENED = 4

    • UNUSED = 5

    • SPOOL_ERROR = 6

    • CODEPAGE = 7

    • OTHERS = 8

    .

    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 'WRITE_FORM'

    EXPORTING

    • ELEMENT = ' '

    • FUNCTION = 'SET'

    • TYPE = 'BODY'

    WINDOW = 'HEADER'

    • IMPORTING

    • PENDING_LINES =

    EXCEPTIONS

    ELEMENT = 1

    FUNCTION = 2

    TYPE = 3

    UNOPENED = 4

    UNSTARTED = 5

    WINDOW = 6

    BAD_PAGEFORMAT_FOR_PRINT = 7

    SPOOL_ERROR = 8

    OTHERS = 9

    .

    IF SY-SUBRC <> 0.

    write:/ 'ERROR IN HEADER'.

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

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

    ENDIF.

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    • ELEMENT = ' '

    • FUNCTION = 'SET'

    • TYPE = 'BODY'

    WINDOW = 'MAIN'

    • IMPORTING

    • PENDING_LINES =

    EXCEPTIONS

    ELEMENT = 1

    FUNCTION = 2

    TYPE = 3

    UNOPENED = 4

    UNSTARTED = 5

    WINDOW = 6

    BAD_PAGEFORMAT_FOR_PRINT = 7

    SPOOL_ERROR = 8

    OTHERS = 9

    .

    IF SY-SUBRC <> 0.

    write:/ 'ERROR IN HEADER'.

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

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

    ENDIF.

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    • ELEMENT = ' '

    • FUNCTION = 'SET'

    • TYPE = 'BODY'

    WINDOW = 'FOOTER'

    • IMPORTING

    • PENDING_LINES =

    EXCEPTIONS

    ELEMENT = 1

    FUNCTION = 2

    TYPE = 3

    UNOPENED = 4

    UNSTARTED = 5

    WINDOW = 6

    BAD_PAGEFORMAT_FOR_PRINT = 7

    SPOOL_ERROR = 8

    OTHERS = 9

    .

    IF SY-SUBRC <> 0.

    write:/ 'ERROR IN HEADER'.

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

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

    ENDIF.

    CALL FUNCTION 'END_FORM'

    • IMPORTING

    • RESULT =

    • EXCEPTIONS

    • UNOPENED = 1

    • BAD_PAGEFORMAT_FOR_PRINT = 2

    • SPOOL_ERROR = 3

    • CODEPAGE = 4

    • OTHERS = 5

    .

    CALL FUNCTION 'CLOSE_FORM'

    • IMPORTING

    • RESULT =

    • RDI_RESULT =

    • TABLES

    • OTFDATA =

    • EXCEPTIONS

    • UNOPENED = 1

    • BAD_PAGEFORMAT_FOR_PRINT = 2

    • SEND_ERROR = 3

    • SPOOL_ERROR = 4

    • CODEPAGE = 5

    • OTHERS = 6

    .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 04:40 AM

    Hi

    Check with this :

    The WRITE_FORM function module is used in a print program to write text elements to a window of the form.

    Syntax

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    ELEMENT =

    FUNCTION =

    TYPE =

    WINDOW =

    IMPORTING

    PENDING_LINES =

    EXCEPTIONS

    ELEMENT = 1

    FUNCTION = 2

    TYPE = 3

    UNOPENED = 4

    UNSTARTED = 5

    WINDOW = 6

    BAD_PAGEFORMAT_FOR_PRINT = 7

    OTHERS = 8

    .

    reward points if helpful

    Regards

    Vachana

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 05:06 AM

    I am bit confused about the question ... whether you are asking the export parameter in context of print program or function module editor? If it is based on print program context then you have got enough idea about the exporting parameters.

    But if it is in other context i.e. you are asking about the export parameters PENDING_LINES . Then

    If a corresponding text is output to the BOTTOM area of the main window by using the TYPE = BOTTOM, it is possible that this will have no space left on the current output page. It is therefore marked internally only for the BOTTOM output of the next page. The actual output is therefore still due.

    The parameter value 'X' conveys these facts. For example, at the end of the text this BOTTOM output which is still hanging could be implicitly shifted to the next page with an explicit page break (NEW PAGE).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 05:17 AM

    Hi Mohit,

    The function parameter is used to decide how the data is to be displayed on the window....

    it can have 3 possible values

    SET

    APPEND

    DEL

    if SET is used the contents are overwritten in the next loop pass in case of variable window... but it works as append in main window

    if APPEND is used the contents are appended to the already displayed values.

    if DEL is used the contents are displayed and also deleted

    regards

    padma

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 05:19 AM

    Hi Mohit,

    In the Function Module WRITE_FORM. we have a parameter called Function. For this parameter we have a default value as 'SET'. It can actually take three values SET APPEND DELETE. Each one has a significance.

    SET -- It refreshes the current list and places the content again.

    APPEND -- It appends the content to the existing one.

    DELETE -- It deletes the existing content

    Regards,

    Swapna.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.