Skip to Content
0
Former Member
Oct 25, 2010 at 07:26 PM

Print Serial numbers on the invoice

610 Views

Hi,

I'm an trying to get the Serial numbers onto my invoice.

we are on ECC 6.0 and using smartforms use the delivery step.

I have code that pulls and prints the Serial numbers on my packing list, but won't work on the invoice.

I t doesn't seem to like IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB and I'm not entirely sure why or what to replace it with.

I tryed IS_BIL_INVOICE-HD_REF-DELIV_NUMB.

CLEAR: gv_pieces, gv_pieces_uom.

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

i_matnr = gs_it_gen-material

i_in_me = gs_it_gen-sales_unit

i_out_me = 'EA'

i_menge = gs_it_gen-dlv_qty

IMPORTING

e_menge = gv_pieces

EXCEPTIONS

error_in_application = 1

error = 2

OTHERS = 3 .

IF sy-subrc = 0.

gv_pieces_uom = 'EA'.

ENDIF.

  • Get Serial Number

*data: it_ser type table of RISERLS,

  • wa_ser type RISERLS.

refresh: it_ser[].

clear: l_serial.

CALL FUNCTION 'SERIAL_LS_PRINT'

EXPORTING

vbeln = IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB

POSNR = GS_IT_GEN-ITM_NUMBER

tables

iserls = it_ser.

read table it_ser into wa_ser index 1.

if sy-subrc = 0.

*l_serial = wa_ser-sernr.

CALL FUNCTION 'CONVERSION_EXIT_GERNR_OUTPUT'

EXPORTING

input = wa_ser-sernr

IMPORTING

OUTPUT = l_serial.

endif.

condense l_serial.

Edited by: Israel Edmiston on Oct 27, 2010 12:00 AM