‎2008 Apr 04 11:05 AM
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?
‎2008 Apr 04 11:10 AM
‎2008 Apr 04 11:23 AM
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
‎2008 Apr 04 11:26 AM
plz give ur complete codings... then only i can tell you which statement you need to change
‎2008 Apr 04 11:36 AM
Hi,
if you use select single, why don't you use parameters.
Another problem is, if you use lfb1 what abaut bukrs?
Regards, Dieter
‎2008 Apr 04 11:43 AM
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.
‎2008 Apr 04 11:46 AM
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?
‎2008 Apr 04 11:49 AM
No need of burks.Anything select-option or parameter is ok but i have used select-option
‎2008 Apr 04 11:51 AM
‎2008 Apr 04 11:55 AM
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.
‎2008 Apr 04 11:10 AM
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
‎2008 Apr 04 12:23 PM
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.
‎2008 Apr 04 12:27 PM
Instead of select-options i have to make use of ranges.How should i do it?
‎2008 Apr 04 3:23 PM
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.
‎2008 Apr 04 4:22 PM
‎2008 Apr 05 4:46 AM
ya have to validate all the vendors but still i didnt enter in internal table.How should i do?