Application Development 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: 

HI Question On Selection Screen

Former Member
0 Kudos

Hi Abapers,

i declared four parameters , one is assigned with one parameter is , and the other three are assigned with another parameter id , initially only one parameter has to display , if the entered parameter is valid one , then other three parameters has to be displayed, i wrote the folling code kindly make any corrections to the below code.

parameters:p_kunnr type kna1-kunnr modif id ABC.

parameters:p_vbeln type vbak-vbeln modif id DEF,

p_bukrs type bukrs modif id DEF,

p_werks type werks modif id DEF.

data: w_kunnr type kunnr,

val type i value 1.

at selection-screen .

select single kunnr from kna1 into w_kunnr where kunnr = p_kunnr.

if sy-subrc eq 0.

val = 100.

else.

message e000(0) with 'invalid '.

endif.

start-of-selection.

write:/ 'success'.

at selection-screen output .

IF VAL = 1.

loop at screen.

if screen-group1 = 'DEF'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

endif.

endloop.

ENDIF.

IF VAL NE 1.

loop at screen.

if screen-group1 = 'DEF'.

SCREEN-ACTIVE = 1.

MODIFY SCREEN.

endif.

endloop.

ENDIF.

Thanks & Regards

Bhaskar Rao.M

1 ACCEPTED SOLUTION

former_member533584
Contributor
0 Kudos

hai,

Bhaskar try this code...

parameters:

p_kunnr type kna1-kunnr modif id ABC .

parameters:p_vbeln type vbak-vbeln modif id DEF,

p_bukrs type bukrs modif id DEF,

p_werks type werks modif id DEF.

data:

w_kunnr type kunnr,

val type i value 1.

at selection-screen output .

IF p_kunnr is initial.

loop at screen.

if screen-group1 = 'DEF'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

endif.

endloop.

ENDIF.

at selection-screen .

select single kunnr from kna1 into w_kunnr where kunnr = p_kunnr.

if sy-subrc ne 0.

message e000(0) with 'invalid '.

endif.

start-of-selection.

if p_vbeln is initial.

message 'error' type 'I'.

else.

write:/ 'success'.

endif.

regards,

ananth

6 REPLIES 6

Former Member
0 Kudos

What error u r getting from this code??

0 Kudos

Hi ,

I am not getting any Error , But Even i give valid value , it is not giving deactivated fields.

Thanks & Regards

Bhaskar Rao.M

Former Member
0 Kudos

Hi bhaskar,

I think this is the error.

replace the first parameter declaration with below line

<b>parameters:p_kunnr type kna1-kunnr modif id ABC user-command RAD.</b>Please reward points if helpful

Thanks,

Suma.

Former Member
0 Kudos

Hi,

If you press the Enter then only it will show the Disable fields, until unless it will not trigger the Event.

Regards

Sudheer

former_member533584
Contributor
0 Kudos

Hi,

when you correct value and press <b>execcte(F8)</b> it goes to at selection screen and then start-of-selection it does not go to at selection screen output event .

so the remainng 3 are not displayed.

when you correct value and press <b>enter</b> it goes to at selection screen and then at selection screen output event then the remainng 3 are displayed.

regards,

anath.

former_member533584
Contributor
0 Kudos

hai,

Bhaskar try this code...

parameters:

p_kunnr type kna1-kunnr modif id ABC .

parameters:p_vbeln type vbak-vbeln modif id DEF,

p_bukrs type bukrs modif id DEF,

p_werks type werks modif id DEF.

data:

w_kunnr type kunnr,

val type i value 1.

at selection-screen output .

IF p_kunnr is initial.

loop at screen.

if screen-group1 = 'DEF'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

endif.

endloop.

ENDIF.

at selection-screen .

select single kunnr from kna1 into w_kunnr where kunnr = p_kunnr.

if sy-subrc ne 0.

message e000(0) with 'invalid '.

endif.

start-of-selection.

if p_vbeln is initial.

message 'error' type 'I'.

else.

write:/ 'success'.

endif.

regards,

ananth