cancel
Showing results for 
Search instead for 
Did you mean: 

How to check if it's the first time my form has been printed ?

Former Member
0 Kudos

Hi gurus,

I have to code a smartform and i have to check if it's the fisrt time my form has been printed...

thanks for your help

Accepted Solutions (1)

Accepted Solutions (1)

amit_khare
Active Contributor
0 Kudos

If it is tied to a message type in NACE then check this code -

DATA: wl_mandt TYPE mandt.

*If parameters exist, use as attributes. Else, use current

*global attribute values, which can be set at instantiation.

if not ( i_kappl is initial and

i_objky is initial and

i_kschl is initial ).

w_kappl = i_kappl.

w_objky = i_objky.

w_kschl = i_kschl.

endif.

*Determine if object was printed before for the same application

*and condition/message type.

SELECT mandt INTO wl_mandt UP TO 1 ROWS

FROM nast

WHERE kappl = w_kappl AND

objky = w_objky AND

kschl = w_kschl.

ENDSELECT.

IF sy-subrc <> 0.

e_version = c_doc_version_original.

ELSE.

e_version = c_doc_version_duplicate.

ENDIF.

Answers (0)