cancel
Showing results for 
Search instead for 
Did you mean: 

Printing production order

Former Member
0 Kudos

Hello friends,

i am working on printing the filling sheet for the production order.

I configured the form and the print program in OPK8 and I can call my print program and sap script in debug mode ,

i did open_form, start_form, write_form, end_form, close_form and I can go in debug mode and see the values are coming but the prioblem is its not populating the page when testing from CO03 . Can't figure out what is the problem.

Thanks in adv.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Did you check in debug mode in script, whether its taking the values that you populated in your print program?

And 1 more thing is, if you are calling your script using 'Open_form', you need not call 'start_form' and 'end_form'. You can just use 'Open_form', 'Write_form' and 'Close_form'.

Please check if you have created text elemnts for your windows in the script. If yes, then you will need to call those using WRITE_FORM.

Thanks,

Archana

Former Member
0 Kudos

Hi ,

thanks for your reply

this is a filling sheet and it has to be only one page always, though there can be multiple filling sheet but every sheet is of one page.

so i have called all the functions in one loop only...not sure if that is righht?

but now i ma getting the error

CLOSE_FORM for the layout is missing

here is that part of the code

CALL FUNCTION 'OPEN_FORM'

EXPORTING

device = 'PRINTER'

dialog = ' '

form = 'ZPSFC_POPI_UK'

language = sy-langu

OPTIONS = options.

IF sy-subrc <> 0.

ENDIF.

  • CALL FUNCTION 'CONTROL_FORM'

  • EXPORTING

  • command = 'NEW-PAGE'

  • EXCEPTIONS

  • unopened = 1

  • unstarted = 2

  • OTHERS = 3.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'HEADING'

type = 'TOP'

window = 'MAIN'

function = 'SET'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'HEADER'

window = 'HEADER'.

CALL FUNCTION 'CLOSE_FORM'

IMPORTING

RESULT = PR_RESULT

EXCEPTIONS

OTHERS = 01.

Former Member
0 Kudos

Hi,

See, if you want to display a table which is in the Main window, then you need to loop at your internal table and inside this internal table call WRITE_FORM. Just provide text elemnt name and window name to write_form.

Loop at itab into wa_itab.

CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'HEADING'
window = 'MAIN'.

Endloop.

If you are not using any text elements then you need not call those windows using WRITE_FORM. Those will be called after close_form automatically.

Thanks,

Archana

aidan_black
Active Contributor
0 Kudos

Hi,

Can you check if the following SAP note resolves this problem:

1243485 - Unprinted variables and lines of a SAPscript form

Regards,

Aidan

Former Member
0 Kudos

Hello Aidan,

Thanks for your reply .

I think there is problem in the sequence of open_form, start_form,end_form and close_form as i am not able to see any output of it.