Application Development 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: 

How to validate with LIFNR

Former Member
0 Kudos
781

Hi ABAPer's ,

I have a question that how to validate the screen input field using key LIFNR with the tables given:

EKKO,

EKPO,

EKET,

LFA1,

MAKT,

TOO1W.

in ALV Classical report?

If i give 1 to some char in select options i should not get the values, if i give the lifnr values i should get the values.

Plz help me out of this.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
248

hi raja,

You have to validate the field by its check table only, i.e in table KNA1 field land1 is validated by Table t005

so you have to validate lifnr by its check tabke LFA1.

here is the code, remember that select option create a internal table, in which user can enter the multiple selection, so here is the solution to handle single as well as multiple selection values,

select-options: s_lifnr for lfa1-lifnr.

LOOP AT S_LIFNR.

CHECK S_LIFNR-OPTION = 'EQ'.

SELECT SINGLE LIFNR FROM LFA1 INTO LFA1-LIFNR

WHERE LIFNR = S_LIFNR-LOW.

IF SY-SUBRC NE 0.

MESSAGE E001 WITH S_LIFNR-LOW.

. ENDIF.

ENDLOOP.

you can use the same code for S_LIFNR-HIGH also

Yogesh Nigam

Edited by: Yogesh N on Aug 11, 2008 10:51 AM

4 REPLIES 4

Former Member
0 Kudos
248

Hi,

Use your screen element type as Ekko-lifnr

Regards,

Nishant

Former Member
0 Kudos
249

hi raja,

You have to validate the field by its check table only, i.e in table KNA1 field land1 is validated by Table t005

so you have to validate lifnr by its check tabke LFA1.

here is the code, remember that select option create a internal table, in which user can enter the multiple selection, so here is the solution to handle single as well as multiple selection values,

select-options: s_lifnr for lfa1-lifnr.

LOOP AT S_LIFNR.

CHECK S_LIFNR-OPTION = 'EQ'.

SELECT SINGLE LIFNR FROM LFA1 INTO LFA1-LIFNR

WHERE LIFNR = S_LIFNR-LOW.

IF SY-SUBRC NE 0.

MESSAGE E001 WITH S_LIFNR-LOW.

. ENDIF.

ENDLOOP.

you can use the same code for S_LIFNR-HIGH also

Yogesh Nigam

Edited by: Yogesh N on Aug 11, 2008 10:51 AM

0 Kudos
248

Yogesh - how does that work with patterns or exclusions??

Rob

Former Member
0 Kudos
248

Hi ABAPer's,

I didn't get raletion between eket to make and too1w. How to make an interactive using for all entries.

Plz go thru it and reply me soon.