‎2006 Aug 29 10:12 AM
Hi Guys,
I have tried with the answers provided, but still with this form routine and the query below together. Must see that the database table zvehicle is inserted with data from initvechile which is internal table. if any changes are done to the table it should be modified and updated, with out re-inserting the field once again.
please help me out with this, i have never worked on forms before.
FORM vehicle_tab_fill USING p_line LIKE line
CHANGING p_initvehicle LIKE initvehicle.
SELECT SINGLE * FROM zvehicle INTO initvehicle
WHERE vin = zzvin.
IF bukrs = '4010'.
INSERT lines of initvehicle into p_initvehicle
where market = 'mlemarket'.
else
insert lines of p_vehicle into table zvehicle
where market = 'nscmarket'.
ENDIF.
UPDATE table zvehicle.
‎2006 Aug 29 10:19 AM
Can you please define the issue in bit more detail and is the below your code or the logic you are using...please cut=paste the particular code even.
Regards
Anurag
‎2006 Aug 29 10:19 AM
Can you please define the issue in bit more detail and is the below your code or the logic you are using...please cut=paste the particular code even.
Regards
Anurag
‎2006 Aug 29 11:11 AM
Hi,
you´re confusing us with your terms. You´re not working with forms but with subroutines. Forms are for printing information using either SAPscript or SmartForms.
You cannot work with Where in Insert. There´s also en error in your logic, that´s why your getting more lines than necessary.
SELECT SINGLE * FROM zvehicle INTO
table
initvehicleand market = 'mlemarket'.
UPDATE zvehicle from table initvehicle.
endif.
Mass update of several lines in a database table. Here, the primary key for identifying the lines to be updated and the values to be changed are taken from the lines of the internal table itab. The lines of the internal table must satisfy the same conditions as the work area wa in addition 1 to variant 2.
that could be an option if you were really working with many records, but I see that you work with only one (SELECT SINGLE), so you can also do this:
IF bukrs = '4010'.
update zvehicle set field = value
WHERE vin = zzvin
and market = 'mlemarket'.
endif.
You better read the documentation for UPDATE, because it´s a dangerous instruction if applied incorrectly:
update zvehicle set: field1 = value1
field2 = value2
WHERE vin = zzvin
and market = 'mlemarket'.
‎2007 Jan 19 8:03 AM