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

Code logic validation on selection screen

Former Member
0 Likes
805

hii

My selection screen is as follow

p_bukrs

s_field2

when user put data in the selection screen i must do a check in the field select option.

i must check if the field S_FIELD2 is maintain for the p_bukrs in the database check table ITAB_CHECK

i have done in the start-of-selection

select data from ITAB_CHECK into INTERNAL_ITAB

LOOP at INTERNAL_ITAB

how do i do the check in the s_field2 with the field INTERNAL_ITAB-FIELD2

ENDLOOP

please helppppp

Edited by: Alvaro Tejada Galindo on Jan 29, 2008 10:43 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
765

TRY THIS

select data from itab into <workarea> where

field in s_field.

if sy-subrc <> 0.

message e001.

endif.

s_field is your select option

try doing this

<REMOVED BY MODERATOR>

thanx n keep rockin

vivek

Edited by: Alvaro Tejada Galindo on Jan 29, 2008 10:44 AM

6 REPLIES 6
Read only

Former Member
0 Likes
766

TRY THIS

select data from itab into <workarea> where

field in s_field.

if sy-subrc <> 0.

message e001.

endif.

s_field is your select option

try doing this

<REMOVED BY MODERATOR>

thanx n keep rockin

vivek

Edited by: Alvaro Tejada Galindo on Jan 29, 2008 10:44 AM

Read only

0 Likes
765

no i can't do select where in s_field2 since i need to retrive the data from by p_bukrs only for later minipulation

Read only

Former Member
0 Likes
765

Write like this ....

select data from ITAB_CHECK into INTERNAL_ITAB

LOOP at INTERNAL_ITAB

if INTERNAL_ITAB-FIELD2 in s_field2.

  • write logic ...

else.

*write logic

endif.

ENDLOOP

Read only

0 Likes
765

but i am selecting

SELECT * FROM ITAB

WHERE bukrs EQ p_bukrs

and if i do a loop on itab

and compare loop-field2 NE select options

then there may be field in the itab that isn't on the selection screen

and this would give unnecessary message error

Read only

Former Member
0 Likes
765

If you are only giving single values in select-optins(not range) try the following code.

Loop at s_field2 .

if s_field2-sign eq 'I'.

read table INTERNAL_ITAB into wa with key INTERNAL_ITAB-FIELD2 = s_field2-low.

if sy-subrc ne 0.

Error Message.

endif.

endif.

endloop.

Read only

Former Member
0 Likes
765

answered