Skip to Content
0
Former Member
Nov 21, 2011 at 05:52 PM

Conversion of UoM to KG's in acc. doc. while creating billing doc

78 Views

Hi Gurus,

My requirement is to convert unit of measurement into KG in created accounting document while creating billing document for outbound delivery.

Suppose for material X1, 1CS = 10KG then while creating billing document having item material as X1 the bseg and all GL tables should have document with UoM as Kg instead of CS.

I coded user exit EXIT_SAPLV60B_004. Code written is mentioned below:

IF xkomv-koaid = 'B'.

DATA: l_out TYPE f.

CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'

EXPORTING

input = xvbrp-fkimg

  • KZMEINH = ' '

matnr = xvbrp-matnr

meinh = 'KG'

meins = xvbrp-meins

  • EXTENDED_CONV = ' '

  • TYPE_UMR = ' '

  • NO_OUTPUT = ' '

  • CHARGE =

  • CHARG_CUOBJ =

  • WERKS =

IMPORTING

  • ADDKO =

  • MEINS =

output = l_out

  • UMREN =

  • UMREZ =

  • BATCH_CONVERSION_ERROR =

  • KZWSO =

EXCEPTIONS

conversion_not_found = 1

input_invalid = 2

material_not_found = 3

meinh_not_found = 4

meins_missing = 5

no_meinh = 6

output_invalid = 7

overflow = 8

OTHERS = 9

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

xaccit-menge = l_out.

xaccit-meins = 'KG'.

ENDIF.

After implementing this exit BSEG table is getting updated with unit of measurement as Kg (field meins and menge) but the problem is that table FAGLFLEXA (field RUNIT and msl) are not update with quantity in KG.

Please let me know if i need to implement different exit to achieve the functionality.

Help is much appreciated.

Thanks

HImanshu