Application Development 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: 

dynamic program help

Former Member
0 Kudos

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?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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>

4 REPLIES 4

Former Member
0 Kudos

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>

0 Kudos

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.

0 Kudos

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

jaideeps
Advisor
Advisor
0 Kudos

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