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

LSMW with Bapi

Former Member
0 Likes
475

hi I am Using lsmw with BApi,how can i capture the error file when the Bpiret2 table is populated,please let me know.

thanks alot

3 REPLIES 3
Read only

Former Member
0 Likes
447

Hi,

Every BAPI function module is having an error tab in which error messages are stored. You can captured it from there.

REWARD IF USEFUL

Read only

Former Member
0 Likes
447

how can i capture the error file when the Bpiret2 table is populated

use MESSAGE_PREPARE or FORMAT_MESSAGE function model to capture error messages as import parameters of fm are bapiret2

sample code:

FORM print_error_msg

using p_lt_messtab structure lt_messtab.

msgnr = p_lt_messtab-msgnr.

msgv1 = p_lt_messtab-msgv1.

msgv2 = p_lt_messtab-msgv2.

msgv3 = p_lt_messtab-msgv3.

msgv4 = p_lt_messtab-msgv4.

CALL FUNCTION 'MESSAGE_PREPARE'

EXPORTING

LANGUAGE = 'E'

MSG_ID = p_lt_messtab-msgid

MSG_NO = p_lt_messtab-msgnr

MSG_VAR1 = msgv1

MSG_VAR2 = msgv2

MSG_VAR3 = msgv3

MSG_VAR4 = msgv4

IMPORTING

MSG_TEXT = gt_text

EXCEPTIONS

FUNCTION_NOT_COMPLETED = 1

MESSAGE_NOT_FOUND = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

write:/ gt_text.

ENDFORM. " print_error_msg

Read only

Former Member
0 Likes
447

HI,

I am trying to load the date field in SAP using bapi in lsmw.

The default date is 01.01.1900.

the data is read correctly,even converted correctly(upto step-13).The data displyed after conversion is absolutely correct ie-01011900.But in idocs processing,loading is getting failed as i am getting an error like 'Month 19 is not pausible' in idoc overview.

If anybody know..how to recover please help.