‎2008 May 21 10:09 PM
Is it possible to add data into a table through a report transaction. I have been asked to create a report in which when we add certain data in the selkection screen it updates thoses particular fields and the rest of the records can be fille dout in the output. Basically I have a customised allocation table called zalloc. I have to create a report with selection screen having receiving plant, material document of the original transfer psoting , issuning plant , line item number , batch, receiving and issuning storage location. I need to validate this against the mseg table and whatever entry I make in teh selection screen should update my zalloc table from here.
Can anyone help me with this please.
Thanks
‎2008 May 21 11:00 PM
Hi there.
Giving an unswer to your question ... yes, it's possible to update a table in a custom report.
For that, you should:
.enqueue your ztable (or try to), and if you can,
.update it using comands:
UPDATE ztable
SET field1 = 'abc' ... fieldn = 'nbc'
WHERE key = 'xpto'.
OR
INSERT ztable FROM wa_ztable.
.dequeue the ztable.
Best regards.
Valter Oliveira.
‎2008 May 21 11:00 PM
Hi there.
Giving an unswer to your question ... yes, it's possible to update a table in a custom report.
For that, you should:
.enqueue your ztable (or try to), and if you can,
.update it using comands:
UPDATE ztable
SET field1 = 'abc' ... fieldn = 'nbc'
WHERE key = 'xpto'.
OR
INSERT ztable FROM wa_ztable.
.dequeue the ztable.
Best regards.
Valter Oliveira.
‎2008 May 21 11:09 PM
Hi Aarav,
Yes, It is possible to add records to a table using a report transaction. You can use Update or Modify to insert records in a table.Convert the data fetched from the ZALLOC and convert it into an internal table of the same format as that of the ZALLOC table and simply do an
loop at itab_zalloc into wa_zalloc.
*INSERT INTO ZALLOC FROM WA_zalloc*.
endloop.
OR
INSERT ZALLOC FROM TABLE ITAB_ZALLOC
OR
UPDATE ZALLOC FROM TABLE ITAB__ZALLOC .
Update will modify if that record exist and returns sy-subrc as non zero if entry does not exist.
OR
MODIFY updates an existing DB entry or, in no matching entry exists, inserts a new entry into the DB table