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

displaying only error records

former_member612655
Participant
0 Likes
2,318

Hi experts,

I developed a bdc program for uploading the vendor bank details. My excel file contain some error records for that i used function module "Format_message", But after uploading excel file it displays only the popup msg like how many records contains errors and how many records were uploaded succesfully. But i wanted to see and display those error records .Can you please help to find out this.

Regards,

Bhavani.

Hi experts,

I developed a bdc program for uploading the vendor bank details. My excel file contain some error records for that i used function module "Format_message", But after uploading excel file it displays only the popup msg like how many records contains errors and how many records were uploaded succesfully. But i wanted to see and display those error records .Can you please help to find out this.

Regards,

Bhavani.

5 REPLIES 5
Read only

ArthurParisius
Contributor
2,072

Without sharing your code we will not be able to help you and I don't think the FM is the issue since the only thing it does is give you the text for an error message and nothing else.

Read only

former_member370623
Active Participant
0 Likes
2,072

Hi Bhavani

you can show your messtab like this.

*Convert BDCMSGCOLL to BAPIRET2
CALL FUNCTION ‘CONVERT_BDCMSGCOLL_TO_BAPIRET2‘
   TABLES
   imt_bdcmsgcoll = messtab[]
   ext_return  = bapiret2.
*
*Display messages from BAPIRET2
   CALL FUNCTION ‘RSCRMBW_DISPLAY_BAPIRET2‘
   TABLES
   it_return = bapiret2.
Read only

0 Likes
2,072

CALL TRANSACTION 'XK02' USING IT_BDCDATA

UPDATE 'A'

MODE 'N'

MESSAGES INTO IT_MSG.



READ TABLE IT_MSG WITH KEY MSGTYP = 'E'.

IF SY-SUBRC = 0.

IT_ERRORS-LIFNR = IT_MAT-LIFNR.

IT_ERRORS-BANKS = IT_MAT-BANKS.

IT_ERRORS-BANKL = IT_MAT-BANKL.

IT_ERRORS-BANKN = IT_MAT-BANKN.

IT_ERRORS-KOINH = IT_MAT-KOINH.

IT_ERRORS-BANKA = IT_MAT-BANKA.

IT_ERRORS-BRNCH = IT_MAT-BRNCH.

IT_ERRORS-SWIFT = IT_MAT-SWIFT.



CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = SY-MSGID

LANG = '-D'

NO = SY-MSGNO

V1 = SY-MSGV1

V2 = SY-MSGV2

V3 = SY-MSGV3

V4 = SY-MSGV4

IMPORTING

MSG = IT_ERRORS-TEXT

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

APPEND IT_ERRORS.

E1 = E1 + 1.

ELSE.

S1 = S1 + 1.

ENDIF.

ENDLOOP.

IF SY-SUBRC = 0.

MESSAGE I100(ZMSG1) WITH S1 'RECORDS TRANSFERRED SUCCESSFULLY' E1

'RECORDS CONTAINS ERRORS,PLS REFER DOWNLOAD FILE'.

ENDIF.

ENDFORM.

this is my function module can please provide me a sample program for solution
Read only

former_member370623
Active Participant
0 Likes
2,072
its something like this 
CALL TRANSACTION 'XK02' USING IT_BDCDATA UPDATE 'A' MODE 'N' MESSAGES INTO IT_MSG. *Convert BDCMSGCOLL to BAPIRET2 CALL FUNCTION ‘CONVERT_BDCMSGCOLL_TO_BAPIRET2‘ TABLES imt_bdcmsgcoll = IT_MSG[] ext_return = bapiret2. * *Display messages from BAPIRET2 CALL FUNCTION ‘RSCRMBW_DISPLAY_BAPIRET2‘ TABLES it_return = bapiret2.
Read only

Sandra_Rossi
Active Contributor
0 Likes
2,072

Function module FORMAT_MESSAGE is obsolete because you can use the statement MESSAGE instead.