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

BDC(to display all the errors)

Former Member
0 Likes
852

Hi Experts,

I am uploading data from flat file to sap application by using bdc call transaction method. My flat file is in Txet format.

Now i want to display all the errors which are nor processed.

The error report should be line no.of error record,error message and the records which are uploading.

i am using bdcmsgcoll structure.but it is not having the fields which are required for me. will suggest me with coding how to do it.

Thanks in advance,

Mythily

Hi Experts,

I am uploading data from flat file to sap application by using bdc call transaction method. My flat file is in Txet format.

Now i want to display all the errors which are nor processed.

The error report should be line no.of error record,error message and the records which are uploading.

i am using bdcmsgcoll structure.but it is not having the fields which are required for me. will suggest me with coding how to do it.

Thanks in advance,

Mythily

5 REPLIES 5
Read only

Former Member
0 Likes
808

Hi Mythili,

Loop at itab.

after call transaction check sy-subrc.

LOOP AT gt_bdcmsg INTO gs_bdcmsg WHERE msgtyp = 'S'.

PERFORM format_msg.

gs_error-lineno = gv_row.

gs_error-icon = gs_icongrn-id.

APPEND gs_error TO gt_error.

CLEAR : gv_text, gs_error.

ENDLOOP.

LOOP AT gt_bdcmsg INTO gs_bdcmsg WHERE msgtyp = 'E'.

PERFORM format_msg.

gs_error-lineno = gv_row.

gs_error-icon = gs_iconred-id.

APPEND gs_error TO gt_error.

CLEAR : gv_text, gs_error.

ENDLOOP.

endloop.

Feel free to ask any doubt.

Regards,

Vijay

Read only

Former Member
0 Likes
808

Hi,

By using function module FORMAT_MESSAGE

Here is a sample code:

LOOP AT t_message INTO fs_bdcmsgcoll.(T_message is a type of bdcmsgcoll)

    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        id        = fs_bdcmsgcoll-msgid
        lang      = sy-langu
        no        = fs_bdcmsgcoll-msgnr
        v1        = fs_bdcmsgcoll-msgv1
        v2        = fs_bdcmsgcoll-msgv2
        v3        = fs_bdcmsgcoll-msgv3
        v4        = fs_bdcmsgcoll-msgv4
      IMPORTING
        msg       = w_message
      EXCEPTIONS
        not_found = 1
        OTHERS    = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
      WRITE:/   w_message.
endif.
endloop.

Hope this solves the issue, let me know if any queries.

Regards,

Rajani

Read only

Former Member
0 Likes
808

There are some success and error records in my bdc(call transaction method) uploading.

i need error report should be line no.of error record,error message and the records which are not uploaded.

Read only

0 Likes
808

Hi Mythily agian,

I have already given you explanation regarding your problem.

look to my first thread, I hope this will useful for you.

after call transaction you can check sy-subrc.

if sy-subrc is not 0. debug your error_message table there you can find message id, message number, message type and so many things.

you can take this into account and find exact error.

If you want row number of flat file in which error record is present.

while looping store into a variable say row_no of type i.

Feel free if you have any doubts. I will be glad if i satisfy your answer.

Regards,

Vijay

Read only

Former Member
0 Likes
808

hi experts,

i am not getting any information. will anybody give me useful information regarding this?