12-03-2007 6:56 AM
hi all,
i have developed a report where i update a table with correct feild.
i display the output with write message, if a record is been updated once it gives me -->order no. 12345 updated . but if i execute the report again it gives me the same order no updation
Well, once i update the table with the correct field it should not give me the updation
message again
i am not getting how to do this.
any advice?
thnkx
bhanu
12-03-2007 7:01 AM
Hi Bhanu,
before updating the table check whether the correct field exists already..if so then do not update...then ur pblm wil be resolved..
Regards,
Kaveri..
12-03-2007 7:01 AM
Hi Bhanu,
before updating the table check whether the correct field exists already..if so then do not update...then ur pblm wil be resolved..
Regards,
Kaveri..
12-03-2007 7:06 AM
Ok i will check abt it and let you all know
thnkx
i will assure u points
12-03-2007 7:02 AM
Hi Bhanu,
AS Per my understanding, if you are updating a field once if u are updating the field with same value next time it is again updating the same value and giving you the message it ahs been updated sucessfully. When you don't want to do this then try to compare the previous value and present value and if they are same then don't update if not update it.
This is solution as per my understanding. If it is useful please reward and if I am wrong Please correct.
Thanks,
Murthy
12-03-2007 7:06 AM
Hi,
Before updating select the value from the table and check that if that entry exists,if yes then don't update and give message that already updated,if no then update the field and give message as field updated..
Regards,
nagaraj
12-03-2007 7:06 AM
Hi,
Refer this code
&----
*& Form SUB_READ_UPDATE_BSEG
&----
text
----
FORM sub_read_update_bseg.
IF NOT it_final[] IS INITIAL.
LOOP AT it_final INTO wa_final.
UPDATE bseg SET zuonr = wa_final-ccnum
WHERE bukrs EQ wa_final-bukrs
AND belnr EQ wa_final-vbeln
AND rfzei EQ wa_final-rfzei
AND saknr NE ' '.
ENDLOOP.
*--Message data updated successfully
MESSAGE i888 WITH text-002.
LEAVE LIST-PROCESSING.
ELSE.
*--Message No data found
MESSAGE i888 WITH text-003.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " SUB_READ_UPDATE_BSEG
Regards,
Prashant
12-03-2007 7:09 AM
I HAVE TAKEN THE FIELD LIKE THIS-->
WA_NEW-DATE IF NOT INITIAL.
UPDATE TABLE NAME.
NOW IF I WANT TO CHECK IF ITS ALREADY UPDATED
THEN?
12-03-2007 7:17 AM
Hi Bhanu,
add one more check...
check table name-date is not initial with key field..
Regards,
Kaveri
12-03-2007 7:19 AM
Hi,
Try like this
select single date from dbtable into v_date
where date = wa_new-date.
if sy-subrc eq 0.
(means record is thre).
message (record already exists).
else
update dbtable from wa_new.
message(record updated successfully).
endif.
Regards,
Nagaraj