FM Create BOM Material (CS01)

Berikut ini adalah contoh penggunaan FM CSAP_MAT_BOM_CREATE untuk Plant Maintenance.

  data: lwa_stko    type stko_api01,
        li_stpo     like table of stpo_api01 with header line,
        lv_warning  like  capiflag-flwarning,
        lv_bom_no   like  stko_api02-bom_no,
        lv_validfr(10),
        lv_message(220).

    lwa_stko-base_quan = '1'.
    lwa_stko-base_unit = marm-meinh.

      li_stpo-item_categ  = stpo-postp.
      li_stpo-item_no     = posnr.
      li_stpo-component   = mara-matnr.
      li_stpo-comp_qty    = stpo-menge.
      li_stpo-comp_unit   = marm-meins.
      li_stpo-valid_from  = date_text "format dd.mm.yyyy.
      append li_stpo. clear li_stpo.

    call function 'CSAP_MAT_BOM_CREATE'
      exporting
        material   = mara-matnr
        plant      = marc-werks
        bom_usage  = t416-stlan
        valid_from = date_text "format dd.mm.yyyy
        i_stko     = lwa_stko
      importing
        fl_warning = lv_warning
        bom_no     = lv_bom_no
      tables
        t_stpo     = li_stpo[]
      exceptions
        error      = 1
        others     = 2.

Note. Sebelum menjalankan FM ini, pastikan bahwa table TMCNV (Data on Material Numbers Conversion) telah dimaintain dengan detail data sebegai berikut :

FIELD      VALUE
-------------------
CONVID     MATCONV
LMATNR     18
LMASKE     0
ATRENN     0
ATRENNX    0
LNGEFF     18
MASKE
TZ
FLAG0      X
LEXFLAG
VCHAR

Hal ini untuk menghindari short dump dengan keterangan “Exception condition “KEY_INCOMPLETE” raised”, yang dikarenakan pada table konversi TMCNV panjang field MATNR (LMATNR) di-set kurang dari 18 digit.

Untuk mengubah isi table ini, jalankan program rscc_v_tmcnv dengan isian parameter sebagai berikut :

p_mat  = 'X'
length = '18'
testmode = ' '
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s