cancel
Showing results for 
Search instead for 
Did you mean: 

Call Transformation to download Excel with layout variant option

Suryaji26
Participant
0 Kudos

Hi Gurus,

i was using call transformation for XML attachment, with the same call transformation i have a need to add layout variant in selection screen and same to be applied one mail attachment excel as well.

code is like-

CALL TRANSFORMATION ZEDI_FORMAT_XLS_NEW

SOURCE TABLE = GT_OUTTAB[]

RESULT XML XMLSTR.

here i need to layout apply variant as well.

Please suggest

thanks

Surya

Sandra_Rossi
Active Contributor

Sorry, impossible to help you: the whole logic is in the custom transformation ZEDI_FORMAT_XLS_NEW, and nobody here can look at your system!

I think I understand your question, but it misses so many information that maybe the best thing is to ask directly a developer at your company.

Sandra_Rossi
Active Contributor
0 Kudos

To answer your latest comment, yes, you "can use layout variant in Call transformation", but it's a custom transformation so you need to code it from scratch, but I cannot say more, without any additional information.

Suryaji26
Participant
0 Kudos

Hi can we use layout variant data of FM reuse_alv_list_display to send attachment in Excel.

Sandra_Rossi
Active Contributor
0 Kudos

That's called a "status quo": we cannot answer because we don't understand your question enough and you think your question is enough detailed to be understandable by anybody.

Accepted Solutions (0)

Answers (1)

Answers (1)

Suryaji26
Participant
0 Kudos

Thanks Sandra for your quick help here.

Yes, but my aim here was to understand if we can use layout variant in Call transformation as i never come to such scenario.

many time i am putting that variant in FM

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; } .L0S32 { color: #3399FF; } .L0S33 { color: #4DA619; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; } .L0S70 { color: #808080; }


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = P_REPID
I_BACKGROUND_ID = P_ID
IS_LAYOUT = P_LAYOUT
IT_FIELDCAT = P_FCAT
IT_SORT = P_SORTCAT
I_DEFAULT = P_DEFAULT
I_SAVE = 'A'
IS_VARIANT = G_VARIANT
TABLES
T_OUTTAB = PT_DISPLAY
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " ALV_GRID_DISPLAY

like above.

thanks,

Sandra_Rossi
Active Contributor
0 Kudos

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area:

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem

Suryaji26
Participant
0 Kudos

Hi team,

I am still wondering .

thanks

Sandra_Rossi
Active Contributor
0 Kudos

Is there a reason why you want to use a transformation? Why not using the default ALV Excel export which takes into account most of layout options?

DoanManhQuynh
Active Contributor

I think you trying to download data to excel without display it in ALV but excel layout need to corresponding to ALV variant used. Within transformation you cant do it, there is no connection between ALV variant and your own transformation, you have to code template for each variant inside the transformation first then call it. Another way to achieve it is use ALV methods which I think you could find a lot of examples over internet.