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: 

Sy-subrc = 0 for Select query,but no records found in SE16

0 Kudos

Hi,

I have created an implicit enhancement to update a Z table with rundate and ID, for T-code F110,

at the end of FORM SICHERN (Include - F110VFS0).    Please check screenshot.

When I press save in Tcode F110 after entering Parameters. The enhancement is called.

Then I check se16n and I find no new records in the table REGUV.

But,

at the same time, inside the enhancement the select statement gives sy-subrc = 0.


Can the experts guide me on what is happening here.


Message was edited by: Debarghya Sarkar

1 ACCEPTED SOLUTION

former_member210008
Active Participant
0 Kudos

Hi.

Did you check content of LS_REGUV? Is it empty?

9 REPLIES 9

former_member210008
Active Participant
0 Kudos

Hi.

Did you check content of LS_REGUV? Is it empty?

raymond_giuseppi
Active Contributor
0 Kudos

Remarks

  • REGUV is standard table, it is fortunate that you find the current payment run (*)
  • Then you try to add an initial record in ZREGUV

Change your logic, you have to add a new record in ZREGUV when it doesn't exist in ZREGUV and use data of F110V/REGUV.

Regards,

Raymond

(*) If you use explicit enhancement at end of form SICHERN(F110VFS0) so after the statements insert/update reguv.

thanga_prakash
Active Contributor
0 Kudos

Hello Debarghya

What is the value of F110V-LAUFD and F110V-LAUFI in the run time.


If the values are blank then the select statement will select the latest entry from the table.

Regards,

TP

0 Kudos

Hi Raymond / Thanga / Evgeniy,

Thanks for your quick response.

The problem does not lie with what is coded within     If sy-subrc NE 0.... Endif  block.

The problem is this:

We have written a select statement and it is fetching a valid value with sy-subrc = 0.

Ideally this value should also be shown when we go through SE16.

But this does not happen. The Number of entries in the table REGUV remains exactly

what it was before at this stage.

The values in LAUFD and LAUFI are irrelevant here.

Question is  

How is the select statement fetching correct values at this stage in Implicit Enhancement point

when there is no such entry if we check via SE11 / SE16 etc.

Steps to replicate:

1) Code in the place shown in screenshot from line 2 to line 10.

2) Go to F110 and enter today's date in "Run date" and any value in "Identification".

3) Fill Parameters tab with Company Code , Payment Method and Next p/date. Enter a vendor

    for which payment is not done (open item).

4) Before clicking on save check number of entries in REGUV table then Click on Save.

5) You will reach the break point.

6) Check number of entries in REGUV.

7) Now execute the select statement. You will get sy-subrc = 0 which means system has

   fetched the record from the database. This also means that entry is saved in the database.

   This means that number of entries in REGUV should increase by 1.

   But this is not the case.

I hope above explanation has clarified the problem.

Kindly assist.

0 Kudos

Your code (is it actually at end of SICHERN form?) is executed before any atabase commit (*) so when you execute SE16/SE16N inanother mode/session you have almost no chance to find the record, also in the case of any ROLLBACK. As you code is executed in the same LUW your select is successful.

I just hope you didn't use some wrong format for the date?

Regards,

Raymond

(*) read Implicit Database Commits, so a dynpro display or a leave transaction will commit database, but even then be aware of buffering effects.

0 Kudos

Hi Raymond,

Yes it is inside the form SICHERN and at the end.

A few line before the enhancement is the statement INSERT REGUV in Include F110VFS0.


Thanks for your guidance.

I have a query though.

Yes you are right that the COMMIT has not been executed.

But

Whenever, we write a select statement, the system should pull the records from the database

(provided table buffering is inactive).

But the point is, if the values are not yet committed then it means that they are not yet written to

the database.

So, how is the select statement fetching Database records which are not yet written to the database ?

Note : Buffering is not allowed in REGUV.

0 Kudos

Just look for "Database Logical Unit of Work (LUW)" in online help, you are in the same unit that inserted the record, so you share the same implicit memory area.

What will happen if you use an explicit BYPASSING BUFFER in the SELECT statement, what will happen if you call FM DB_COMMIT?

Regards,

Raymond

VenkatRamesh_V
Active Contributor
0 Kudos

Hi Debarghya,

Try.

INSERT ZREGUV FROM LS_REGUV.

COMMIT WORK.

Hope it helpful,

Regards,

Venkat.

max_anjos
Explorer
0 Kudos

Hi Debarghya,

Can you display a print screen the content of LS_REGUV after of SELECT in debug?

Hope it helpful,

Regards,

MaX.