Skip to Content
0
Former Member
Nov 18, 2005 at 01:52 AM

Please see the code n give ur comments !

33 Views

Hi,

I have selection screen with two list boxes.

I am populating the second based on the selection in the first one.

But, when I'm selecting a value from the second one, it is not reflected in the program, it means it value is blank.

Please go thro' the following code, n give ur suggestions.

IF list IS INITIAL.

  • Retrive Remarks from ZLOT007

SELECT remarks bukrs FROM zlot007 INTO TABLE it_ftp_tar.

name = 'FTP_TAR'.

count = 1.

  • Populating list box 1

LOOP AT it_ftp_tar.

value-text = it_ftp_tar-remarks.

value-key = count.

APPEND value TO list.

count = count + 1.

ENDLOOP.

  • Function to load data into list box

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

ENDIF.

  • If FTP setting field is not initial

IF ftp_tar IS NOT INITIAL AND list1 IS INITIAL.

READ TABLE it_ftp_tar INDEX ftp_tar.

CONDENSE it_ftp_tar-bukrs.

l_bukrs = it_ftp_tar-bukrs.

  • Fetching Plant belongs to the Company code

SELECT bukrs bwkey FROM t001k INTO TABLE it_werks

WHERE bukrs = l_bukrs.

name = 'P_WERKS'.

count = 1.

  • Populating list box 2 for Plant

LOOP AT it_werks.

value-text = it_werks-werks.

value-key = count.

APPEND value TO list1.

count = count + 1.

ENDLOOP.

  • function to load data into list box

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list1.

ENDIF.

  • CLEAR it_werks.

CONDENSE p_werks.

READ TABLE it_werks INDEX p_werks.

CONDENSE it_werks-werks.

l_werks = it_werks-werks.

Thanks,

Senthil