Posted: Wed Sep 05, 2007 7:16 pm Post subject: Drop-down List Box in the Selection Screen
Author: Azaz Ali Shaik
This code sample gives the idea about providing drop down list box in the Selection Screen. The code has been tested under SAP R/3 Enterprise Release 4.70, mySAP Technology Components Release 6.20. It may also work under earlier versions with minor modifications
Code:
REPORT Z_DDLB.
DEFINE LB_MACRO_KOART.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(31) &3.
PARAMETERS: &1 AS LISTBOX VISIBLE LENGTH &2 OBLIGATORY.
SELECTION-SCREEN END OF LINE.
END-OF-DEFINITION.
************************************************************************
* SELECTION-SCREEN *
************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK S1 WITH FRAME TITLE TEXT-001.
LB_MACRO_KOART MYLIST(1) 5 COMMENT.
SELECTION-SCREEN END OF BLOCK S1.
************************************************************************
* AT SELECTION - SCREEN
************************************************************************
AT SELECTION-SCREEN OUTPUT.
*&---------------------------------------------------------------------*
*& Form ADD_VALUES_TO_KOART
*&---------------------------------------------------------------------*
* Fill the values in dropdownlistbox
*----------------------------------------------------------------------*
FORM ADD_VALUES_TO_KOART .
TYPE-POOLS: VRM.
DATA: MY_LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF MY_LIST.
DATA : BEGIN OF I_TAB OCCURS 0,
KOART TYPE C,
END OF I_TAB.
*&---------------------------------------------------------------------*
*& Filling the list structure with values from MARA table
*&---------------------------------------------------------------------*
LOOP AT I_TAB.
VALUE-KEY = SY-TABIX.
VALUE-TEXT = I_TAB-KOART.
APPEND VALUE TO MY_LIST.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Finally calling the function module to create the list box.
*&---------------------------------------------------------------------*
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'MYLIST'
VALUES = MY_LIST.
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.