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: 

BAPI_INCOMINGINVOICE_CREATE, error using just after entrysheet

Former Member
0 Kudos

Hi,

I have an RFC function module that call firstly to the BAPI_ENTRYSHEET_CREATE and then calls to the BAPI_INCOMINGINVOICE_CREATE.

I am getting the M8(607) error code Error in sobroutine frseg_fill read tab_esll estructure.

I have tried put a BAPI_TRANSACTION_COMMIT between both of the function modules. even I have tried to check if some entries have been added to tables essr and essl before processing the invoice creation.

If I put a delay, it works fine.

Anybody know how I can avoid this error, what I have to check, before call to the invoice creation.

Thanks for your attention.

BR

3 REPLIES 3

former_member181962
Active Contributor
0 Kudos

Hi Jorge,

Make a call to the FM MS_READ_ENTRY_SHEET in an indefinite loop and if it is successful, then only call the second bapi.

do.

call function 'MS_READ_ENTRY_SHEET'

if sy-subrc = 0.

exit.

endif.

enddo.

call function 'BAPI_INCOMINGINVOICE_CREATE'

alternatively you can check the table

ESLL if an entry exists for the package number

Regards,

Ravi

Former Member
0 Kudos

Hi Ravi,thanks for your response,

it sounds well, but it didn't work or maybe I did something in a wrong way.

I added in the source code the next call.

But I get the same error.

any other idea??

Thanks again

do.

CALL FUNCTION 'MS_READ_ENTRY_SHEET'

EXPORTING

i_lblni = entrysheet

I_WITH_ACCOUNTS = 'X'

I_WITH_ESKL = 'X'

I_WITH_ESLL = 'X'

I_EXISTENCE_CHECK = 'X'

.

if sy-subrc = 0.

exit.

endif.

enddo.

0 Kudos

Instead of checking for SY_SUBRC check for one of the return parameters. As SY_SUBRC would be 0 even if the entry sheet details are not found.

Regards,

Ravi