Posted: Thu Dec 20, 2007 4:02 pm Post subject: Детализация параметра на селекционном экране
Привет!
Пишу в программе
PARAMETERS: p_prnter TYPE tsp03d-padest . "короткое имя принтера.
По нажатию F4 показывается список доступных принтеров
в формате
Имя принтера, короткое имя, тип принтера.
После выбора параметр заполняется коротким именем.
Мне требуется, чтобы выводилось и короткое и за ним длинное имя.
Как это сделать?
July, спасибо огромное. Чуток подправил под наши особенности и все заработало как надо.
Code:
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text-001 FOR FIELD p_sname.
SELECTION-SCREEN POSITION 33.
PARAMETERS p_sname TYPE tsp03d-padest. "короткое имя
SELECTION-SCREEN POSITION 41.
PARAMETERS lname(30) LOWER CASE "длинное имя
MODIF ID nod.
SELECTION-SCREEN END OF LINE.
*----------------------------------------------------------------------
* AT SELECTION-SCREEN OUTPUT *
*----------------------------------------------------------------------
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CHECK screen-group1 = 'NOD'.
screen-input = 0.
MODIFY SCREEN.
ENDLOOP.
*----------------------------------------------------------------------
* AT SELECTION-SCREEN *
*----------------------------------------------------------------------
AT SELECTION-SCREEN ON p_sname.
SELECT SINGLE name INTO lname "выбираем длинное имя
FROM tsp03d WHERE padest EQ p_sname.
*----------------------------------------------------------------------
* AT SELECTION-SCREEN ON VALUE-REQUEST *
*----------------------------------------------------------------------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_sname.
DATA: lt_return_tab TYPE TABLE OF ddshretval WITH HEADER LINE.
DATA: g_prog TYPE sy-cprog.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'TSP03d'
fieldname = 'PADEST'
SEARCHHELP = 'PRINA'
dynpprog = sy-cprog
dynpnr = '1000'
dynprofield = 'P_SNAME'
* stepl =
* multiple_choice = 'X'
* display = l_display
TABLES
return_tab = lt_return_tab
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
CHECK sy-subrc EQ 0.
READ TABLE lt_return_tab INDEX 1.
CHECK sy-subrc EQ 0.
SELECT SINGLE name padest INTO (lname, p_sname)
FROM tsp03d WHERE name EQ lt_return_tab-fieldval.
"Динамическое заполнение поля
DATA: dynpread LIKE TABLE OF dynpread WITH HEADER LINE.
CLEAR dynpread. REFRESH dynpread.
dynpread-fieldname = 'P_SNAME'.
dynpread-fieldvalue = p_sname.
APPEND dynpread.
dynpread-fieldname = 'LNAME'.
dynpread-fieldvalue = lname.
APPEND dynpread.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dynpread
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.