05-11-2010 11:16 AM
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
05-11-2010 11:23 AM
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
05-11-2010 11:23 AM
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
05-11-2010 11:42 AM
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??
05-11-2010 11:47 AM
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
05-11-2010 11:24 AM
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&.