‎2014 Dec 18 10:47 AM
Hi,
i have a table maintenance for a Z table. How could i use update/modify statement to update records in this Z table. Among all the columns i have one qty field which is in edit mode. In case of any change in this qty i want to update few other columns which are in non-edit mode. i tried database update in event 01 but its not working. could anybody please suggest how could i achieve this.
Rgds
‎2014 Dec 18 11:17 AM
‎2014 Dec 18 10:57 AM
Hii Test match
you have to write separate code to achieve your result.
first you have to select original qty..
then update / modify that field with new qty.
then again select same data which contain new qty field
and update fields u want to change accordance with new qty by using update, set statements which where clause .
regards
Gaurav
‎2014 Dec 18 11:10 AM
Hello Gaurav,
What do you mean by separate code? i want to know where should i write update or modify statement to update a non-editable field based on user input. pls advise
rgds
‎2014 Dec 18 11:12 AM
Hi Gaurav,
Create table maintenance view for your Z Table in SE11
Then Go Mentainence Genrator for your mentanece view in TCode SE14
the you will be able toedit your Z tables data through maintenance view.
Regards
Ashraf Usmani
‎2014 Dec 18 11:17 AM
hello Ashraf,
i want to update fields at run time. so user is making some changes in one field in SM30. when save, other field(s) should also change n background.
rgds
‎2014 Dec 18 11:20 AM
hii test match
if you already have table maintenance generator you can use tcode sm30
but der you wont be able to change non editable fields
so to change those fields along with qty you have to write separate coding i mean zprogram
Regards
Gaurav
‎2014 Dec 18 11:50 AM
Hi
As per my understanding PFB codes:
Select ZTABLE into ITAB
Loop At ITAB
"Modify ITAB according to req.."
ENDLOOP.
UPDATE ZTABLE FROM TABLE ITAB.
OR
UPDATE ZTABLE SET NAME = ITAB-NAME
EMP_NAME = ITAB-EMP_NAME
EMP_DOB = ITAB-EMP_DOB
EMP_NO = ITAB-EMP_NO
WHERE NAME = ITAB-NAME AND
EMP_NAME = ITAB-EMP_NAME.
ENDIF.
OR
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
wa_ekpo TYPE t_ekpo.
START-OF-SELECTION.
select ebeln ebelp statu aedat matnr menge meins netpr peinh up to 10 rows from ekpo
into table it_ekpo
where ebeln = P_ebeln.
END-OF-SELECTION.
loop at it_ekpo into wa_ekpo.
wa_ekpo-netpr = '100'.
MODIFY it_ekpo INDEX sy-tabix FROM wa_ekpo TRANSPORTING netpr.
endloop.
Regards
Ashraf Usmani
‎2014 Dec 18 11:17 AM
‎2014 Dec 18 11:24 AM
hello Raymond,
i don't have any hidden field. i have 3 quantity fields. these are: available qty, consumed qty & remaining qty. only consumed qty field is in edit mode. now when user change consumed qty in any row corresponding remaining qty field should update automatically by a simple formula i.e., available qty - consumed qty.
my problem is that where should i write this formula. is there any event or any other way to achieve this.
Rgds
‎2014 Dec 18 12:58 PM
‎2014 Dec 18 1:20 PM
we have <vim_total_struc> available. hope changing values in this structure will help me. please let me know if you have any idea about this structure.
rgds
‎2014 Dec 18 1:54 PM
This has come up a number of times before in SCN. If you search, I'm sure you will find some answers. (But I've used event 01 - when saving).
Rob
‎2014 Dec 18 2:08 PM
‎2014 Dec 21 9:56 AM