SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Drop-down List Box in the Selection Screen



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Wed Sep 05, 2007 7:16 pm    Post subject: Drop-down List Box in the Selection Screen Reply with quote

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.

PERFORM ADD_VALUES_TO_KOART.
COMMENT = 'Account type'.



*&---------------------------------------------------------------------*
*& 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.

CLEAR I_TAB.
I_TAB-KOART = 'A'.
APPEND I_TAB.
CLEAR I_TAB.

I_TAB-KOART = 'D'.
APPEND I_TAB.
CLEAR I_TAB.

I_TAB-KOART = 'K'.
APPEND I_TAB.
CLEAR I_TAB.

I_TAB-KOART = 'M'.
APPEND I_TAB.
CLEAR I_TAB.

I_TAB-KOART = 'S'.
APPEND I_TAB.
CLEAR 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.


ENDFORM. " ADD_VALUES_TO_KOART
 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.