Application Development and Automation 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: 
Read only

bdcmsgcoll is not working

Former Member
0 Likes
1,409

CALL TRANSACTION 'MC88' USING TA_BDCDATA MODE 'N' UPDATE 'S' MESSAGES INTO TA_BDCMSGCOLL.

in this one, bdcmsgcoll internal table is not filling. why?

9 REPLIES 9
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,286

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

Read only

0 Likes
1,286

actually, the data is uploaded successfully. but i'm not getting that success message.

Read only

0 Likes
1,286

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.

Read only

Former Member
0 Likes
1,286

Hi,

try writting commit work after call trasaction and see if the table fills.

Regards-

Makarand

Read only

Former Member
0 Likes
1,286
  • Are you checking the correct table ? i.e TA_BDCMSGCOLL ?
  • Is any message being generated in the transaction ?

Try running the BDC in foreground mode to check what messages are being generated.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,286


Hi,

Use Mode 'A' so that you can understand whether there are messages during execution.

Read only

former_member187748
Active Contributor
0 Likes
1,286

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(100TYPE c.

DATA  END   OF it_error.

DATA  BEGIN OF it_success OCCURS 1.

DATAtext(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.

Read only

Former Member
0 Likes
1,286

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.

Read only

0 Likes
1,286

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