Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BAPI - CSAI_BOM_CREATE error

Dear Experts.,

I created a report for uploading BOM equipments using BAPI - CSAI_BOM_CREATE . It is working fine in IDES System , but when I used the same in DEV System It is Giving Error.

below is my code.,

LOOP AT IT_FINAL INTO wa_final.

 WA_FINAL1 = WA_FINAL.

  at new equnr.

cLEAR wa_csin.
CLEAR: count, itm_no, cnt.
* wa_csin-aennr = '009900159470'.
wa_csin-datuv = sy-datum.
wa_csin-equnr = WA_FINAL1-equnr.
wa_csin-werks = WA_FINAL1-werks.
wa_csin-stlan = WA_FINAL1-stlan.  " 4
wa_csin-stlty = 'E'.
*wa_csin-werks = '1000'.

CLEAR wa_stkob.
wa_stkob-stlty = 'E'.

CLEAR wa_stzub.
wa_stzub-stlty = 'E'.

 cnt = 10.

 ENDAT.

 count = cnt.

 IF cnt < 100.

 CONCATENATE '00' count INTO itm_no.

 ELSE.

 CONCATENATE '0' count INTO itm_no.


 ENDIF.


CLEAR wa_stpob.
wa_stpob-stlty = 'E'.
wa_stpob-idnrk = WA_FINAL1-idnrk.
wa_stpob-postp = 'I'.
wa_stpob-posnr = itm_no.
wa_stpob-menge = WA_FINAL1-menge.
wa_stpob-potx1 = WA_FINAL1-potx1.
wa_stpob-potx2 = WA_FINAL1-potx2.
wa_stpob-datuv = sy-datum.
APPEND wa_stpob TO tab_stpob.
CLEAR wa_stpob.


at END OF equnr.

CALL FUNCTION 'CSAI_BOM_CREATE'
  EXPORTING
    ecsin = wa_csin
    estkob = wa_stkob
    estzub = wa_stzub
  IMPORTING
    fl_warning = g_flwarning
    astlnr = g_warn_stlnr
  TABLES
    t_stpob = tab_stpob
  EXCEPTIONS
    error = 1
    OTHERS = 2.


IF sy-subrc NE 0.   " here Sy-subrc is 1

* error msg

ENDIF.

the above code is working fine in IDES., not in DEV., sy-subrc returns 1.

I Debugged and checked in BAPI., the FM CS_DI_ITEM_CHECK is returning error. "{ Terminate if API log contains error "messages }

Please tell Why the error is occuring.!! what need to be changed..!!

Thanks,

Regards,

Kiran

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question