Application Development 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: 

Smartform printing blank the first time..

Former Member
0 Kudos

Hi,

I'm facing a peculiar prob. When I print workorder smartform the first time each day to a printer, it prints blank but from the second one it is allright.

Earlier, I had a problem of printing blank form when doing a mass print(CO41). Then I put in a delay of few secs in the print pgm which took care of this prob.

But I still have this prob of blank form the first time I print everyday using CO01.

I appreciate your help.

Thanks,

Ritu

6 REPLIES 6

former_member181966
Active Contributor
0 Kudos

checkout the post :

This might help you .

Good luck !

Bye

0 Kudos

Hi Saquib,

My prob is different..

Thanks,

Ritu

Message was edited by: Ritu

Former Member
0 Kudos

Hi Ritu,

Can you please post your print program code. I hope you have a custom program.

Lanka

0 Kudos

Hi Lanka,

Here it is..

DATA : v_frm_name TYPE rs38l_fnam ,

v_aufnr TYPE psfc_disp .

CONSTANTS : c_tcode LIKE sy-tcode VALUE 'CO41'.

    • To obtain the production order number from transaction co02.

GET PARAMETER ID 'ANR' FIELD v_aufnr.

    • To make a time delay for mass printing

IF sy-tcode = c_tcode.

WAIT UP TO 3 SECONDS.

ENDIF.

SELECT werks

plnbez

aufnr

gmein

gamng

igmng

plnnr

aufpl

FROM caufv

INTO CORRESPONDING FIELDS OF TABLE t_caufv

WHERE aufnr = v_aufnr.

    • To capture the name of the function module dynamically

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZPPS_PRD_WRK_ORDER_IHM'

IMPORTING

fm_name = v_frm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

CASE sy-subrc.

WHEN '1'.

MESSAGE e012.

WHEN '2'.

MESSAGE e013.

WHEN '3'.

MESSAGE e014.

ENDCASE.

    • Calling smart form

CALL FUNCTION v_frm_name

TABLES

t_caufv = t_caufv

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

CASE sy-subrc.

WHEN '1'.

MESSAGE e015.

WHEN '2'.

MESSAGE e016.

WHEN '3'.

MESSAGE e017.

WHEN '4'.

MESSAGE e018.

WHEN '5'.

MESSAGE e019.

ENDCASE.

0 Kudos

Hi Ritu,

I have reviewed your code and looks OK.Can you set a break-point at CALL FUNCTION v_frm_name

and check wheather table t_caufv containing data or not when you are running for first time.

Regards,

Lanka

0 Kudos

Hi Lanka,

If I put a breakpoint, I'm unable to duplicate the issue.. but I shall try again and let you know..

Thanks,

Ritu