05-20-2009 8:16 AM
Hi Guys ,
I need to modfiy database table from the value in workare .iam dooing the code as below ..
modify Zdata_base from ls_inter_numb.
but it is not working ..
Can any one give right approach .
Regards,
Sri
05-20-2009 8:19 AM
what is the error you getting ?
Create the same workarea structure as your database table structure.
Can you paste the code of your workarea declaration ?
05-20-2009 10:28 AM
Hi,
below is the sample code ...
Select mara from Zmaterial into ls_mara
where ZMPN = <ls_INPUT_row>-ZMPN and
ZMNFR = <ls_INPUT_row>-ZGLBMF_CODE.
IF sy-subrc NE 0.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
NR_RANGE_NR = '01'
OBJECT = 'ZOBJ_MPN'
IMPORTING
NUMBER = LS_INTER_NUMB.
modfiy zmaterial from LS_INTER_NUMB.
Like this iam dooing ..
Regards,
Sri
05-20-2009 10:35 AM
I hope the Database table(ZMATERIAL) has only one field MARA. If not then your logic is wrong...
05-20-2009 8:21 AM
Hi Sri,
1) Make sure that the structure of the internal table / Work area is same as the structure of the data base table.
2) Write COMMIT WORK statement after the MODIFY statement and check.
Regards,
Kumar Bandanadham
05-20-2009 8:34 AM
Try to use a where clause and observe the Sy-subrc after that.
Thanks,
Mathivanan.G
05-20-2009 8:26 AM
Hi,
Please check the strucutre of the work area is same with the ztable
Loop at itab into ls_inter_numb.
modify Zdata_base from ls_inter_numb.
commit work.
endloop.
this must resolve your issue.. if dont please post the code -> ztable updating
05-20-2009 8:39 AM
Hi Sriram,
Collect all the data into an internal table and then modify in database.
For example:
Append ls_workarea TO it_table.
SORT it_table BY field.
IF NOT it_table[] IS INTIAL.
MODIFY Z_DB_TABLE from TABLE it_TABLE.
ENDIF.
This will work.
Regards,
Prashant