2008 May 06 2:08 PM
Hello Gurus,
I have an ALV report .In that report i have a button called download.I change my ALV Layout and pressed download.
Let us say my alv has 10 fields.I have my own layout with 5 fields.when i got my alv display with the layout(5 fields) and pressed download i want to get only 5 fields 2 be downloaded rather than all fields.
How can i acheive this functionality?
Hello Gurus,
I have an ALV report .In that report i have a button called download.I change my ALV Layout and pressed download.
Let us say my alv has 10 fields.I have my own layout with 5 fields.when i got my alv display with the layout(5 fields) and pressed download i want to get only 5 fields 2 be downloaded rather than all fields.
How can i acheive this functionality?
2008 May 06 2:17 PM
Hi Madan,
Give same nternal table name for all the fields in u r ALV report.
Otherwise i can't take all the fields for concideration.
Move all the fields in to one internal table and give that table name in all places in field catlog and ALV FM.
reward if useful.
Regards,
Narasimha
2008 May 06 2:33 PM
hi,
use edit parameter in fieldcat, and BOX_FIELDNAME in layout so that when you display alv report you obtain some pushbuttons beside the records.
now write the code such that the fields you select in the alv report by clicking the pushbutton are stored in another internal table . Now pass this internal table to download function module.
reward if useful.
thanks and regards
2008 May 06 2:57 PM
you have to get current frontend field caltog using the method. and then create a dynamic table to achieve this.
method GET_FRONTEND_FIELDCATALOG
and then something like this:
LOOP AT G_T_FIELDCAT INTO G_R_FIELDCAT WHERE NO_OUT NE 'X'
AND TECH IS INITIAL
AND FIELDNAME NE 'ICON'.
MOVE-CORRESPONDING G_R_FIELDCAT TO IS_FIELDCAT.
IS_FIELDCAT-FIELDNAME = G_R_FIELDCAT-FIELDNAME.
IS_FIELDCAT-INTTYPE = G_R_FIELDCAT-INTTYPE.
IS_FIELDCAT-OUTPUTLEN = G_R_FIELDCAT-OUTPUTLEN.
IS_FIELDCAT-REF_FIELD = G_R_FIELDCAT-FIELDNAME.
IS_FIELDCAT-REF_TABLE = G_R_FIELDCAT-REF_TABNAME.
APPEND IS_FIELDCAT TO IT_FIELDCAT.
ENDLOOP.
DATA: WA_LISTE LIKE P_T_LISTE.
CLEAR:IT_OUTTAB.
REFRESH: IT_OUTTAB.
LOOP AT P_T_LISTE INTO WA_LISTE.
WA_OUTTAB-PSPID = WA_LISTE-PSPID .
WA_OUTTAB-POSID = WA_LISTE-POSID.
WA_OUTTAB-POST1 = WA_LISTE-POST1.
WA_OUTTAB-STTXT_INT = WA_LISTE-STTXT_INT.
WA_OUTTAB-STTXT_EXT = WA_LISTE-STTXT_EXT.
APPEND WA_OUTTAB TO IT_OUTTAB.
ENDLOOP.
**dynamic table creation for data
ASSIGN LT_DATA TO <FS_DATA>.
Create a new Table
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IT_FIELDCAT
IMPORTING
EP_TABLE = <FS_DATA>
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
OTHERS = 2.
IF SY-SUBRC = 0.
ASSIGN <FS_DATA>->* TO <FS_1>.
CREATE DATA NEW_LINE LIKE LINE OF <FS_1>.
A field-symbol to access that work area
ASSIGN NEW_LINE->* TO <FS_2>.
**MOVE DATA
LOOP AT IT_OUTTAB INTO WA_OUTTAB.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = WA_OUTTAB-PSPID
IMPORTING
OUTPUT = WA_OUTTAB-PSPID.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = WA_OUTTAB-POSID
IMPORTING
OUTPUT = WA_OUTTAB-POSID.
LOOP AT G_T_FIELDCAT INTO G_R_FIELDCAT
WHERE NO_OUT IS INITIAL
AND TECH IS INITIAL.
ASSIGN COMPONENT G_R_FIELDCAT-FIELDNAME OF STRUCTURE
WA_OUTTAB TO <FS_5>.
ASSIGN COMPONENT G_R_FIELDCAT-FIELDNAME OF STRUCTURE
<FS_2> TO <FS_3>.
<FS_3> = <FS_5>.
ENDLOOP.
INSERT <FS_2> INTO TABLE <FS_1>.
ENDLOOP.
ELSE.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
2008 May 08 7:35 AM
Thanks for ur reply.But i dont want 2 use ABAP Objects.Is there any other solution 2 do this without using Objects......
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |