Skip to Content
0
Former Member
Dec 26, 2007 at 06:53 AM

Infoset query ('At Selection-Screen') - Urgent

56 Views

Hi All,

The below code for selection criteria 'At Selection-Screen' for an infoset-query works ok, but i find 2 problems, can someone help.

1. When user presses F4, i wanted the output to display

SG Singapore

IN India

But at the moment it just displays

SG

IN

2. If the user enters any other value apart from the above 2 i do not want the query to execute, instead show something like enter a valid value. But at the moment if i enter another country code manually just to test eg: US, the query runs with this selection which i do not want.

Hope my problem is clear, await inputs.

Code:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR VEN_CTY-LOW.

IT_LAND-VEN_CTY = 'SG'.

IT_LAND-LTEXT = 'Singapore'.

APPEND IT_LAND.

IT_LAND-VEN_CTY = 'IN'.

IT_LAND-LTEXT = 'India'.

APPEND IT_LAND.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'VEN_CTY'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_LAND

RETURN_TAB = IT_RETURN

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2.

IF SY-SUBRC = 0.

READ TABLE IT_LAND INDEX 1.

MOVE IT_RETURN-FIELDVAL TO VEN_CTY-LOW.

ENDIF.