Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI - CSAI_BOM_CREATE error

former_member184578
Active Contributor
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Well, it's not a BAPI; however, there may be something in program RJSDBOMTEST that will help you.

Rob

2 REPLIES 2

Former Member
0 Kudos

Well, it's not a BAPI; however, there may be something in program RJSDBOMTEST that will help you.

Rob

0 Kudos

Hi Rob sir,

thanks for Updating me., I saw that report., this is what i used in my program., but difference is I am creating Equipment BOM.

Any other Suggestions...

And the Strange thing is ., It is working and BOM is creating in IDES., but while coming to DEV., sy-subrc = 1.

Thanks & regards,

Kiran