Application Development and Automation 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: 
Read only

print data in excel file

Former Member
0 Likes
407

hi all,

i made one program in which i get multiple tabs in one excel .n ow i want to fill data in it. but as soon as i do that my data is overwritten on my header. kindly help me for this.

this is my block of code which i am using:

CALL METHOD OF application 'Worksheets' = sheet

EXPORTING #1 = 2.

SET PROPERTY OF sheet 'Name' = 'region'.

CALL METHOD OF sheet 'Activate'.

LOOP AT IT_REGION.

index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = 1."index.

SET PROPERTY OF cells 'Value' = IT_REGION-REGIONName.

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = 2."index.

SET PROPERTY OF cells 'Value' = IT_REGION-REGIONCode.

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = 3."index.

SET PROPERTY OF cells 'Value' = IT_REGION-REGIONDescription.

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = 4."index.

SET PROPERTY OF cells 'Value' = IT_REGION-CountryCode.

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = 5."index.

SET PROPERTY OF cells 'Value' = IT_REGION-ChangeType.

ENDLOOP.

i want to take data from t005 table.

kindly help me for the same.

With Regards,

Sulabh

hi all,

i made one program in which i get multiple tabs in one excel .n ow i want to fill data in it. but as soon as i do that my data is overwritten on my header. kindly help me for this.

this is my block of code which i am using:

CALL METHOD OF application 'Worksheets' = sheet

EXPORTING #1 = 2.

SET PROPERTY OF sheet 'Name' = 'region'.

CALL METHOD OF sheet 'Activate'.

LOOP AT IT_REGION.

index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = 1."index.

SET PROPERTY OF cells 'Value' = IT_REGION-REGIONName.

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = 2."index.

SET PROPERTY OF cells 'Value' = IT_REGION-REGIONCode.

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = 3."index.

SET PROPERTY OF cells 'Value' = IT_REGION-REGIONDescription.

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = 4."index.

SET PROPERTY OF cells 'Value' = IT_REGION-CountryCode.

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = 5."index.

SET PROPERTY OF cells 'Value' = IT_REGION-ChangeType.

ENDLOOP.

i want to take data from t005 table.

kindly help me for the same.

With Regards,

Sulabh

1 REPLY 1
Read only

Former Member
0 Likes
365

by my own... use ole method to maintain multiple sheets in a excel