‎2014 Apr 07 7:02 AM
CALL TRANSACTION 'MC88' USING TA_BDCDATA MODE 'N' UPDATE 'S' MESSAGES INTO TA_BDCMSGCOLL.
in this one, bdcmsgcoll internal table is not filling. why?
‎2014 Apr 07 7:05 AM
Hi Dhivya
When you execute it in foregroud mode are you getting any messages..? Please attach a debugging screen shot of internal table where it is blank..?
Nabheet
‎2014 Apr 07 7:14 AM
actually, the data is uploaded successfully. but i'm not getting that success message.
‎2014 Apr 07 7:21 AM
Dhivya,
Check it By passing 1 correct record and 1 wrong record, If the Correct record is Not Giving any message then Pass the message 'Updated successfully'. If the Wrong record through the error message pass the message to the final display.
‎2014 Apr 07 7:09 AM
Hi,
try writting commit work after call trasaction and see if the table fills.
Regards-
Makarand
‎2014 Apr 07 7:10 AM
Try running the BDC in foreground mode to check what messages are being generated.
‎2014 Apr 07 7:12 AM
Hi,
Use Mode 'A' so that you can understand whether there are messages during execution.
‎2014 Apr 07 7:20 AM
Hi Dhivya,
please change your code as shown and see
DATA : BEGIN OF options.
INCLUDE STRUCTURE ctu_params.
DATA : END OF options.
DATA: i_messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,
l_message LIKE bapiret2-message.
DATA: p_mode TYPE c.
DATA BEGIN OF it_error OCCURS 1.
DATA : text(100) TYPE c.
DATA END OF it_error.
DATA BEGIN OF it_success OCCURS 1.
DATA: text(100) TYPE c.
DATA END OF it_success.
DATA: it_raw TYPE truxs_t_text_data.
START-OF-SELECTION.
PERFORM upload_data.
* Report for success
PERFORM success_text.
* Report for Error
PERFORM error_text.
form UPLOAD_DATA .
* PERFORM open_group.
IF mode_a EQ 'X'.
p_mode = 'A'.
ELSEIF mode_n EQ 'X'.
p_mode = 'N'.
ENDIF.
options-defsize = 'X'.
options-updmode = ''.
options-dismode = p_mode.
*your bdc data ........
perform bdc_dynpro using 'SAPMF05A' '0100'.
CALL TRANSACTION 'FB01' USING bdcdata
OPTIONS FROM options
MESSAGES INTO i_messtab.
IF SY-SUBRC NE 0.
CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'
EXPORTING
id = sy-msgid
number = sy-msgno
language = sy-langu
textformat = 'ASC'
message_v1 = sy-msgv1
message_v2 = sy-msgv2
message_v3 = sy-msgv3
message_v4 = sy-msgv4
IMPORTING
message = l_message.
.
CONCATENATE l_message '-' wa_input-field1 wa_input-field2 INTO it_error-text
SEPARATED BY ' '.
APPEND it_error.
ELSE.
CONCATENATE 'DATA UPLOADED SUCCESSFULLY :' wa_input-field1 wa_input-field2
INTO it_success-text SEPARATED BY ' '.
APPEND it_success.
ENDIF.
REFRESH bdcdata.
CLEAR: wa_input,l_message.
ENDLOOP.
***ENDLOOP.
endform.
FORM success_text .
LOOP AT it_success.
AT FIRST.
WRITE :/10 'Following records successfully uploaded'.
ULINE.
ENDAT.
WRITE :/10 it_success-text.
ENDLOOP.
ENDFORM.
FORM error_text .
LOOP AT it_error.
AT FIRST.
WRITE :/10 'Following records are not uploaded'.
ULINE.
ENDAT.
WRITE :/10 it_error-text.
ENDLOOP.
ENDFORM.
LOOP AT it_input INTO wa_input.
‎2014 Apr 07 7:22 AM
yes, when i use mc88 directly, it shows the message 'plan saved under version**' like that.
but in shdb, it does not show that message.
‎2014 Apr 07 7:26 AM
Dhivya
Check the contents of SY-MSGID,SY-MSGNO etc after the call transaction in case of sucess and error both. May be you can use them if possible. It happens many a times with BDC
Nabheet