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

selection-screen validations

Former Member
0 Likes
641

Hi all,

At selection-screen level, i've to pass 2 parameters i.e. bukrs and payroll area of both having single value (No range required)

And I've a ztable of containing values of these company code and payroll area fields (key field as payroll area)

Validations given at selection-screen level is such that bukrs is to be selected (obligatory) from the given ztable and then for parameter p_payroll, it should be greyed out and defaulted to value 'xx' based on company code selection.

For the first selection field, p_bukrs, i done with that i.e. fetching data from ztable using f4 option...(in f4 it should display only list of ccodes)

I tried this way, here i found that, at selection-screen level, after pressing f4 at p_bukrs and choosing the ccode, when i press 'enter' the related p_payroll is displaying but in editable mode (required in greyed out)

In the given logic, for the field p_abkrs(payroll) to be greyed out, at selection-screen output block i coded according to...but hasn't works out....

pls provide any possible inputs, that would be a great help.......

Types Begin gty_code,

Bukrs type bukrs,

End of gty_code.

Data gt_code TYPE TABLE OF gty_code,

gs_code TYPE gty_code.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.

SELECT bukrs FROM ztab1

INTO CORRESPONDING FIELDS OF TABLE gt_code.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BUKRS'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'P_BUKRS'

value_org = 'S'

TABLES

value_tab = gt_code

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

AT SELECTION-SCREEN ON P_BUKRS.

DATA l_abkrs LIKE dynpread-fieldvalue.

IF p_bukrs IS NOT INITIAL.

SELECT SINGLE abkrs

INTO l_abkrs

FROM ztt_hmrc_vendor

WHERE bukrs = p_bukrs.

CHECK sy-subrc = 0.

p_abkrs = l_abkrs.

ENDIF.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'p_abkrs'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards

Suren

Edited by: surendranath anakala on Apr 2, 2010 10:03 AM

4 REPLIES 4
Read only

Former Member
0 Likes
544

HI

AT SELECTION-SCREEN ON P_BUKRS.

DATA l_abkrs LIKE dynpread-fieldvalue.

IF p_bukrs IS NOT INITIAL.
SELECT SINGLE abkrs
INTO l_abkrs
FROM ztt_hmrc_vendor
WHERE bukrs = p_bukrs.

CHECK sy-subrc = 0.

p_abkrs = l_abkrs.
ENDIF.

AT SELECTION-SCREEN OUTPUT.
if p_bukrs is not initial. " Add this one
LOOP AT SCREEN.
IF screen-name = 'p_abkrs'. " Make  it P_ABKRS
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endif

Cheerz

Ram

Read only

0 Likes
544

Hi Ramchander,

For the same scenario explained above, i got one more change i.e. at selection-screen fields p_bukrs(ccode),

p_abkrs(payroll area), i provided f4 help at p_bukrs to fetch corresponding payroll value from a ztable and it

should be greyed out as mentioned.

But now the requirement is, in the ztable out of 8 company codes, 2 company codes (say '3000' and '4000' ) are having

2 payroll areas each and we need to accomodate the user to chose the payroll area he likes, so at selection-screen

field 'p_bukrs', if user chose '3000' or '4000', we need to provide another f4 help to select the required payroll area and

make it displayed on sel-screen.

I tried in the following way, but i trail only on '3000' ccode and here at f4 help of '3000', irrespective of user selection

it's showing the second payroll area...so pls suggest me for any changes, tht would be a gr8 help.....

AT SELECTION-SCREEN ON p_bukrs.

DATA l_abkrs TYPE dynpread-fieldvalue.

DATA l_lifnr TYPE dynpread-fieldvalue.

DATA l_bkref TYPE dynpread-fieldvalue.

DATA l_lifnr1 TYPE dynpread-fieldvalue.

IF p_bukrs EQ '1000' OR

p_bukrs EQ '1200' OR

p_bukrs EQ '1600' OR

p_bukrs EQ '2000' OR

p_bukrs EQ '2100' OR

p_bukrs EQ '8000'.

SELECT SINGLE abkrs

lifnr

lifnr1

hmrc

INTO (l_abkrs,l_lifnr,l_lifnr1,l_bkref)

FROM ztt_hmrc_vendor

WHERE bukrs = p_bukrs.

CHECK sy-subrc = 0.

p_abkrs = l_abkrs.

p_lifnrs = l_lifnr.

p_lifnrd = l_lifnr1.

p_bkref = l_bkref.

ELSE.

IF p_bukrs EQ '3000'.

  • p_bukrs EQ '4000'.

SELECT abkrs

FROM ztt_hmrc_vendor

INTO TABLE gt_split

WHERE bukrs = p_bukrs.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ABKRS'

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'P_ABKRS'

VALUE_ORG = 'S'

tables

value_tab = gt_split

  • FIELD_TAB =

RETURN_TAB = gt_return " type std table of ddshretval

  • DYNPFLD_MAPPING =

.

LOOP AT gt_split INTO gs_split.

p_abkrs = gs_split-abkrs.

ENDLOOP.

ENDIF.

ENDIF.

Regards

Suren

Read only

0 Likes
544

Hi Suri,

There are two parts in this.
" Just make this thead as unanswered so some one will give some solution then only,
" You are likely to get more Inputs from SDN 
1)first you need update the second field directly from the First search Help.
2) donot allow user to enter value in second field means he has to use First Search help only

1)for first one to achieve use the below thread.

2) For second one to acheive.
use a flag in F4 Help 
data : from_f4. 

now validate the second field

at selection-screen.

if second_field is not initial.
if from_f4 is initial. " means Manually entered
message 'Please select the Payroll Area from F4 only' type 'E'.
endif.

now after the user press enter you can make the Field Disply only
endif.

Cheerz

Ram

Read only

Former Member
0 Likes
544

selection-screen validations