Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV pop up

bhargava_dns
Participant
0 Likes
5,493

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

15 REPLIES 15
Read only

Former Member
0 Likes
4,911

Hi,

You can try to keep ALV on screen , instead of using Pop up.

Thanks.

Read only

Former Member
0 Likes
4,911

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( ).

Read only

alessandroieva
Active Participant
0 Likes
4,911

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

Read only

bhargava_dns
Participant
0 Likes
4,911

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

Read only

0 Likes
4,911

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.

Read only

former_member202818
Active Contributor
0 Likes
4,911

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

Read only

alessandroieva
Active Participant
0 Likes
4,911

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

Read only

0 Likes
4,911

@Alessandro Ieva

can you please give some psudo code

i am unable to get what you are trying to communicate

Read only

0 Likes
4,911

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

Read only

0 Likes
4,911

@Alessandro Ieva

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.

Read only

0 Likes
4,911

Hi,

do you has used a button 'BACK' for closed a screen?

AI

Read only

0 Likes
4,911

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

Read only

0 Likes
4,911

@Sreekanth Pavoor


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

Read only

0 Likes
4,911

Hi bhargava dns,


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.

Read only

Former Member
0 Likes
4,911

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