Application Development 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: 

Popup Text

Former Member
0 Kudos

I got the below requirement, Can any one help me how to solve this by using FMs.

Retrieve internal comments text(order header Z027 text) and display first 3 lines in a column on the report. If more than 3 line of text. indicate this in anotjer column with hotspot to allow use to see pop-up of full text.

Thanks & regards

lucky

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use FM 'POPUP_WITH_TABLE_DISPLAY'

Pl. see this sample code:

REPORT ZEXAMPLE.

TABLES USR02.

DATA: BEGIN OF IUSR OCCURS 0,

BNAME LIKE USR02-BNAME,

TAB1(2),

TRDAT LIKE USR02-TRDAT,

TAB2(2),

END OF IUSR.

DATA: IUSRDAT LIKE IUSR OCCURS 20 WITH HEADER LINE.

DATA: V_USRLINES TYPE I,

V_BEGROW TYPE SY-CUROW VALUE 1,

V_ANS LIKE SY-TABIX.

PARAMETERS: V_LINES TYPE I DEFAULT 5.

IF V_LINES LE 0.

V_LINES = 5.

ENDIF.

SELECT * FROM USR02 UP TO V_LINES ROWS.

IUSRDAT-BNAME = USR02-BNAME.

IUSRDAT-TRDAT = USR02-TRDAT.

APPEND IUSRDAT.

ENDSELECT.

DESCRIBE TABLE IUSRDAT LINES V_USRLINES.

V_USRLINES = V_BEGROW + V_USRLINES.

CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'

EXPORTING

ENDPOS_COL = 30

ENDPOS_ROW = V_USRLINES

STARTPOS_COL = 2

STARTPOS_ROW = V_BEGROW

TITLETEXT = 'USER DISPLAY'

IMPORTING

CHOISE = V_ANS

TABLES

VALUETAB = IUSRDAT

EXCEPTIONS

BREAK_OFF = 1

OTHERS = 2.

IF SY-SUBRC EQ 0.

READ TABLE IUSRDAT INDEX V_ANS.

WRITE:/ IUSRDAT-BNAME, IUSRDAT-TRDAT.

ENDIF.

Regards,

Joy.

2 REPLIES 2

huseyindereli
Active Contributor
0 Kudos

Hi ,

Show limited characters in the column by wrapping the text. When user clicks the hotspot use the FM by filling the text into list_tab simply.

CALL FUNCTION 'LAW_SHOW_POPUP_WITH_TEXT'

EXPORTING

titelbar = 'Title'

line_size = 140

TABLES

list_tab = list_tab.

Former Member
0 Kudos

Use FM 'POPUP_WITH_TABLE_DISPLAY'

Pl. see this sample code:

REPORT ZEXAMPLE.

TABLES USR02.

DATA: BEGIN OF IUSR OCCURS 0,

BNAME LIKE USR02-BNAME,

TAB1(2),

TRDAT LIKE USR02-TRDAT,

TAB2(2),

END OF IUSR.

DATA: IUSRDAT LIKE IUSR OCCURS 20 WITH HEADER LINE.

DATA: V_USRLINES TYPE I,

V_BEGROW TYPE SY-CUROW VALUE 1,

V_ANS LIKE SY-TABIX.

PARAMETERS: V_LINES TYPE I DEFAULT 5.

IF V_LINES LE 0.

V_LINES = 5.

ENDIF.

SELECT * FROM USR02 UP TO V_LINES ROWS.

IUSRDAT-BNAME = USR02-BNAME.

IUSRDAT-TRDAT = USR02-TRDAT.

APPEND IUSRDAT.

ENDSELECT.

DESCRIBE TABLE IUSRDAT LINES V_USRLINES.

V_USRLINES = V_BEGROW + V_USRLINES.

CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'

EXPORTING

ENDPOS_COL = 30

ENDPOS_ROW = V_USRLINES

STARTPOS_COL = 2

STARTPOS_ROW = V_BEGROW

TITLETEXT = 'USER DISPLAY'

IMPORTING

CHOISE = V_ANS

TABLES

VALUETAB = IUSRDAT

EXCEPTIONS

BREAK_OFF = 1

OTHERS = 2.

IF SY-SUBRC EQ 0.

READ TABLE IUSRDAT INDEX V_ANS.

WRITE:/ IUSRDAT-BNAME, IUSRDAT-TRDAT.

ENDIF.

Regards,

Joy.