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

Select-options input validation

Former Member
0 Likes
785

hi all,

I have problem with in my input validation... In the following code if i use multiple table names Its not reading the first table...Pls find the error in my code..

Ex: if i give mara,mard and ekko as tables in the multiple selections, output list it is not displaying the MARA table.

SELECT-OPTIONS : s_tname FOR dd02t-tabname no intervals.

AT SELECTION-SCREEN.

LOOP AT S_TNAME.

SELECT SINGLE * FROM dd02t INTO dd02t

WHERE TABNAME = s_tname-LOW

and DDLANGUAGE = sy-langu.

IF SY-SUBRC <> 0.

MESSAGE 'ERROR TABLE NAME' TYPE 'E'.

ENDIF.

ENDLOOP.

its very urgent....

Will give points for best answer.

Thanks,

KSR

5 REPLIES 5
Read only

Former Member
0 Likes
586

hi

Try giving Low and High values in selct stmnt.

Read only

0 Likes
586

Hi R K,

Thanks for da reply.

I wanna display only lower field in my select-options.

and when i select multiple tables its not reading the first table which i gave.

Pls help me if u can. Its urgent.

Thanks

KSR

Read only

Former Member
0 Likes
586

Hi,

In your validation you are using 'select single *' . So system obviously checks for the single record. Instead of using single, Use select * from XXXX where tabname in s_tname.

Regards,

Read only

Laxmana_Appana_
Active Contributor
0 Likes
586

Hi Srikant,

I am not clear on your doubt.check below code , if you want to do input validation

for multiple entries in the select option

Code :

Data : i_dd02t like dd02t occurs 0 with header line.

SELECT-OPTIONS : s_tname FOR dd02t-tabname no intervals.

AT SELECTION-SCREEN.

LOOP AT S_TNAME.
     SELECT * FROM dd02t INTO TABLE i_dd02t
            WHERE TABNAME = s_tname-LOW
              and DDLANGUAGE = sy-langu.
             IF SY-SUBRC <> 0.
               MESSAGE E000(ZZ) with 'Table Does not    
                   exist' , s_tname-low
             ENDIF.
ENDLOOP.

Regards

L Appana

Read only

Former Member
0 Likes
586

Hi srikanth,

try this code.

REPORT ZTESTF6 .

tables : dd02t,vbak.

SELECT-OPTIONS : s_tname FOR dd02t-tabname no intervals.

SELECT-OPTIONS : s_kan1 FOR vbak-vbeln.

AT SELECTION-SCREEN ON end of s_tname.

loop at s_tname.

SELECT SINGLE * FROM dd02t INTO dd02t

WHERE TABNAME = s_tname-LOW

and DDLANGUAGE = sy-langu.

IF SY-SUBRC <> 0.

MESSAGE 'ERROR TABLE NAME' TYPE 'E'.

ENDIF.

endloop.