‎2007 Apr 14 9:40 AM
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
‎2007 Apr 14 10:00 AM
‎2007 Apr 14 10:02 AM
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
‎2007 Apr 14 10:06 AM
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,
‎2007 Apr 14 10:21 AM
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
‎2007 Apr 14 10:42 AM
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.