‎2007 Nov 22 8:33 AM
Hi all,
If i do this I am not inserting a new line on table ADR6? I need to update this table with one new entry. How can i do that?
The code bellow is not working.
LOOP AT lt_xvbpa.
UPDATE adr6
SET addrnumber = lt_xvbpa-adrnr
flgdefault = c_mark
home_flag = c_mark
WHERE .
COMMIT WORK AND WAIT.
Thanks a lot
Best regards
‎2007 Nov 22 8:34 AM
update table dbname.
insert new line
DATA scarr_wa TYPE scarr.
scarr_wa-carrid = 'FF'.
scarr_wa-carrname = 'Funny Flyers'.
scarr_wa-currcode = 'EUR'.
scarr_wa-url = 'http://www.funnyfly.com'.
INSERT INTO scarr VALUES scarr_wa.
‎2007 Nov 22 8:34 AM
update table dbname.
insert new line
DATA scarr_wa TYPE scarr.
scarr_wa-carrid = 'FF'.
scarr_wa-carrname = 'Funny Flyers'.
scarr_wa-currcode = 'EUR'.
scarr_wa-url = 'http://www.funnyfly.com'.
INSERT INTO scarr VALUES scarr_wa.
‎2007 Nov 22 8:37 AM
Hi,
If u dont have any conditions in WHERE clause just remove it.
LOOP AT lt_xvbpa.
UPDATE adr6
SET addrnumber = lt_xvbpa-adrnr
flgdefault = c_mark
home_flag = c_mark.
COMMIT WORK AND WAIT.
ENDLOOP.
The above code will do.
Tnx,
‎2007 Nov 22 8:39 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
‎2007 Nov 22 8:39 AM
here one more thing is addrnumber is a primary key field...which will not allow your updates..i hope....
anyhow try this....
LOOP AT lt_xvbpa.
UPDATE adr6
SET addrnumber = lt_xvbpa-adrnr flgdefault = c_mark home_flag = c_mark where addrnumber = '30938'.
COMMIT WORK AND WAIT.
Message was edited by:
Muthurajan Ramkumar
‎2007 Nov 22 8:45 AM
Hum, i see your point Muthurajan Ramkumar.
I can't insert new lines in table ADR6 because I have addrnumber like a primay key field.
I tried all the examples and didn't worked. So I am not able to insert new lines in this table.
Thanks all.
‎2007 Nov 22 8:48 AM
Hi,
If u want insert new entry, then try with INSERT command.This will insert a new line if there is no matching record found else it updates the table.
Tnx,