Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Down load to excel file with specifying standard length gap (VERY URGENT )

Hi All,

I had developed a program to download to Excel file, but the thing is it is displaying all the data in a clumzy manner.

I want to display the output as for examp:

MATNR having 18 characters length, my data for MATNR is 10 characters only i have to leave the remaining 8 characters as space and then next field can display at 19th characters on wards.

Here is my sort of code:

<b>

DATA: LV_TAB TYPE X VALUE 9.

DATA: lv_vkorg(4) type c,

lv_dwerk(4) type c,

LV_VTWEG(2) TYPE c,

LV_MATNR(18) TYPE c ,

LV_MAKTX(40) TYPE c ,

LV_DSNAM(18) TYPE c ,

LV_KONDM(2) TYPE c ,

LV_VTEXT1(20) TYPE c ,

LV_PRODH(18) TYPE c,

LV_VTEXT(40) TYPE c ,

LV_VERSG(1) TYPE c,

LV_BEZEI20(20) TYPE c ,

LV_MATKL(9) TYPE c,

LV_WGBEZ(20) TYPE c,

LV_PRCTR(10) TYPE c.

LOOP AT GT_ALV1_DATA.

CONCATENATE

GT_ALV1_DATA-VKORG

lv_vkorg

GT_ALV1_DATA-DWERK(4)

lv_dwerk

GT_ALV1_DATA-VTWEG(2)

lv_vtweg

GT_ALV1_DATA-MATNR(18)

lv_matnr

GT_ALV1_DATA-MAKTX(40)

lv_maktx

GT_ALV1_DATA-DSNAM(18)

lv_dsnam

GT_ALV1_DATA-KONDM(2)

lv_kondm

GT_ALV1_DATA-VTEXT1(20)

lv_vtext1

GT_ALV1_DATA-PRODH(18)

lv_prodh

GT_ALV1_DATA-VTEXT(40)

lv_vtext

GT_ALV1_DATA-VERSG(1)

lv_versg

GT_ALV1_DATA-BEZEI20(20)

lv_bezei20

GT_ALV1_DATA-MATKL(9)

lv_matkl

GT_ALV1_DATA-WGBEZ(20)

lv_wgbez

GT_ALV1_DATA-PRCTR(10)

lv_prctr

INTO GT_OUTTAB-LINE.

APPEND GT_OUTTAB.

ENDLOOP.</b>

Tags:
Not what you were looking for? View more on this topic or Ask a question