2020 Jan 30 7:36 AM
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.
2020 Jan 30 7:53 AM
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.
2020 Jan 30 8:15 AM
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.
2020 Jan 30 8:59 AM
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
2020 Jan 30 10:38 AM
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.
2020 Jan 30 11:41 AM
Function module FORMAT_MESSAGE is obsolete because you can use the statement MESSAGE instead.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |