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

Update statement.

Former Member
0 Likes
619

Hi,

I am trying to update a DB table for a single column with the below stmt:

PERFORM enqueue_table USING l_subrc

'PA9100'.

UPDATE pa9100 SET z_nca_required = c_yes

WHERE pernr EQ wa_emp_tab-pernr AND

endda EQ c_date.

IF SY-SUBRC EQ 0.

PERFORM dequeue_table USING 'PA9100'.

COMMIT WORK.

ELSE.

PERFORM dequeue_table USING 'PA9100'.

MESSAGE i016 WITH text-010.

ENDIF.

But its showing sy-subrc = 4.

Please reply.

Regards,

Binay.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
601

Hi Shankar,

Sy-subrc is coming 4 because no line was updated.

Check with the where condition wheter any entry exsist or not.

4 REPLIES 4
Read only

Former Member
0 Likes
601

Hi,

Check the reason for sy-subrc = 4.

No line was updated because either no line could be selected or the change would have generated lines with primary keys that already existed.

May be no data exist satisfying the condition.

Read only

Former Member
0 Likes
602

Hi Shankar,

Sy-subrc is coming 4 because no line was updated.

Check with the where condition wheter any entry exsist or not.

Read only

0 Likes
601

Be careful with format of data of WHERE condition.

Read only

Former Member
0 Likes
601

Check if the table was enqueued first ...

check l_subrc ...

Also it's not recommended to update Infotypes directly ..

Instead use FM's ..

use : HR_INFOTYPE_OPERATION.