Application Development and Automation 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: 
Read only

BDC!!

Former Member
0 Likes
860

HELLO

HOW DO U HANDLE LISTBOX IN RECORDING A TRANSACTION??

N HOW R THE VALUES PASSED INTO IT IN BDC??

THANKING U IN ANTICIPATION.

REGARDS,

SIRISHA MATTA.

7 REPLIES 7
Read only

Former Member
0 Likes
796

Hi Sirisha,

Nothing extra is needed for Listbox, it acts as I/O field only, for checkboxes and radiobutton we use 'X'.

Cheers....

Santosh.

Read only

Former Member
0 Likes
796

Hi Sirisha,

The Listbox will have a Field Name. So basically if you know the Field name then you can pass the 'List box value' in it while doing BDC.

If based on the List box value there are some Dynamic screen, then use a logic to to call the screens accordingly.

Hope this helps.

Manish

Read only

Former Member
0 Likes
796

CAN U EXPLAIN IT MORE CLEARLY TO ME PROBABLY WITH SOME CODE EXAMPLE??

Read only

Former Member
0 Likes
796

hey thanks

Read only

0 Likes
796

Hello,

Generally list box has only few fields of Input which is displayed in a list.So just fill the field with the INput when you pass data to the screen..For example Material type is "Beverages" in MM01 transaction then the BDC definition would be like

'X' 'SAPLMGMM' '060',

' ' 'RMMG1-MTART' 'Beverages'.

Rewards If Helpful

Vicky

Read only

Former Member
0 Likes
796

hey sirisha,

here I am posting some code for its not related to BDC but if u want u can check it for you reference

how to create it and code it u can use it as normal as u r doing with other fields but u have to code accordingly.

here is some explanation

Drop down list box can be created in a dialog screen(SE51) as well as selection screen.

The sap list box allows to select a value from the list but we cannot enter our own value in the list box .The value list that will be displayed consists of two

fields TEXT field of TYPE 80(C) and internal KEY field of TYPE 40(C).

In screen painter to create a input/output field into list box we use

'L" as a value for dropdown attribute for the i/o field.

In screen painter to determine the type of method that will be used to fill the value

list we use the attribute value list.

If it is blank the value list will be filled by the first column of the input help assigned to the screen field.This input help can be defined in the ABAP Dictionary, on screen using SELECT,VALUES screen statements or in event POV (PROCESS ON VALUE-REQUEST ) and the input help that will be passed to the field should consists of 2 columns ,the key column is filled automatically by the system.SAP recommends value list field should be blank.

or

The value can be 'A' meaning that the value list will be filled in the event PBO(PROCESS BEFORE OUTPUT) or before the screen is displayed.In this method we use function module VRM_SET_VALUES to fill the values and pass it to the i/o field.

If a function code is attached to the list box the selection of a value triggers a PAI

otherwise PAI will not trigger.

LIST BOX in SELECTION SCREEN

List Box is created in selection screen using PARAMETERS staement

with AS LISTBOX addition other attributes like VISIBLE LENGTH (width of listbox)

can be specified with the declaration.

PARAMETERS name(n) AS LISTBOX VISIBLE LENGTH n.

Here n is an integer and name is the name of parameter.

To populate the value list we use the FM VRM_SET_VALUES and the

selection screen event AT SELECTION-SCREEN OUTPUT is used to write the code to fill it.

VRM_SET_VALUES

The function module VRM_SET_VALUES is used to fill the value list associated with a List Box .This FM uses types which are declared in type group VRM. So

we should declare TYPE-POOLS VRM before using this FM.

Some important types declared in the VRM type group are

VRM_ID

It refers to the name of the input/output field associated with list box

VRM_VALUES

It refers to the internal table consisting of two fields TEXT(80C) and KEY(40)C

that will be used to create the list values.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = name of screen element ,it is of TYPE VRM_ID

VALUES = internal table containing values,of TYPE VRM_VALUES

LIST BOX with value list from input help

In this example the screen element attribute value list is set to blank as such the value list will be filled with the 1st column of the input help,We use PROCESS ON VALUE-REQUEST event to pass the value list to the listbox.In the MODULE call used to fill the value list we can use FM like F4IF_INT_TABLE_VALUE_REQUEST to create input help as explained in the input help.The value of first column will be shown in the field when selected.

PROCESS ON VALUE-REQUEST

FIELD list MODULE fill_list_100

FIELD list MODULE fill_list_100 INPUT

SELECT f1 f2 FROM table INTO int

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'input/output screen field'

value_org = 'S'

TABLES

value_tab = itab "it contains 2 fields that will be shown in the list box

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

...

ENDIF.

ENDMODULE.

VALUE LIST CREATED IN PBO

In this method we set the value list attribute to 'A'.The value list will be filled in the PBO by using FM VRM_SET_VALUES .

TYPE-POOLS : VRM

DATA : field_id TYPE VRM_ID ,

values TYPE VRM_VALUES,

value LIKE LINE OF values.

PROCESS BEFORE OUTPUT

MODULE list_fill_100

MODULE list_fill_100 OUTPUT

SELECT f1 f2 f3 FROM tab WHERE condition.

value-KEY = f1.

value-TEXT = f2

APPEND value TO VALUES

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'i/o screen field'

values = values.

ENDMODULE.

LIST BOX with Selection Screen

For this the FM VRM_SET_VALUES is used to fill the value table and is passed to the parameter created with TYPE LISTBOX in the selection screen event

AT SELECTION-SCREEN.

PROGRAM zlist

TYPE-POOLS : VRM.

DATA: param TYPE vrm_id,

values TYPE vrm_values,

value LIKE LINE OF values.

PARAMETERS: p_name(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

param = 'P_NAME'.

value-key = '1'.

value-text = 'JOHN'.

APPEND value TO values.

value-key = '2'.

value-text = 'PETER'.

APPEND value TO values.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING id = param

values = values.

Regards,

Naveen

Read only

Former Member
0 Likes
796

whenever you recording transaction, list box records as filedname = 'X' then

pas the values through flatfile.

Thanks,

Ravi