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

Urgent:Validation

Former Member
0 Likes
1,451

Hi am entering a range of vendor while checking, it must display the particular vendor alone is invalid not the whole set of vendors which is entered .How should i declare?

15 REPLIES 15
Read only

Former Member
0 Likes
1,425

show your codings....

Read only

0 Likes
1,425

This is my coding.

CLEAR lfb1-lifnr.

IF NOT s_lifnr[] IS INITIAL.

SELECT SINGLE lifnr INTO gw_lfb1 FROM lfb1 WHERE lifnr IN s_lifnr.

IF sy-subrc <> 0.

MESSAGE e000 WITH 'Invalid vendor'.

ENDIF.

ENDIF.

This is applicable when i enter only one vendor how if i enter a range of vendors

Read only

0 Likes
1,425

plz give ur complete codings... then only i can tell you which statement you need to change

Read only

0 Likes
1,425

Hi,

if you use select single, why don't you use parameters.

Another problem is, if you use lfb1 what abaut bukrs?

Regards, Dieter

Read only

0 Likes
1,425

I am a little confused. In your code, don't you want to check if sy-subrc is NOT zero, and issue an error? Maybe I just missed something. Please clarify.

CLEAR lfb1-lifnr.

IF NOT s_lifnr[] IS INITIAL.
  SELECT SINGLE lifnr INTO gw_lfb1 FROM lfb1 WHERE lifnr IN s_lifnr.
  IF sy-subrc NE 0.             " NE?
    MESSAGE e000 WITH 'Invalid vendor'.
  ENDIF.
ENDIF.

Read only

0 Likes
1,425

The above is the coding for validation part.Now my requirement has changed that i have to use range of entering the vendor so if i use the above syntax if i enter the range of values if one vendor is invalid it ll show everything as invalid.This is my problem .Can u get me?

Read only

0 Likes
1,425

No need of burks.Anything select-option or parameter is ok but i have used select-option

Read only

0 Likes
1,425

No i didnt check that codn.Do u have any idea?

Read only

0 Likes
1,425

i have got some questions

1) tell me on what basis you are considering avendor is valid or invalid

2) if you are going to give a range of vendors you should use select * and not select single.

3) if you are passing the selected records to a workarea it is ok if you select a single record, but for range of vendors make sure you passs it to an internal table

first clarify my above questions.

Read only

Former Member
0 Likes
1,425

SELECT single lifnr INTO wa_liifnr FROM LFA1

WHERE lifnr IN s_lifnr.

endselect.

IF SY-SUBRC <> 0.

MESSAGE TYPE 'I' WITH WA_LIFNR 'NOT FOUND.'

ENDIF.

plz reward if useful

vivek

Edited by: Vivek Gaur on Apr 4, 2008 12:11 PM

Read only

Former Member
0 Likes
1,425

Do u want this?

TABLES: lfa1.

SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr.

DATA: gt_lfa1 TYPE STANDARD TABLE OF lfa1 WITH HEADER LINE,

v_lifnr TYPE lifnr.

SELECT lifnr

FROM lfa1

INTO CORRESPONDING FIELDS OF TABLE gt_lfa1

WHERE lifnr IN s_lifnr.

v_lifnr = s_lifnr-low .

if s_lifnr-high is initial.

s_lifnr-high = s_lifnr-low.

endif.

DO.

IF v_lifnr <= s_lifnr-high.

READ TABLE gt_lfa1 WITH KEY lifnr = v_lifnr.

IF sy-subrc NE 0.

WRITE: / 'Vendor', v_lifnr, 'is invalid.'.

ENDIF.

v_lifnr = v_lifnr + 1.

UNPACK v_lifnr TO v_lifnr.

ELSE.

EXIT.

ENDIF.

ENDDO.

Read only

0 Likes
1,425

Instead of select-options i have to make use of ranges.How should i do it?

Read only

0 Likes
1,425

Your code is helpful but when i enter a range of vendors it is not correctly pointing out the invalid vendor.Its processing the other vendors and displaying it.In my case i also need the invalid vendor number.

Read only

0 Likes
1,425

Do you want all invalid vendors in a internal table ?

Read only

0 Likes
1,425

ya have to validate all the vendors but still i didnt enter in internal table.How should i do?