Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Adding data into a custom table through a report transaction

Former Member
0 Likes
1,794

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

1 ACCEPTED SOLUTION
Read only

valter_oliveira
Active Contributor
0 Likes
1,318

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.

2 REPLIES 2
Read only

valter_oliveira
Active Contributor
0 Likes
1,319

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.

Read only

Former Member
0 Likes
1,318

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