Skip to Content
0
Former Member
Oct 04, 2005 at 05:57 PM

SAP Script

21 Views

Hi all,

I am calling the sap script forms in a function module.

I am not getting the data on the output, but the text is displayed correctly. I am wondering if I am missing something out. And this piece of code displays the data on the output correctly if I run through a simple report program. Any ideas?

here is my code:

CALL FUNCTION 'OPEN_FORM'

EXPORTING

APPLICATION = 'TX'

  • ARCHIVE_INDEX = ' '

  • ARCHIVE_PARAMS = ' '

DEVICE = 'PRINTER'

DIALOG = ' '

FORM = 'ZHR_BEN_COB_GN'

LANGUAGE = SY-LANGU

OPTIONS = ' '

IMPORTING

LANGUAGE = SY-LANGU

EXCEPTIONS

OTHERS = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'COBRA_NOTICE '

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

ELEMENT = 1.

*

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = ' '

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'COVER'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = ' '

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'AON_BX'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = ' '

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'ELECTION'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = ' '

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'ELECT_BX'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = ' '

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'GENELECT'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = ' '

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'PLANS'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = ' '

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'NOT1'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = ' '

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'NOT2'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'CLOSE_FORM'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.

Thanks,

Sobhan.