2007 Apr 18 10:41 AM
hi,
i have created two selection screen using at selection screen out put how to validate this selection screen. use at selection screen menas it can't go anathor selection screen
hi,
i have created two selection screen using at selection screen out put how to validate this selection screen. use at selection screen menas it can't go anathor selection screen
2007 Apr 18 10:44 AM
Hi,
see the selection screen and the fields validation..
************************************************************************
Select-Options
************************************************************************
selection-screen: begin of block b with frame.
selection-screen : begin of block b1 with frame title text-001.
select-options:s_bukrs for t001-bukrs no intervals no-extension
obligatory,
s_vkorg for tvko-vkorg no intervals no-extension,
s_vtweg for tvtw-vtweg no intervals no-extension,
s_spart for tspa-spart no intervals no-extension,
s_werks for t001w-werks no intervals no-extension,
s_kunag for kna1-kunnr,
s_vbeln for vbuk-vbeln,
s_fkart for tvfk-fkart,
s_fkdat for vbrk-fkdat obligatory.
selection-screen end of block b.
*******At Selection Screen********************************************
at selection-screen.
At Selection Screen on Value Request
at selection-screen on value-request for p_file.
perform f4_help.
Checking for the input values of selection screen.
perform screen_check.
&----
*& Form screen_check
&----
Ckecking for Selection Screen fields Validation
----
form screen_check.
Validation of Sales Organization
clear tvko.
if not s_vkorg-low is initial.
select vkorg from tvko up to 1 rows
into tvko-vkorg
where vkorg in s_vkorg.
endselect.
if sy-subrc ne 0.
message e009. " Invalid Sales Organization
endif.
endif.
Validation of Distribution Channel
clear tvtw.
if not s_vtweg-low is initial.
select vtweg from tvtw up to 1 rows
into tvtw-vtweg
where vtweg in s_vtweg.
endselect.
if sy-subrc ne 0.
message e010. " Invalid Distribution Channel
endif.
endif.
Validation of Division
clear tspa.
if not s_spart-low is initial.
select spart from tspa up to 1 rows
into tspa-spart
where spart in s_spart.
endselect.
if sy-subrc ne 0.
message e011. " Invalid Division
endif.
endif.
Validation for company code
clear t001.
if not s_bukrs-low is initial.
select single bukrs from t001
into t001-bukrs
where bukrs in s_bukrs.
if sy-subrc <> 0.
message e007. " Enter valid Company Code
endif.
endif.
Validation of billing Document Type
clear tvfk.
if not s_fkart is initial.
select fkart from tvfk up to 1 rows
into tvfk-fkart
where fkart in s_fkart.
endselect.
if sy-subrc ne 0.
message e012. " Invalid Billing Document Type
endif.
endif.
Validation of Billing Document Number
clear vbuk.
if not s_vbeln is initial.
select vbeln from vbuk up to 1 rows
into vbuk-vbeln
where vbeln in s_vbeln and
vbtyp = 'M'.
endselect.
if sy-subrc ne 0.
message e013. " Invalid Billing Doc Number
endif.
endif.
Validation of Customer
clear kna1.
if not s_kunag is initial.
select kunnr from kna1 up to 1 rows
into kna1-kunnr
where kunnr in s_kunag.
endselect.
if sy-subrc ne 0.
message e014. " Invalid Customer Number
endif.
endif.
Validation of Plant
clear t001w.
if not s_werks is initial.
select werks from t001w up to 1 rows
into t001w-werks
where werks in s_werks.
endselect.
if sy-subrc ne 0.
message e004. " Invalid Plant Number
endif.
endif.
Validation for File path to download
if p_dwnlod = 'X'.
if p_file is initial.
message e006. " Enter the Valid file path to Download
endif.
endif.
endform. "screen_check
reward if useful
regards,
ANJI
2007 Apr 18 10:56 AM
hi jaya,
try using the sample code below for validating ur selection screen.
<u><b>declaration</b></u>
data : it_sectgrp TYPE TABLE OF ty_sectgrp,
it_secgr TYPE TABLE OF dynpread,
it_sector TYPE TABLE OF ty_sector,
it_sector1 TYPE TABLE OF ty_sector,
wa_secgr TYPE dynpread,
wa_sectgrp TYPE ty_sectgrp,
<b>
----
Selection-screen : Parameters Begin with PR_
*----
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
PARAMETERS : pr_secg TYPE zz_sectgrpc OBLIGATORY ,
pr_sec TYPE zz_sectorc OBLIGATORY .
SELECTION-SCREEN END OF BLOCK b1 .
<u><b>----
INITIALIZATION
*----
INITIALIZATION.
REFRESH it_sectgrp.
SELECT sectgrp
FROM zpat003_sector
INTO TABLE it_sectgrp
WHERE sectgrp <> space.
**..... ONLY REQUIRED FIELDS ARE VALIDATED IN THE WHERE CONDITION
SORT it_sectgrp BY sectgrp.
DELETE ADJACENT DUPLICATES FROM it_sectgrp.
wa_secgr-fieldname = c_sectorgrp.
APPEND wa_secgr TO it_secgr.
<u><b>************************************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST
************************************************************************</b></u>
<b>AT SELECTION-SCREEN ON VALUE-REQUEST FOR pr_secg.</b>
gw_retfield = c_sectgrp.
gw_dynprofield = c_sectorgrp.
PERFORM f012_get_help_values
TABLES it_sectgrp
CHANGING gw_retfield gw_dynprofield.
<b>************************************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST
************************************************************************</b>
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pr_sec.
<u><b>VALIDATIONS</b></u>
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = it_secgr.
READ TABLE it_secgr INTO wa_secgr INDEX c_1.
REFRESH it_sector.
IF wa_secgr-fieldvalue IS NOT INITIAL.
SELECT sector
FROM zpat003_sector
INTO TABLE it_sector
WHERE sectgrp = wa_secgr-fieldvalue.
ELSE.
SELECT sector
FROM zpat003_sector
INTO TABLE it_sector
WHERE sectgrp <> space.
ENDIF.
<b>**..... ONLY REQUIRED FIELDS ARE VALIDATED IN THE WHERE CONDITION</b>
SORT it_sector BY sector.
DELETE ADJACENT DUPLICATES FROM it_sector.
gw_retfield = c_sector1.
gw_dynprofield = c_sector.
PERFORM f012_get_help_values
TABLES it_sector
CHANGING gw_retfield gw_dynprofield .
<u><b>************************************************************************
AT SELECTION-SCREEN.
************************************************************************</b></u>
<b>AT SELECTION-SCREEN.</b>
CLEAR wa_sectgrp.
READ TABLE it_sectgrp INTO wa_sectgrp
WITH KEY sectgrp = pr_secg .
IF wa_sectgrp IS INITIAL.
MESSAGE text-002 TYPE text-003 .
ENDIF.
REFRESH it_sector1.
SELECT sector
FROM zpat003_sector
INTO TABLE it_sector1
WHERE sectgrp = pr_secg AND
sector = pr_sec.
IF it_sector1[] IS INITIAL.
MESSAGE text-004 TYPE text-003.
ENDIF.<u></u>
hop this helps u
rewars points if useful
Ginni
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |