Application Development 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: 

Error with creating a new employee - PA40

Former Member
0 Kudos

When creating a new employee record using PA40, the PERNR gets generated as soon as Infotype 0000 is updated. How do we capture the new PERNR, if a BDC recording of PA40 fails midway during the process

I would appreciate and reward any valuable ideas!

2 REPLIES 2

Former Member
0 Kudos

create a session for error messages....and u can go to sm35 and check what has ahppened.....if not use format_message and display what has happened as report output....in case of BDC fail......!!!!!

it will be like....

call transaction 'PA40' using it_bdctab

mode 'N'

update 'S'

messages into it_bdcmsgcoll.

if sy-subrc <> 0.

*--store the pernr for which bdc failed......here!!!

call function 'bdc_open_group'

.....

call function 'bdc_insert'

call function format_message

....

call function 'bdc_close_group'

*---check error and try to rectify it.....

Regards

Vasu

Former Member
0 Kudos

Hi,

You can get the message using messtab in call transaction then pass the same to session method for error entries. then process the same using session method

Regards

Shiva