‎2007 Nov 19 7:25 AM
Hi all.....
i got this dynamic program to insert to the database. however it only grab the first value and insert. All my remain value is not insert to the database.
here is my program.
REPORT ZGARY_MASTER1.
do 5 times.
icounter = icounter + 1.
APPEND 'REPORT ZGARY_ZDYN3.' TO CODE.
APPEND 'tables ZTABLE.' to code.
APPEND 'data icounter(3) type n.' to code.
APPEND 'START-OF-SELECTION.' TO CODE.
CONCATENATE 'ZTABLE-ADMINO = ''' icounter into value.
CONCATENATE value '''.' into value.
APPEND value TO CODE.
APPEND 'INSERT INTO ZTABLE VALUES ZTABLE.' to code.
INSERT REPORT 'ZGARY_ZDYN3' FROM CODE.
SUBMIT ZGARY_ZDYN3 and RETURN.
clear code.
enddo.
any great help?
‎2007 Nov 19 7:27 AM
Hi Gary,
Also have a look at below weblog:
It gives you info abt how to create dynamic internal table.
/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically
/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table
/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table%3Fpage%3Dlast%26x-showcontent%3Doff
http://www.sap-img.com/ab030.htm
/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
http://searchsap.techtarget.com/tip/1,289483,sid21_gci912390,00.html
<b>Reward points if this helps.
Manish</b>
‎2007 Nov 19 7:27 AM
Hi Gary,
Also have a look at below weblog:
It gives you info abt how to create dynamic internal table.
/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically
/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table
/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table%3Fpage%3Dlast%26x-showcontent%3Doff
http://www.sap-img.com/ab030.htm
/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
http://searchsap.techtarget.com/tip/1,289483,sid21_gci912390,00.html
<b>Reward points if this helps.
Manish</b>
‎2007 Nov 19 7:30 AM
is not creating of dynamic table but is do with create dynamic program. i append the line to the dynamic program.... the report will have the line. Initial the report hav no line.
‎2007 Nov 19 7:41 AM
Hi gary,
After Insert , if you want to generate a report , try this:
INSERT REPORT lv_reportname FROM code.
GENERATE REPORT lv_reportname.
COMMIT WORK AND WAIT.
Rgds,
Sandeep
‎2007 Nov 19 7:54 AM
hi gary,
i have tried your code and itz working 5ne...plz chk the code below...
table detaisl : ztest11
field : abc type char -len :20
code :
data icounter(3) type n.
DATA code TYPE TABLE OF rssource-line.
DATA value(20) TYPE c.
initialization.
icounter = 0.
do 5 times.
icounter = icounter + 1.
APPEND 'REPORT ZGARY_ZDYN3.' TO CODE.
APPEND 'tables ZTEST11.' to code.
APPEND 'data icounter(3) type n.' to code.
APPEND 'START-OF-SELECTION.' TO CODE.
CONCATENATE 'ZTEST11-ABC = ''' icounter into value.
CONCATENATE value '''.' into value.
APPEND value TO CODE.
APPEND 'INSERT INTO ZTEST11 VALUES ZTEST11.' to code.
INSERT REPORT 'ZGARY_ZDYN3' FROM CODE.
SUBMIT ZGARY_ZDYN3 and RETURN.
clear code.
clear value.
enddo.
thanks
jaideep
*reward p[oints if useful