11-12-2011 7:20 AM
Hi
We are using ALV grid FM, when you click addon <List> button in ALV grid
it displays list as output. In list output, i have add <Export> button and defined gui status and displayed at application bar.
when i click that export button , i am not able to catch the function code SY-UCOMM value.when i add standard <Print> button in applciation bar, its working by debugging into standard screen.
Does event is required to catch that?
In the list
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
I_CALLBACK_PF_STATUS_SET = GUIST_LIST
I_CALLBACK_USER_COMMAND = UCOMM_LIST
I have codded as below too.
FORM UCOMM_LIST USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
slis_selfield.
WHEN SY-UCOMM.
i can get func code for ALV <list> button. Not the <Export> button function of output list.
...no value
ENDFORM.
11-12-2011 10:08 AM
Hi guys
Can somebody shed light on this.
Little tips will help to continue..
REgards
Chandra
11-12-2011 11:07 AM
Hi,
Use below code..
**************For user command define*************
data: g_form_user_command type slis_formname value 'USER_COMMAND_L'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
I_CALLBACK_PF_STATUS_SET = GUIST_LIST
I_CALLBACK_USER_COMMAND = g_form_user_command
******Declare form...endform for handle user command**********
form user_command_l using p_ucomm type sy-ucomm
p_selfield type slis_selfield.
case p_ucomm.
when <function code used for alv list button>. " CALL LIST
Write your code to display list
endcase.
endform.
BR
Vijay
11-12-2011 11:16 AM
Hello Vikram
thanks for your reply.
My problem is not in ALV list buttion, I have problem in Export button in Output screen.
When i click LIST button in ALV Grid, Output display screen opens, in that screen i have added the Export button.
I am not able to handle that button in that screen(not in Alv screen or Alv grid button).
Pls let me know if you need more input.
Regards
Chandra
11-12-2011 11:29 AM
Output display screen opens
How you are displaying second output screen i mean by using REUSE ALV** FM or somthing else.
Vijay
11-12-2011 11:58 AM
Hi Vikram
yes, From ALV grid, i am displaying second output screen.
pls see below source outcode. When i click button from ALV grid below i am able to get the function code inside below form.
But not able to get function code in Second output screen Button.
form user_command_l using p_ucomm type sy-ucomm
p_selfield type slis_selfield.
case p_ucomm.
when <function code used for alv list button>. " CALL LIST
->calling second output screen where i have export button.
How to handle here?
endcase.
endform.
How to handle that.
Regards
Chandra
Edited by: princeck on Nov 12, 2011 12:58 PM
11-12-2011 12:26 PM
Hi Chandra,
Pass the same variable against parameter I_CALLBACK_USER_COMMAND in both alv's FM,s so in both cases same form USER_COMMAND_L will be called.
As i mentioned below.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
I_CALLBACK_PF_STATUS_SET = GUIST_LIST
I_CALLBACK_USER_COMMAND = g_form_user_command <--Pass this variable in second REUSE_ALV** FM also
Vijay
11-13-2011 1:22 PM
Hello Vikram
Thanks for your reply.
Hope you did not got my question. Let me explain it more detail.
Actually i am using only one FM 'REUSE_ALV_GRID_DISPLAY' to display EKPO items in Screen A.
When i Click custom button(LIST) from ALV grid from Screen A, item details are output as List in new Screen B(Here No ALV grid is used).
In Screen B i have added onecustom button(Export) in application bar(Using GUISTATUS)to download the item in excel.
Here is the problem. From Screen B, when i click Export button, nothing is happened(even not able to debug(/h) to find out where it goes). why?
In same gui status i have added Print button also, but it works fine in Screen B. Its debugging to standard Program.
Anything missing in GUI Status to define in Export button or Any events has to be handled properly?
Is it related to ALV grid FM parameter problems? like adding Event etc?
Pls shed some light on this.
Regards
Chandra
Edited by: princeck on Nov 13, 2011 2:23 PM
Edited by: princeck on Nov 13, 2011 2:24 PM
11-13-2011 1:42 PM
Hi Chandra,
Then how you are displaying your second output screen.
BR,
Vijay
11-13-2011 1:51 PM
Hi Vikram
Second screen is just list screen(standard one).
Used Write statement to display few items in list. thats it.
In that screen i have added custom button(export) using Gui status. when i click that button in /h debug mode atleast it should show some program but nothing happends. just stays in same screen itself.
Can you imagine my problem. pls let me know where u could not understand. i can explain more.
To display a secondary list when you click on one of the row items in an alv grid. The secondary list should also be an alv. ?
regards
Edited by: princeck on Nov 13, 2011 3:02 PM
11-13-2011 2:06 PM
Hi Chandra,
No Dear, Then how you are thinking to capture that sy-ucomm (you explicitly added that tab "EXPORT".
Because you are just displaying second report by writes statments.
Do one thing display second report by using FM reuse_alv* the take the reference of code mentioned in above comments.
Try this hope this will solve your problem.
Thanks,
Vijay
11-13-2011 2:14 PM
Hi Vikram
Thanks for immediately reply.
Sorry i could not understand below explanation. can you explain little bit?
>>No Dear, Then how you are thinking to capture that sy-ucomm (you explicitly added that tab "EXPORT".
Appreciate your response.
Regards
Chandra
11-13-2011 2:24 PM
In second output screen you created one "EXPORT" button using GUI-STATUS. You assigned some function code to that button "EXPORT".
But you displaying second output screen by using writes statement so there is no code to capture sy-ucomm for your button custom "EXPORT".
11-13-2011 2:42 PM
Hi Vijay
Thanks for you rreply.
So you mean , i can only capture the function code if the second screen is using only ALV ?
If i am able to add custom button EXPORT in Second screen using GUI status, then why it does not allow me to capture sy-ucomm ?
I dont understand this point?
Sorry if you can clear above explanation would be great help. could not understand in which case SY-UCOMM is allowed to capture and not.
Thanks for follow up, i will reward points to you. Would be great if reply me for above.too
Regards
Edited by: princeck on Nov 13, 2011 3:42 PM
Edited by: princeck on Nov 13, 2011 4:10 PM
11-13-2011 6:11 PM
Hi Chandra,
I got the solution of your problem.
Actually second output you are displaying through classical way like using write statements.
So after displaying your report through write statement declare event AT USER-COMMAND.
Take the reference below.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN .
ENDCASE.
Second solution:
I think you added "EXPORT" button on second output screen to download secondary report to your PC.
FOr this in your secondary report APPLICATION TOOLBAR add standard function code "%PC" to download report to PC and activate. This will create a button at secondary screen output screen which allow you to download report.
BR,
Vijay
11-14-2011 4:36 AM
Hello Vikram
Thanks for your reply.
Regarding solution 1.
we use CALL FUNCTION 'GET_PRINT_PARAMETERS' to send spool and print classic list.
NEW-PAGE PRINT ON PARAMETERS L_PARAMETERS NO DIALOG NEW-SECTION.
we used AT USER-COMMAND in many places after ending the Write statement.
but still it does not work.
Below is the code structre.
FM REUSE....DISPLAY
FORM CONTROL_UCOMM_LIST USING WA_UCOMM LIKE SY-UCOMM
CASE SY-UCOMM.
WHEN 'LIST'
PERFORM SPOOLlist 'Here call function GET_PRINT_PARAMTERS is used to sendspool and display classic list.
PERFORM LAYOUT_JL. displays output in list.
ENDFORM.
Above code is flow, where to write AT USER-COMMAND ,CASE sy-ucomm.?
we cannot use AT statement inside FORM..ENDFORM.
Regarding solution 2.
%PC solution does not work out for us. because its standard.
we want to create csv file as per our format. so we need addon button.
11-14-2011 4:24 PM
Hi Chandra,
FORM CONTROL_UCOMM_LIST USING WA_UCOMM LIKE SY-UCOMM
CASE SY-UCOMM.
WHEN 'LIST'
PERFORM LAYOUT_JL. displays output in list.
ENDFORM.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'EXPORT'
PERFORM SPOOLLIST.
FORM SPOOLLIST.
.................
................
ENDFORM.
Use above structure of code.
And remove rest of the AT USER-COMMAND statements from your code as you mentioned you declared AT USER-COMMANT statements so many place in your code.
Thanks,
Vijay
02-27-2012 12:38 PM