‎2012 Jun 26 10:58 AM
hi ,
how to find the error for this bapi BAPI_PROCORDCONF_CREATE_TT , because if i do a entry in cor6n for particular order id it is in error like 'enter the
storage location' , i knw tht ,tht order id is in error, but if i pass the same order id in BAPI , its not showing the error (i.e. enter the storage location ) simply its showing confirmation of order ID and in table detail_return, so pls help me out in this
‎2012 Jun 26 11:36 AM
hi saravanan ,
Have you check the table affw or check through t-code cogi.
regards ,
Yogendra Bhaskar
‎2012 Jun 26 1:01 PM
hi tanx for reply,
once i save tht movement type its showing error in tcode cor6n, but if i am passing the same data to the bapi but its showing 'confirmation of order xxxx saved' in detail_return , i want to capture the exact error of tht order id , how could i do tht , pls help ant its too urgent .am i passing orderid ,phase,posting date, yield thts it .
‎2012 Jun 26 1:09 PM
hi ,
R u not passing any data in table of goodsmovements ?
The storage location is passed in the GM table .
‎2012 Jun 26 1:30 PM
hi, i have seen tht cogi in tht all the error mess are thr but how could i take tht one, because its all structure , thts is belong to which table tell me
‎2012 Jun 26 1:32 PM
even if i pass the material no, storage location , plant , its not gathering the error in detail_return table.but in COGI t.code all the error is thr in the field 'error text' , but i dont how to get the error from thr
. so just tell me where tht error is storing table
‎2012 Jun 26 1:54 PM
hi ,
this bapi is meant to collect the error and post it in table affw and which u can see through COGI .
Now , first of all if you can stop the error to be posted in cogi ; you can obtain the error during confirmation itself.
I tried a lot , but didn't got any way to stop the error to be posted in cogi.
Whereas I have an alternate solution to this problem :
Before executing the bapi BAPI_PROCORDCONF_CREATE_TT.
You can use BAPI_GOODSMVT_CREATE , but run it in TEST MODE i.e pass
testrun = 'X' .
Now , pass the Goods movement data also .
you will have your error.
Regards ,
Yogendra Bhaskar
‎2012 Jun 28 6:33 AM
Hi Saravanan Velu ,
have you got the solution for your problem or still facing it ?
If you have got any alternate solution other than what I have told u , Plz. inform me about it.
Thanx and Regards ,
Yogendra Bhaskar
‎2012 Jun 28 7:22 AM
hi yogendra,
still i ahve problem in tht bapi , so i have done tht in
bdc ,now i can capture all the errors in tht, but now one problem raised in tht , say for example if one order id is error ok, if i upload tht through bdc i got error also it storing in standard table , tell me how to rectify itif order id is error i dont want to upload it .
my program.
REPORT zmsc_cor6n_bdc
NO STANDARD PAGE HEADING LINE-SIZE 255.
*********************************************************************
*& Program : ZMSC_BDC_001
*& Module : PP
*& Sub-Module : PP
*& Functional Contact: Mr.
*& Developer(Company): Mr.Saravanan
*& Create Date : 27th Jun 2012
*& Program Type : Exec
*& Description : BDC
*********************************************************************
*&---------------------------------------------------------------------*
*&
*&Types Declaration
*&---------------------------------------------------------------------*
TYPES : BEGIN OF ty_data,
aufnr_001(012),
vornr_002(014),
lmnga_003(004),
meinh_004(003),
budat_005(010),
err_msg(73) TYPE c,
END OF ty_data.
*&---------------------------------------------------------------------*
*&
*&Internal Table and Workarea Declaration
*&---------------------------------------------------------------------*
DATA : it_data TYPE TABLE OF ty_data,
wa_data TYPE ty_data,
it_data1 TYPE TABLE OF ty_data,
wa_data1 TYPE ty_data,
it_error TYPE TABLE OF ty_data,
wa_error TYPE ty_data,
it_success TYPE TABLE OF ty_data,
wa_success TYPE ty_data.
*Used to store BDC data
DATA : BEGIN OF gt_bdc_tab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA : END OF gt_bdc_tab.
*Used to stores error information from CALL TRANSACTION Function Module
DATA : gt_messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE .
*include bdcrecx1.
DATA: gv_textout TYPE t100-text,
gv_mode TYPE mode,
gv_update TYPE update.
*&---------------------------------------------------------------------*
*&
*&SELECTION-SCREEN
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
TITLE text-001.
PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK block1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
*&---------------------------------------------------------------------*
*&
*&START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.
* include zfrun.
* perform authority_check.
PERFORM get_data.
PERFORM update_data.
PERFORM disp_success.
PERFORM disp_error.
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_data .
DATA : lv_fname TYPE string.
lv_fname = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_fname
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_data
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
it_data1 = it_data.
REFRESH it_data.
LOOP AT it_data1 INTO wa_data1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_data1-aufnr_001
IMPORTING
output = wa_data-aufnr_001.
wa_data-vornr_002 = wa_data1-vornr_002.
wa_data-lmnga_003 = wa_data1-lmnga_003.
wa_data-meinh_004 = wa_data1-meinh_004.
wa_data-budat_005 = wa_data1-budat_005.
APPEND wa_data TO it_data .
ENDLOOP.
ENDFORM. " GET_DATA
*&---------------------------------------------------------------------*
*& Form UPDATE_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM update_data .
*perform open_group.
gv_mode = 'N'.
gv_update = 'S'.
LOOP AT it_data INTO wa_data.
PERFORM bdc_dynpro USING: 'X' 'SAPLCORU_S' '5100',
' ' 'BDC_OKCODE' '/00' ,
' ' 'AFRUD-AUFNR' wa_data-aufnr_001,
' ' 'AFRUD-VORNR' wa_data-vornr_002,
' ' 'AFRUD-LMNGA' wa_data-lmnga_003,
' ' 'AFRUD-MEINH' wa_data-meinh_004,
' ' 'AFRUD-ISDZ' '00:00:00',
' ' 'AFRUD-IEDZ' '00:00:00',
' ' 'AFRUD-PEDZ' '00:00:00',
' ' 'BDC_CURSOR' 'AFRUD-BUDAT',
' ' 'AFRUD-BUDAT' wa_data-budat_005,
'X' 'SAPLCORU_S' '5100',
' ' 'BDC_OKCODE' '=MB03',
' ' 'AFRUD-AUFNR' wa_data-aufnr_001,
' ' 'AFRUD-VORNR' wa_data-vornr_002,
' ' 'BDC_CURSOR' 'AFRUD-LMNGA',
' ' 'AFRUD-LMNGA' wa_data-lmnga_003,
' ' 'AFRUD-MEINH' wa_data-meinh_004,
' ' 'AFRUD-ISM01' ' ',
' ' 'AFRUD-ILE01' ' ',
' ' 'AFRUD-ISDZ' '00:00:00',
' ' 'AFRUD-IEDZ' '00:00:00',
' ' 'AFRUD-PEDZ' '00:00:00',
' ' 'AFRUD-BUDAT' '',
'X' 'SAPLCOWB' '0130',
' ' 'BDC_OKCODE' '=WEIT',
' ' 'BDC_CURSOR' 'COWB_COMP-ERFMG(01)'.
* IF SY-SUBRC <> 0.
PERFORM bdc_dynpro USING: ' ' 'SAPLCORU_S' '5100',
'' 'BDC_OKCODE'
'/EBACK',
'' 'SAPLSPO1' '0300',
'' 'BDC_OKCODE'
'=CANC'.
* ENDIF.
CALL TRANSACTION 'COR6N' USING gt_bdc_tab
MODE gv_mode
UPDATE gv_update
MESSAGES INTO gt_messtab.
*Retrieve error messages displayed during BDC update
LOOP AT gt_messtab.
* Builds actual message based on info returned from Call transaction
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = gt_messtab-msgid
msgnr = gt_messtab-msgnr
msgv1 = gt_messtab-msgv1
msgv2 = gt_messtab-msgv2
msgv3 = gt_messtab-msgv3
msgv4 = gt_messtab-msgv4
IMPORTING
message_text_output = gv_textout.
wa_error = wa_data.
wa_error-err_msg = gv_textout.
APPEND wa_error TO it_error.
CLEAR: wa_error.
ENDLOOP.
clear: gt_bdc_tab.
refresh: gt_bdc_tab, gt_messtab.
ENDLOOP.
ENDFORM. " UPDATE_DATA
*&---------------------------------------------------------------------*
*& Form BDC_DYNPRO
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0333 text
* -->P_0334 text
* -->P_0335 text
*----------------------------------------------------------------------*
form bdc_dynpro using dynbegin name value.
if dynbegin = 'X'.
clear gt_bdc_tab.
move: name to gt_bdc_tab-program,
value to gt_bdc_tab-dynpro,
'X' to gt_bdc_tab-dynbegin.
append gt_bdc_tab.
else.
clear gt_bdc_tab.
move: name to gt_bdc_tab-fnam,
value to gt_bdc_tab-fval.
append gt_bdc_tab.
endif.
endform. " BDC_DYNPRO
*&---------------------------------------------------------------------*
*& Form DISP_ERROR
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM disp_error .
WRITE:2 ' Message'(007) COLOR COL_HEADING.
SKIP.
* write:2 'The following records failed during updated:'(006).
WRITE😕 sy-uline(100).
FORMAT COLOR COL_HEADING.
WRITE😕 sy-vline, 2 'Order No.',
16 sy-vline, 24 'Message',
100 sy-vline.
WRITE😕 sy-uline(100).
FORMAT COLOR COL_NORMAL.
LOOP AT it_error INTO wa_error.
WRITE😕 sy-vline, 2 wa_error-aufnr_001,
16 sy-vline , 18 wa_error-err_msg,
100 sy-vline.
ENDLOOP.
WRITE😕 sy-uline(100).
REFRESH: it_error.
ENDFORM. " DISP_ERROR
*&---------------------------------------------------------------------*
*& Form DISP_SUCCESS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM disp_success .
ENDFORM. " DISP_SUCCESS
‎2012 Jun 28 10:10 AM
hi saravanan ,
U are getting the order id (aufnr_001) which contain error in it_error , delete those order id data from it_data .
You will have the order id without error .
what else you require here ?
regards ,
Yogendra
‎2012 Jun 26 12:23 PM
Hi,
can you please share how you are filling tha bapi interface ?
‎2012 Jun 26 1:36 PM
hi , just am passing orderid, phase, posting date, yields to bapi , but i am worng mess in bapi , if i see tht order id in COGI tcode its showing tht correct error , so to how to get the error mess correctly in bapi
‎2012 Jun 26 1:51 PM
hi ,
this bapi is meant to collect the error and post it in table affw and which u can see through COGI .
Now , first of all if you can stop the error to be posted in cogi ; you can obtain the error during confirmation itself.
I tried a lot , but didn't got any way to stop the error to be posted in cogi.
Whereas I have an alternate solution to this problem :
Before executing the bapi BAPI_PROCORDCONF_CREATE_TT.
You can use BAPI_GOODSMVT_CREATE , but run it in TEST MODE i.e pass
testrun = 'X' .
Now , pass the Goods movement data also .
you will have your error.
Regards ,
Yogendra Bhaskar