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

Export to local file problem

Former Member
0 Likes
1,389

Hi All,

I got this ALV program that displays like this.

DOETR # EQUNR DATE HOURS OPERATOR PROJ NAME AUFNR VORNR LSTAR

7654321 BH-24 11/18/2009 9.00 OPERATOR1 MDC-PM-ALI-TEST-TEST 4075821 0010 MDIDB

i need to export the displayed data on ALV to a local file . preferably excel or a text file.

i know that i can use ctrlshiff9 (Local File) in the menu list of ALV to export it to local file. or use the menu path list -> export to -> spreadsheet.

all is well when it gets exported to a text file or excel file aside from the HOURS field that is not transported for some reason.

the result when i export it to local file -> unconverted format -> enter file name to be "test.txt" is like this:

11/20/2009 Dynamic List Display 1

-


-


DOETR Number

EQUNR

Date

Hours

Operator

Project definition

Order

OpAc

ActTyp

-


7654321

BH-24

11/18/2009

HEINRICK PALAD

MDC-PM-ALI-TEST-TEST

4075821

0010

MDIDB

-


As you can see. the HOURS field with the value of 9.00 is not on the list.

HOURS field in ALV is refenced to char5.

here is the structure of my table.

begin of t_outtab.

equnr like ztab_equip-equnr,

utdte like ztab_equip-begda,

ismnw_2 type char5,

dfrdr type ltxa1,

pspel like ztab_equip-pspel,

aufnr like ztab_equip-aufnr,

vornr like ztab_equip-vornr,

lstar like ztab_equip-lstar,

end of t_outtab.

Any ideas on how to fix this.

Thank you!

-Joan

5 REPLIES 5
Read only

Former Member
0 Likes
1,031

Hi check,

this alv code.

ls_fieldcat-fieldname = 'SCRP'.

ls_fieldcat-seltext_l = text-016.

ls_fieldcat-outputlen = 30.

ls_fieldcat-col_pos = 2.

ls_fieldcat-key = c_x.

ls_fieldcat-no_zero = c_x.

APPEND ls_fieldcat TO fieldcatalog.

CLEAR ls_fieldcat.

pass field into field name, and no_Zero as 'X'.

Also structure when prepared using DDIC objects when referenced 'Type' over 'Like' are preferred.

Begin of ty_,

matnr type mara-matnr,

or

matnr type matnr,

instead of matnr like mata-matnr,

like can be used for declared data object in program.

Regards

Mohinder Singh Chauhan

Read only

0 Likes
1,031

Hi,

i checked my fieldcat and the col_pos are done correctly.

changed my structure to type not like.

put no_zero = 'X' in my fieldcat.

still the same result. the missing field is still not there.

Any more ideas.

Read only

former_member194669
Active Contributor
0 Likes
1,031

Please make sure COL_POS in the field catalog filled properly.

a®

Read only

sravya_ch
Participant
0 Likes
1,031

Hi

I think your doing it in the real time scenarios only right , So instead of using char directly u can have a UZEIT then you will get the data .

As well u r using sy-uzeit to get the current time . you did not mention that point .

Sravya

Read only

former_member632458
Participant
0 Likes
1,031

HI,

Use a standard reference type like in my report I have used, VGWRT field to display time. its dumping as it is. So try with the field type .

With Best Regards,

Rajesh S