09-05-2006 4:41 PM
Hi all
i have a int .table(T_ZVXX) that has a status field .
my code is
select *
from ZVXX (ZVXX has matnr,inv.no. is key field)
into t_zvxx
where status is null.
now i have certain proceesing after thati m doing like that
concatenate 'Screen'
T_ZVXX-matnr
'Business Area'
'100'
T_ZVXX-maktx
into T_OUTPUT-line.
Append t_output
clear t_output
concatenate 'Message'
T_ZVXX-vbeln
sy-datum
'500'
T_ZVXX-matnr
into T_OUTPUT-line.
Download T_OUTPUT to a unix file.
***Main problem is i have to update a table(set the Staus to X initialy it was null )for the records which is downloaded successfully.
How can modify the Data base table ZVXX for the successfully downloaded record.
since it is concatenation i can not detect the key fields bcoz i have different conditions for concatenate(i.e sequence of Concatenate changes always)
Thanks
Saurabh Tiwari
09-05-2006 9:56 PM
Hello Saurabh
If I understand correctly you get for certain entries in T_ZVXX a corresponding concatenated entry in T_OUTPUT.
To solve your problem I would define a third itab like that:
DATA:
ld_idx TYPE sy-tabix,
lt_index TYPE TABLE OF sytabix.
Every time that you process an entry of T_ZVXX you write its index into this itab:
LOOP AT t_zvxx INTO ls_zvxx.
ld_idx = syst-tabix.
IF ( <condition is true> ).
* do concatenation into t_output
APPEND ld_idx TO lt_index. " collect indices
ELSE.
continue.
ENDIF.
ENDLOOP.
Finally, loop over your index itab and modify the status of the corresponding entry in t_zvxx, then DB update.
Regards
Uwe
09-06-2006 8:51 AM
hi,
use :
update ZVXX
set status = 'X'
where Status = space
and
...
A.
Message was edited by: Andreas Mann
09-06-2006 8:23 AM
hi,
after you give statement to modify your table,
give 'Commit work' statement.
cheers,
Aditya.