‎2009 Nov 20 3:37 AM
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
‎2009 Nov 20 3:49 AM
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
‎2009 Nov 20 5:46 AM
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.
‎2009 Nov 20 3:49 AM
Please make sure COL_POS in the field catalog filled properly.
a®
‎2009 Nov 20 4:31 AM
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
‎2009 Nov 20 6:44 AM
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