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 EVENTS PROBLEM

Former Member
0 Likes
395

At the following code i have this specific problem : I pass a value at the fields S_EMAIL , s_email1 , s_email2 when i start my report .

Then if i want to change the value after i can't because when i press enter i take the first values that i pass .

For example when i start the report the value that i pass to s_email is 'xxx@xxx.com'. Then if i will go to change it to 'yyyy@yyy.com' when i press enter it changes again to xxx@xxx.com.

Is something with the SELECTION-SCREEN events ?

PARAMETERS: EML AS CHECKBOX USER-COMMAND RAD1,

S_EMAIL TYPE ADR6-SMTP_ADDR MODIF ID EM1,

EML1 AS CHECKBOX USER-COMMAND RAD2,

S_EMAIL1 TYPE ADR6-SMTP_ADDR MODIF ID EM2,

EML2 AS CHECKBOX USER-COMMAND RAD3,

S_EMAIL2 TYPE ADR6-SMTP_ADDR MODIF ID EM3.

.....

AT SELECTION-SCREEN OUTPUT.

IF EML NE 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'EM1'.

SCREEN-INPUT = '0'.

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF EML1 NE 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'EM2'.

SCREEN-INPUT = '0'.

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF EML2 NE 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'EM3'.

SCREEN-INPUT = '0'.

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

.....

AT SELECTION-SCREEN.

CLEAR VBRK.

SELECT SINGLE * FROM VBRK WHERE VBELN = S_VBELN-LOW.

IF SY-SUBRC = 0.

CLEAR KNA1.

SELECT SINGLE * FROM KNA1 WHERE KUNNR = VBRK-KUNRG.

SNAME = KNA1-NAME1.

CLEAR ADR6.

SELECT SINGLE * FROM ADR6 WHERE ADDRNUMBER = KNA1-ADRNR.

IF SY-SUBRC = 0 .

S_EMAIL = ADR6-SMTP_ADDR.

ELSE.

S_EMAIL = 'No Email Address !!!!'.

ENDIF.

ELSE.

S_EMAIL = 'No Email Address !!!!'.

ENDIF.

tHANKS A LOT .....

2 REPLIES 2
Read only

Former Member
0 Likes
369

use 'initialization' event instead of 'at selection-screen output'.

This will solve ur problem..

<b><u>Dont forget to reward all the useful replies</u></b>

Sudheer

Read only

Former Member
0 Likes
369

Hi

The problem is in the AT SELECTION-SCREEN event where you load the address from customer muster data:

SELECT SINGLE * FROM ADR6 WHERE ADDRNUMBER = KNA1-ADRNR.

IF SY-SUBRC = 0 .

S_EMAIL = ADR6-SMTP_ADDR.

ELSE.

S_EMAIL = 'No Email Address !!!!'.

ENDIF.

ELSE.

S_EMAIL = 'No Email Address !!!!'.

ENDIF.

The program'll always try to load the address from database and delete the data you've inserted.

U should check if S_EMAIL is empty and decide when the it has to be loaded from ADR6.

Max