09-25-2008 7:37 PM
Hi,
I have 2 screens (1 and 2), in screen 1 i have 2 fields (Field1, field2) and below those 2 fields i wrote OOPS ALV with double click functionality,
After i enter the data in those 2 fields of the screen 1, when i double click on particular record of ALV then it will take to the screen 2, where i can enter the related data. When i was coming back to the screen 1, I could not see any data in those fields in screen 1.
In debugging i found that at the time of double clicking only i can see those fields with blank. But if i hit enter after i enter the data in those fields and double clicking on ALV then the data was storing in those variables.
Can any one suggest me how to load the data in to those variables at double click functionality is triggering for ALV. There is no relation between ALV and those fields.
09-25-2008 7:42 PM
I understood that its happening because PAI is not triggering while double clicking on ALV, is it the reason why those fields are not populating.
09-25-2008 7:56 PM
in the double click are you updating them..? and also are you populating any thing in PAI with some code, since you are telling PAI is not triggering, thats why i am asking.
09-25-2008 7:45 PM
Are u using
call method g_grid->refresh_table_display.
after coming back from screen 2?
a®
09-25-2008 7:49 PM
No, I am not using that. What is the relation between ALV & other fields. Those screen fields are independent fields. I understood that since PAI is not at all triggering when double clicking on ALV, those fields are not updating with the values.
09-25-2008 7:52 PM
As i understand from point 2 of your question, that second screen fields are not displaying in the grid? is it correct? then
Once in the second screen after accepting the values , you need to update the internal table to set_table_for_first_display and then call in the PBO of screen 1 call refresh_table_display
a®
09-25-2008 7:57 PM
I have those 2 fields on my first screen (Screen 0001) and i dont have any issues with screen 0002. I am trying to explain the issue once again.
2 fields on screen 0001, i am entering the data in those fields and double clicking on OOPS ALV. (those are fields are not at all related to ALV, those are independent screen fields, below those fields i have OOPS ALV). When i double click on particular record then it will call screen 0002 and entering data there and when i am coming back these fields are clearing off.
In debugging i found that even at the time of double clicking also i could not see values in those fields, because double click functionality of ALV is triggering from PBO itself. Please let me know if you need any further info.
09-25-2008 7:58 PM
Try mentioning I_APPL_EVENTS also while creating the GRID object.
create object grid
exporting i_parent = custom_container
I_APPL_EVENTS = 'X'.
09-25-2008 8:01 PM
check in your code once again, may be there is a chance that you might be clearing them. Did you mentioned/created the screen fields referring to global data.
09-25-2008 8:03 PM
those fields are not at all updating with the entered values, the moment i double click on alv, at that time itself no data found.
09-25-2008 8:05 PM
09-25-2008 8:09 PM
Those are global fields only, i have declared in TOP. Is it mandatory that we need to call double click method from PBO only? like
CREATE OBJECT v_event_handler.
SET HANDLER v_event_handler->handle_double_click FOR alv_grid1.
09-25-2008 8:10 PM
I think system not getting triggered the PBO of first screen after the ALV double click.
You need to set a dummy code in the PAI of screen 2 like this way
call method cl_gui_cfw=>set_new_ok_code
exporting
new_code = 'DUMY'.
.
so after this control come back to PBO of screen 1 and fields in screen 1 get refreshed
a®
09-25-2008 8:14 PM
My Doubt is - is there any chance of triggering PAI - when i double click on OOPS ALV. This problem looks like small but killing all of my time.
Take any small OOPS ALV functionality and have 2 fields on the same screen, just enter the data in those and just double click on alv. At that moment itself we should see data in those fields since we entered the data before we double click on ALV. But i could not see any data in those fields. The reason is Double click functionality is triggering from the PBO of the screen itself. But when i hit enter and double click ... i can see the data. Really surprising.
09-25-2008 8:19 PM
if you want to trigger PAI, then you can go for the module.
mention this in flow logic replace the screen field and module name appropriately. do it for other field also. you can also use chain and endchain on those two fields.
FIELD <SCREENFIELD> MODULE <MODULENAME>.
09-25-2008 8:23 PM
Sorry, i have tried your solution, it does not work. Because PAI at all not triggering when you click on double click.
09-25-2008 8:32 PM
From Double click from grid your PAI will not get triggered, that why i said after coming from second screen you need to create new DUMMY okcode so control will go PBO of the first screen, and field in the first screen will get refreshed with values entered in the second screen
or
otherwise instead of calling a second screen from ALV please use some popup get values function modules and get the values, may be that will solve your issue.
a®
09-25-2008 8:39 PM
You can create a Small popup screen with those two fields. Call this screen before you can the Second ALV.
Or
You can ask from users to enter those two fields on the Second ALV and on the Back from the Second ALV, trasnsfer data back to the fields of First ALV screen.
But I think Popup will be a good option.
Regards
Naimesh Patel
09-25-2008 8:39 PM
Hi,
Thanks for your responses. You mentioned as
' field in the first screen will get refreshed with values entered in the second screen'
i dont want to move values from screen 0002 to screen 0001. Just i need the field values what i entered before i go to screen 0002.
The flow is like this ...
PBO-0001 - (Initial Display)
When Double click on OOPS ALV then again triggering PBO-0001 -
then triggering PBO-0002 (initial display of screen 2)
then entering the data and saving...so PAI-0002. From there ... again it was triggering PBO-0001 - displaying ALV values... but the 2 fields which i entered is not displaying any values...
because in this scenario PAI of 0001 is not at all triggering.
09-25-2008 8:48 PM
Hi Naimesh Patel,
Is it a bug in SAP, if so i will tell to user to enter the data before he executes. Can you please confirm.
09-25-2008 8:59 PM
It is not the bug, but its kind of a loop-hole.
As we all know that SAP runs of the Event. Now, if the user puts some values in the fields on the Screen 1 and doesn't do any event which is for that Screen ... than Screen will not be able to retain that value. Because there wasn't any event.
On the other hand Double Click is a event but it is not for that Screen fields. So, when user does the double Click, event of the Screen (PAI) would not get triggered.
To avoid this, I would suggest to put your fields in the popup and call that popup when the user does the double click just before starting the screen 2 processing.
Regards,
Naimesh Patel
09-25-2008 9:00 PM
Yes its an issue.
Round way solution. is avoid double click then use select the line and choose button from application toolbar (PF status) that will take user to second screen.
so PAI get triggered.
a®
09-25-2008 9:08 PM
Hi Naimesh and ARS,
Thanks for your great support. It helped me a lot.
09-30-2008 3:31 AM
09-25-2008 7:53 PM
To avoid this problem, I would suggest, don't dispaly the ALV unless user enters the data in the field1 and field2 and press Enter (or some other button like - Show ALV). This way, your variables gets updated in the field1 and field2 and when you come back from screen2 you will see those values there.
Regards,
Naimesh Patel
09-25-2008 8:01 PM
Thanks for your response, i need to display ALV first based on those values only first 2 fields will be updated by user, so i dont have any choice. As you told, if i enter and double click then the data was storing in those fields because at that time PAI was triggering. I hope you understand my issue. I am coping my code here ...
*--------------------------PROCESS BEFORE OUTPUT-----------------------*
PROCESS BEFORE OUTPUT.
MODULE STATUS_0001.
MODULE PROCESS_CONTAINER_001.
*--------------------------PROCESS AFTER INPUT-------------------------*
PROCESS AFTER INPUT.
module EXIT at exit-command.
MODULE USER_COMMAND_0001.
In MODULE PROCESS_CONTAINER_001.- i have wrote code for ALV display and double click functionality also.
01-09-2013 9:20 AM
next code must be entered in methos " handle_double_click":
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'NEW_CODE' " Some Code you want
* IMPORTING
* RC =
and in PAI you can catch it:
CASE sy-ucomm.
WHEN 'NEW_CODE'.
<do something>
ENDCASE.
.
Regards Larissa,