Welcome To My BLOG

This site is to give a brief idea for the abap learners who are looking for some real time programs .It consists of collection of programs from my side . I hope these programs are very much used for all of the learners. Please check the links for any information in ABAP.
Please vote for my Blog. And please input me on this mail addrssess.Email me

Share this link with your friends

http://www.rebtel.com/u/15163104576

For every friend who signs up using this link and makes a payment, we'll give you 8 €!


Wednesday, September 22, 2010

Drop-down List Box in the Selection Screen for Windows NT

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

No comments: