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: 

Script Problem

Former Member
0 Kudos

Hiu Experts,

i have a small doubt in SAP Scripts ,

if i select some 2 or 3 fields from database table and stored in internal table ,

i want to print that data into SAP Script how to do this

if i give directly table name with field name it will give output??

or i need to do some thing else please guide me

Thanks

Surendra

1 ACCEPTED SOLUTION

former_member196079
Active Contributor
0 Kudos

Hi suri

you must use a loop....and into the loop you must call the write form....

i don't think that you can use the loop statement into the sapscript window...


loop at itab into str.
  ....FM write form.
endloop.

if you want to print the field in line you must concatenate all the value and after

call the write form.


loop at itab into str.
  concatenate str-f1 str-f2 str- into line.
endloop.
FM  write form

hope this help you

regards

Marco

4 REPLIES 4

former_member196079
Active Contributor
0 Kudos

Hi suri

you must use a loop....and into the loop you must call the write form....

i don't think that you can use the loop statement into the sapscript window...


loop at itab into str.
  ....FM write form.
endloop.

if you want to print the field in line you must concatenate all the value and after

call the write form.


loop at itab into str.
  concatenate str-f1 str-f2 str- into line.
endloop.
FM  write form

hope this help you

regards

Marco

0 Kudos

Dear Macro,

Thanks for your suggestion

if i have one internal table with 2 records at that time what i need to do

Loop At itab.

FM-Write form

endloop

if i use the above code than it will give results??

0 Kudos

Hi Suri

Yes..in the window of sapscript you insert the name of the field you must write and it will work...

be carefull that tha FM will call 2 times and for that the value will write one below the other.

regards

Marco

Former Member
0 Kudos

1. First check in which Text Element your are updating database fields in itnernal table.

2. In SAP Script for the same text element add code for the displaying fields as &itab-fieldname&.