2014 Oct 29 12:34 PM
Hi everybody,
I have a requirement from the client that i need to display values in a ALV pop-up, i was able to do that,
but the requirement is that he want to toggle between the pop and the screen....as i could observe that after the data is displayed in popup
we have to close the pop and go the original screen and to see the pop the button for displaying the popup has to be pressed.
please suggest some solution to this problem.
Thanks
Bhargava
Hi everybody,
I have a requirement from the client that i need to display values in a ALV pop-up, i was able to do that,
but the requirement is that he want to toggle between the pop and the screen....as i could observe that after the data is displayed in popup
we have to close the pop and go the original screen and to see the pop the button for displaying the popup has to be pressed.
please suggest some solution to this problem.
Thanks
Bhargava
2014 Oct 29 12:47 PM
Hi,
You can try to keep ALV on screen , instead of using Pop up.
Thanks.
2014 Oct 29 1:49 PM
Try to do that:
DATA:
obj_popup_alv TYPE REF TO cl_salv_table ,
obj_functions TYPE REF TO cl_salv_functions_list.
IF obj_popup_alv IS NOT INITIAL.
obj_popup_alv->refresh( ).
FREE obj_popup_alv.
ENDIF.
IF obj_functions IS NOT INITIAL.
FREE obj_functions.
ENDIF.
cl_salv_table=>factory( IMPORTING r_salv_table = obj_popup_alv
CHANGING t_table = your_table ).
obj_functions = obj_popup_alv->get_functions( ).
obj_popup_alv->set_screen_popup(
start_column = 40
end_column = 120
start_line = 6
end_line = 15 ).
obj_popup_alv->display( ).
2014 Oct 29 2:14 PM
Hi,
you could use this code:
CALL SCREEN <number_alv_screen> STARTING AT 5 5 ENDING AT 20 20
for
STARTING AT
ENDING AT
choose the size that you like.
let me know,
AI
2014 Oct 30 5:39 AM
Hi @Ranju M, @Thiago Alves, @Alessandro Ieva ,
I have tried all the methods that you guys have suggested... but i could not solve my problem...i was able to successfully create the alv in different screen or in pop....but the problem is when the alv comes in pop up or screen i need to close the pop to go to the calling screen....but my requirement is should not close the pop up...ie i need to minimize the popup or some other way i need to back and fro to the pop and the screen...like we do ALT+TAB in windows.
Thanks
Bhargava
2014 Oct 30 5:50 AM
Hi,
You can split your screen in two subscrren areas , and in one subscrren you can show your data and other screen will display ALV.
Thanks.
2014 Oct 30 6:18 AM
Hi,
It may help you..
CALL FUNCTION 'TH_CREATE_FOREIGN_MODE'
EXPORTING
client = sy-mandt
user = sy-uname
TCODE = 'ME43' "This will open in a new session
* RETURN_ERROR = 1
* CREATE_EXCLUSIVE = 0
* EXCEPTIONS
* USER_NOT_FOUND = 1
* CANT_CREATE_MODE = 2
* NO_AUTHORITY = 3
* OTHERS = 4
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
or
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
FUNCTIONCODE = '/OME23N'
* EXCEPTIONS
* FUNCTION_NOT_SUPPORTED = 1
* OTHERS = 2.
Regards
SP
2014 Oct 30 9:37 AM
HI,
I have a solution for you :
Step 1:
not create your second screen in same program but create the second screen in a function.
when you click a buttom (if is a buttom o other) for to call screen, insert this code:
CALL FUNCTION 'YOUR_FUNCTION_NAME' STARTING NEW TASK 'NEW'
problem resolved
let me know,
AI
2014 Oct 30 10:51 AM
can you please give some psudo code
i am unable to get what you are trying to communicate
2014 Oct 30 11:25 AM
Hi,
so, you follow below code:
1 step --> create report with first screen:
ex:
REPORT zaie_prova.
CALL SCREEN 9000.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_9000 INPUT.
CASE sy-ucomm.
WHEN 'FCODE_BUTTOM'.
CALL FUNCTION 'ZTEST_AI2' STARTING NEW TASK 'NEW'.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
2 step --> create fm with second screen:
ex:
FUNCTION ZTEST_AI2.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"----------------------------------------------------------------------
call SCREEN 9001 STARTING AT 5 5 ENDING AT 20 20.
ENDFUNCTION.
you can call the fm where and when you want that the second screen is displayed.
let me know,
AI
2014 Oct 31 10:09 AM
I have tried the above code ....i could notice that the screen is appearing but i could not toggle between the two screens....when the screen comes up i need to close this new screen to go to the old screen.
2014 Oct 31 10:29 AM
2014 Oct 31 10:30 AM
Hi Bhargava,
In order to toggle between two screens you have to have two sessions.
Create a t-code for popup screen and call it using FM SAPGUI_SET_FUNCTIONCODE or TH_CREATE_FOREIGN_MODE.
So that you will be able to toggle between popup screen and normal screen.
Regards
SP
2014 Oct 31 12:02 PM
In a pop-up we pass the values from the calling screen.....but my doubt is how to pass the values to the function SAPGUI_SET_FUNCTIONCODE or TH_CREATE_FOREIGN_MODE
2014 Nov 04 11:10 AM
If you want to show the same data (ALV) in full screen mode and popup mode in two different sessions...
1.Create two tcode for your report.. say zt1 and zt2
2.In program
If sy-Tcode = 'ZT1'.
**call alv normally(may be using reuse_alv*** FM).
else.
**call a screen using 'starting at'(displays in popup window)
endif.
3.if sy-ucomm = 'POPUP'.
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
FUNCTIONCODE = '/OZT2'
* EXCEPTIONS
* FUNCTION_NOT_SUPPORTED = 1
* OTHERS = 2.
endif.
2014 Oct 30 11:59 AM
Hi,
Please refer the link below:
http://scn.sap.com/thread/1177441
This is an alternative approach to the pop-up requirement..
This might help you.
Regards,
Gayatri