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 where condtion

Former Member
0 Likes
296

HI,

I am using update statement in the Z table.Please find the code for refrence

LOOP AT g_tait_control_itab2 INTO g_tait_control_wa .

READ TABLE it_panel INTO wa_panel WITH KEY quantity = g_tait_control_wa-quantity.

IF sy-subrc NE 0.

UPDATE zsd_tab_pan_bid SET quantity = g_tait_control_wa-quantity

WHERE sno = g_tait_control_wa-sno

AND panel = g_tait_control_wa-panel

AND speck = g_tait_control_wa-speck

AND make = g_tait_control_wa-make

AND rate = g_tait_control_wa-rate

AND curr = g_tait_control_wa-curr

AND itemnum = g_tait_control_wa-itemnum

AND tendernum = pa_tend.

endloop.

while excuting this code my where condtion is mismatching.I am not getting exact values of Z tables that are in the work area of internal table it is taking the first value of the Z table.

Please suggest me how to match exact where condtion of Z table

Thanks in advance correct inputs are rewarded

Rasheed

1 REPLY 1
Read only

Former Member
0 Likes
274

Hi Check this

PARAMETERS: table TYPE c LENGTH 30,

column TYPE c LENGTH 30,

old_curr TYPE sycurr.

DATA: set_expr TYPE string,

condition TYPE string.

CONCATENATE column ` = 'EUR'`

INTO set_expr.

CONCATENATE column ` = old_curr`

INTO condition.

TRY.

UPDATE (table)

SET (set_expr)

WHERE (condition).

CATCH cx_sy_dynamic_osql_error.

MESSAGE `Error in update!` TYPE 'I'.

ENDTRY.

Hope this helps,

Murthy.