05-20-2011 4:36 PM
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
05-20-2011 4:44 PM
Well, it's not a BAPI; however, there may be something in program RJSDBOMTEST that will help you.
Rob
05-20-2011 4:44 PM
Well, it's not a BAPI; however, there may be something in program RJSDBOMTEST that will help you.
Rob
05-20-2011 5:24 PM
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