‎2007 Feb 05 3:59 PM
Hi Gurus,
How do I read a DD table new entry into a report?
Any one please help me out..
Thanks
Message was edited by:
ramana peddu
‎2007 Feb 05 10:15 PM
I looked at some of your other posts and I assume you want to make some changes every time some new entry is entered.
To do this, first you must create a table maintenance generator.
Goto SE11 and open the table in edit mode.
then in one of the menus - i think in GOTO, there is table maintenance generator. Click there.
Complete all the details and save it. You must enter a function group which will be created for this purpose.
save and activate (not sure if u need to activate).
Now goto environment and in that goto modification and inside that goto events.
Now click on new entries button and then choose the right event. In your case it would be AT NEW ENTRY.
In the next field, give a name for this event say at_new_entry.
then click on the editor button and it will prompt you to enter the name of the include file.
now u will get ur normal abap editor.
now in this you cannot start writing your code directly.
all your coding must be done within a form endform statement.
so in ur case u will say
FORM AT_NEW_ENTRY.
<your code will come here>
ENDFORM.
Now everytime some body makes an entry this form will get triggered.
Now if you want to refer to the data that has been passed, it will be passed through an internal table called extract.
so you will say
loop at extract.
endloop.
This will have several blank rows (15 if i remember right) and one row with ur data. Note that all your fields will be concatenated into a single string.
so if ur fields are v1 type char3,
v2 type char5,
v3 type char8.
if u want to refer to v2, you will extract+3(5).
Also u might want to do any validations only for those extracts for which the keys are not null because of the blank rows in extract.
Message was edited by:
Ramkumar Venkatasubramanian
‎2007 Feb 05 8:42 PM
Hi Ramana,
Check tables <b>TBTCO</b> and<b> TBTC</b>P for your requirements.
Thanks,
Sadhu Kishore
‎2007 Feb 05 10:15 PM
I looked at some of your other posts and I assume you want to make some changes every time some new entry is entered.
To do this, first you must create a table maintenance generator.
Goto SE11 and open the table in edit mode.
then in one of the menus - i think in GOTO, there is table maintenance generator. Click there.
Complete all the details and save it. You must enter a function group which will be created for this purpose.
save and activate (not sure if u need to activate).
Now goto environment and in that goto modification and inside that goto events.
Now click on new entries button and then choose the right event. In your case it would be AT NEW ENTRY.
In the next field, give a name for this event say at_new_entry.
then click on the editor button and it will prompt you to enter the name of the include file.
now u will get ur normal abap editor.
now in this you cannot start writing your code directly.
all your coding must be done within a form endform statement.
so in ur case u will say
FORM AT_NEW_ENTRY.
<your code will come here>
ENDFORM.
Now everytime some body makes an entry this form will get triggered.
Now if you want to refer to the data that has been passed, it will be passed through an internal table called extract.
so you will say
loop at extract.
endloop.
This will have several blank rows (15 if i remember right) and one row with ur data. Note that all your fields will be concatenated into a single string.
so if ur fields are v1 type char3,
v2 type char5,
v3 type char8.
if u want to refer to v2, you will extract+3(5).
Also u might want to do any validations only for those extracts for which the keys are not null because of the blank rows in extract.
Message was edited by:
Ramkumar Venkatasubramanian