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: 

Screen Painter - Make text appear from drop down

Former Member
0 Kudos

Hi,

I have a field on a screen which has a search help assigned. When the users select an entry I would like to populate a text field on the screen with the desc of the chosen entry.

Can this be done.

Thanks

Martin

5 REPLIES 5

Former Member
0 Kudos

Hi Martin,

This can be done. Create a field in the screen and mark it as 'output only', i.e, not an input field. Then pass the description value to that field in the module pool program.

Hope this helps.

Cheers,

Rajeev

0 Kudos

Hi,

To pass the description field I need to do it in the PBO. However when I choose the drop down option of the field, the PBO of the screen is not called again.

Thanks

Martin

0 Kudos

Martin,

You have to create a module under PAI for this. Inside the module you can use a select query and get the description for that particular code. Then you can pass the description text to the screen field(output only)

CHeers,

Rajeev

0 Kudos

The drop down does not call any of the events in the screen.

I presume I need to code my own drop down list and use the value-request event.

venkat_o
Active Contributor
0 Kudos

Hi Martin ,

This exactly fits ur requirement .

<b>1.</b> Here i am displaying F4 help using

'POPUP_WITH_TABLE_DISPLAY'

<b>2.</b> Then seelect record from display in the text field

using FM 'DYNP_VALUES_UPDATE'

Have a look at this sample program .

DATA : BEGIN OF POP_ERDAT OCCURS 1,

ERDAT LIKE YB001-ERDAT,

ERNAME LIKE YB001-ERNAME,

END OF POP_ERDAT.

DATA : BEGIN OF POP_ERDAT1 OCCURS 1,

TEXT(25) ,

END OF POP_ERDAT1.

DATA:L_CHOICE LIKE SY-TABIX.

DATA : IT_DYNP TYPE STANDARD TABLE OF DYNPREAD WITH HEADER LINE.

SELECT DISTINCT ERDAT ERNAME INTO TABLE POP_ERDAT

FROM YB001

WHERE ERDAT <= SY-DATUM.

IF SY-SUBRC EQ 0.

DELETE ADJACENT DUPLICATES FROM POP_ERDAT COMPARING ERDAT ERNAME.

SORT POP_ERDAT BY ERDAT ASCENDING.

LOOP AT POP_ERDAT.

CLEAR POP_ERDAT1.

WRITE POP_ERDAT-ERDAT DD/MM/YYYY TO POP_ERDAT1-TEXT.

CONCATENATE POP_ERDAT1-TEXT ' ' POP_ERDAT-ERNAME INTO POP_ERDAT1-TEXT SEPARATED BY SPACE .

APPEND POP_ERDAT1.

ENDLOOP.

ENDIF.

IF NOT POP_ERDAT[] IS INITIAL.

CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'

EXPORTING

ENDPOS_COL = 69

ENDPOS_ROW = 20

STARTPOS_COL = 45

STARTPOS_ROW = 10

TITLETEXT = 'Versions'

IMPORTING

CHOISE = L_CHOICE

TABLES

VALUETAB = POP_ERDAT1

EXCEPTIONS

BREAK_OFF = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

READ TABLE POP_ERDAT INDEX L_CHOICE.

IF SY-SUBRC = 0.

CLEAR : IT_DYNP,IT_DYNP[].

IT_DYNP-FIELDNAME = P_ERDAT.

WRITE POP_ERDAT-ERDAT DD/MM/YYYY TO IT_DYNP-FIELDVALUE.

APPEND IT_DYNP.

IT_DYNP-FIELDNAME = P_UNAME.

IT_DYNP-FIELDVALUE = POP_ERDAT-ERNAME.

APPEND IT_DYNP.

CLEAR IT_DYNP.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = '1000'

TABLES

DYNPFIELDS = IT_DYNP

EXCEPTIONS

INVALID_ABAPWORKAREA = 1

INVALID_DYNPROFIELD = 2

INVALID_DYNPRONAME = 3

INVALID_DYNPRONUMMER = 4

INVALID_REQUEST = 5

NO_FIELDDESCRIPTION = 6

UNDEFIND_ERROR = 7

OTHERS = 8.

ENDIF.

ENDIF.

ENDIF.

I think that this helps u .

<b>Thanks,

Venkat.O</b>