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

validating problem

former_member630092
Participant
0 Likes
823

I want to pick only one entry of lifnr.

I am validating like this

start-of-selection.

select lifnr from lfm1.

at selection-screen on so_lifnr .

select single lifnr from lfm1 into so_lifnr where lifnr = so_lifnr-low.

if sy-subrc ne 0.

message E000(ZV) with so_lifnr.

endif.

it is shwoing no records for lifnr. ( but recors is existing in table )

similarly i wnat to do for so_lifne-high.

Thanks

6 REPLIES 6
Read only

Former Member
0 Likes
785

Hi..

Use table LFA1 to validate the Vendor.. Not LFM1..

Regards

Ansari

Read only

0 Likes
785

i have to add field lfm1-ekorg. so m picking data first from lfm1 then corresponding records from bsik and then corresponding records from lfa1.

Read only

Former Member
0 Likes
785

Hi,

Try like this,



tables: LFM1.

at selection-screen on so_lifnr-low .
select single lifnr from lfm1 where lifnr = so_lifnr-low.       " Remove the into so_lifnr clause

if sy-subrc ne 0.
message E000(ZV) with so_lifnr.
endif.

at selection-screen on so_lifnr-high .
select single lifnr from lfm1 where lifnr = so_lifnr-high.

if sy-subrc ne 0.
message E000(ZV) with so_lifnr.
endif.

Regards,

Vikranth

Read only

Former Member
0 Likes
785

Hi,

Your INTO clause contains so_lifnr -> which is your select option.

Try to use some other structure with a different name in the INTO clause.



select single lifnr from lfm1 into wa_lifnr where lifnr = so_lifnr-low.

Read only

Former Member
0 Likes
785

i excuted like this it is working fine check this code

TABLES LFM1.

DATA : BEGIN OF ITAB OCCURS 0,

LIFNR LIKE LFM1-LIFNR,

END OF ITAB.

SELECT-OPTIONS SO_LIFNR FOR LFM1-LIFNR.

START-OF-SELECTION.

SELECT LIFNR FROM LFM1 into table itab.

AT SELECTION-SCREEN ON SO_LIFNR .

SELECT SINGLE LIFNR FROM LFM1 INTO SO_LIFNR WHERE LIFNR = SO_LIFNR-LOW.

IF SY-SUBRC NE 0.

MESSAGE E000(ZV) WITH SO_LIFNR.

ENDIF.

Read only

former_member630092
Participant
0 Likes
785

got the answered