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

SIMPLE VALIDATION PROBLEM--URGENT

Former Member
0 Likes
612

i have to validate field vgabe for ekbe

1. it shoul accept only two inputs that is '1' and '2' then

2. normal validation for data in table.

plz write code for full points urgently

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
591

AT SELECTION-SCREEN ON S_VGABE.

IF S__VGABE LT 1 OR S_VGABE GT 2.

MESSAGE E999 WITH 'error message'.

ENDIF.

REWARD IF HELPFUL PLZ

5 REPLIES 5
Read only

Former Member
0 Likes
591

Hello,

Check this sample.


PARAMETERS: P_VGABE  LIKE EKBE-VGABE OBLIGATORY.

AT SELECTION-SCREEN ON P_VGABE.
  IF P_VGABE LT 1 OR P_VGABE GT 2.
    MESSAGE E999(Z48MM) WITH 'error message'.
  ENDIF. 

Cheers,

Vasanth

Read only

former_member156446
Active Contributor
0 Likes
591

Hi Vinay


parameters: pa_vgabe type tab-vgabe,
                  pa_ekbe type tab-ekbe.

at selection-screen on pa_vgabe.
if pa_vgabe NE ('01' ,'02').
message.......
endif.

same for other parameter also..

at selection-screen on date
select single date from validation table of date
into lv_date where date = pa_date "<<<<<<<parameter of date
if sy-subrc NE 0.
message....
endif.

Read only

Former Member
0 Likes
591

Hi Vinay,

You can create data element (say ZTEST) and domain (using se11). In domain specify value range as 1 and 2. Activate data element and attached domain.

In program,

parameter : test type ZTEST as listbox visible length 5.

Perform validation as specified by other Experts.

Regards,

Mohaiyuddin

Read only

Former Member
0 Likes
591

Apart from above solutions you can try with listbox box as well...


TYPE-POOLS : vrm.
TABLES : ekbe .
DATA : vgabe TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.

PARAMETERS: po_type TYPE ekbe-vgabe AS LISTBOX VISIBLE LENGTH 6.

AT SELECTION-SCREEN OUTPUT.

  vgabe = 'PO_TYPE'.

  value-key = '1'.
  value-text = 'Type 1'. "<< you can assign meaning ful text here
  APPEND value TO list.
  value-key = '2'.
  value-text = 'Type 2'.
  APPEND value TO list.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = vgabe
      values          = list
    EXCEPTIONS
      id_illegal_name = 1
      OTHERS          = 2.

Read only

Former Member
0 Likes
592

AT SELECTION-SCREEN ON S_VGABE.

IF S__VGABE LT 1 OR S_VGABE GT 2.

MESSAGE E999 WITH 'error message'.

ENDIF.

REWARD IF HELPFUL PLZ