Pop Up Screen with Selection Option using FM POPUP_WITH_TABLE_DISPLAY

Share on Facebook0Share on LinkedIn0Tweet about this on TwitterShare on Google+0
Please Share!!

This test program shows how to use pop up window to select a line and use it for further processing. There are several ways to meet this requirement and one of them is to use function module ‘POPUP_WITH_TABLE_DISPLAY’.

[adToAppearHere]

REPORT ztest_rs NO STANDARD PAGE HEADING
LINE-SIZE 400.

* Building type for the pop up window.
TYPES: BEGIN OF t_order,
vbeln TYPE vbeln_va, ” Sales Order
blank1(1),
matnr TYPE matnr, ” Material
blank2(1),
matkl TYPE matkl, ” Material Group
END OF t_order.

* Internal table and work area for pop up
DATA:
i_order TYPE STANDARD TABLE OF t_order INITIAL SIZE 0,
w_order TYPE t_order.

* Store the line number selected from the pop-up
DATA v_choice TYPE sy-tabix.

* Test select just to pick couple of lines
* You need to build i_order table as per your requirement. This will have pop up data
SELECT vbeln matnr matkl UP TO 10 ROWS FROM vbap INTO CORRESPONDING FIELDS OF TABLE i_order .

* Pop up to select from
CALL FUNCTION ‘POPUP_WITH_TABLE_DISPLAY’
EXPORTING
endpos_col = 75 ” Pop up window column end position
endpos_row = 10 ” Pop up window row end position
startpos_col = 40 ” Pop up window column start position
startpos_row = 3 ” Pop up window row start position
titletext = ‘Test popup for our friend Ani :-)’
IMPORTING
choise = v_choice
TABLES
valuetab = i_order
EXCEPTIONS
break_off = 1
OTHERS = 2.

IF sy-subrc = 0.

* Get the line selected/clicked
READ TABLE i_order INTO w_order INDEX v_choice.

* When one line is selected and the choose button is clicked
IF sy-subrc EQ 0.
* Do whatever you need to do with the selected line
ENDIF.

ENDIF.

* Expected result

 

If you want to get such practical issues and resolutions straight to your inbox, please SUBSCRIBE. We respect your privacy and take protecting it seriously.

If you liked this post, please hit the share button at the left side of your screen.

Thank you very much for your time!!
Image source : www.highsnobiety.com

Share on Facebook0Share on LinkedIn0Tweet about this on TwitterShare on Google+0
Please Share!!

1 Comment on "Pop Up Screen with Selection Option using FM POPUP_WITH_TABLE_DISPLAY"

  1. This post has a lot of importance to the people, I want to do SAP Online Training so please suggest me best training center in USA.

Comments are closed.