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: 

WRITE STATEMENT IS GETTING EXECUTED BUT NOT GETTING DISPLAYED

Former Member
0 Kudos
572

HII All,

i hv created a selection screen with push button. Now when i m clicking that pushbutton, output is not getting displayed..when i debug program ,control enters in switch case and also executes write statement but write statement is not getting displayed.. below is the code ..

SELECTION-SCREEN BEGIN OF BLOCK INPUT WITH FRAME TITLE TEXT-001.

  SELECTION-SCREEN PUSHBUTTON 10(20) TEXT-002  USER-COMMAND FIR.
  SELECTION-SCREEN PUSHBUTTON 35(20) TEXT-003  USER-COMMAND SECOND.

SELECTION-SCREEN END OF BLOCK INPUT.
        
       WA-EMP_NO = 123.       
        WA-EMP_CO = 'A'.
        WA-EMP_N = 'APOORV'.
        APPEND WA TO IT_TAB.

AT SELECTION-SCREEN.

CASE SY-UCOMM.
 WHEN 'FIR'.
PERFORM SUB1.

WHEN 'SECOND'.

        APPEND LINES OF IT_TAB FROM 2 TO 3 TO IT_TAB1.
        WRITE:/ 'SECOND INTERNAL TABLE CONTENTS'.
        LOOP AT IT_TAB1 INTO WA1.
        WRITE:/15 SY-TABIX, WA1-EMP_NO NO-ZERO, WA1-EMP_CO, WA1-EMP_N.
        ENDLOOP.
ENDCASE.

FORM SUB1.
 LOOP AT IT_TAB INTO WA.
          WRITE:/ SY-TABIX, WA-EMP_NO NO-ZERO, WA-EMP_CO, WA-EMP_N.
 ENDLOOP.
ENDFORM.

Plz help me..

Edited by: Julius Bussche on Jan 29, 2009 1:40 PM

Code tags added and please dont use Caps-Lock.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
119

HI,

SELECTION-SCREEN BEGIN OF BLOCK INPUT WITH FRAME TITLE TEXT-001.

SELECTION-SCREEN PUSHBUTTON 10(20) TEXT-002 USER-COMMAND FIR.
SELECTION-SCREEN PUSHBUTTON 35(20) TEXT-003 USER-COMMAND SECOND.

SELECTION-SCREEN END OF BLOCK INPUT.

WA-EMP_NO = 123. 
WA-EMP_CO = 'A'.
WA-EMP_N = 'APOORV'.
APPEND WA TO IT_TAB.

* AT SELECTION-SCREEN.                 "Comment this 
START-OF_SELECTION.                     " Add this 
CASE SY-UCOMM.
WHEN 'FIR'.
PERFORM SUB1.

WHEN 'SECOND'.

APPEND LINES OF IT_TAB FROM 2 TO 3 TO IT_TAB1.
WRITE:/ 'SECOND INTERNAL TABLE CONTENTS'.
LOOP AT IT_TAB1 INTO WA1.
WRITE:/15 SY-TABIX, WA1-EMP_NO NO-ZERO, WA1-EMP_CO, WA1-EMP_N.
ENDLOOP.
ENDCASE.

FORM SUB1.
LOOP AT IT_TAB INTO WA.
WRITE:/ SY-TABIX, WA-EMP_NO NO-ZERO, WA-EMP_CO, WA-EMP_N.
ENDLOOP.
ENDFORM.

6 REPLIES 6

Former Member
0 Kudos
120

HI,

SELECTION-SCREEN BEGIN OF BLOCK INPUT WITH FRAME TITLE TEXT-001.

SELECTION-SCREEN PUSHBUTTON 10(20) TEXT-002 USER-COMMAND FIR.
SELECTION-SCREEN PUSHBUTTON 35(20) TEXT-003 USER-COMMAND SECOND.

SELECTION-SCREEN END OF BLOCK INPUT.

WA-EMP_NO = 123. 
WA-EMP_CO = 'A'.
WA-EMP_N = 'APOORV'.
APPEND WA TO IT_TAB.

* AT SELECTION-SCREEN.                 "Comment this 
START-OF_SELECTION.                     " Add this 
CASE SY-UCOMM.
WHEN 'FIR'.
PERFORM SUB1.

WHEN 'SECOND'.

APPEND LINES OF IT_TAB FROM 2 TO 3 TO IT_TAB1.
WRITE:/ 'SECOND INTERNAL TABLE CONTENTS'.
LOOP AT IT_TAB1 INTO WA1.
WRITE:/15 SY-TABIX, WA1-EMP_NO NO-ZERO, WA1-EMP_CO, WA1-EMP_N.
ENDLOOP.
ENDCASE.

FORM SUB1.
LOOP AT IT_TAB INTO WA.
WRITE:/ SY-TABIX, WA-EMP_NO NO-ZERO, WA-EMP_CO, WA-EMP_N.
ENDLOOP.
ENDFORM.

0 Kudos
119

thanx but o/p is still not getting displayed...

help awaiting

Former Member
0 Kudos
119

Hello,

In AT SELECTION-SCREEN. just set the flag and use write in end-of selection.

AT SELECTION-SCREEN

CASE SY-UCOMM.

WHEN 'FIR'.

flag = 1.

flag = 2.

START-OF-SELECTION.

END-OF-SELECTION.

IF FLAG = 1.

WRITE: XYZ.

ELSEIF FLAG = 2.

PERFORM FUN.

ENDIF.

Regards,

Neelambari

0 Kudos
119

thanx but o/p is still not getting displayed

Pawan_Kesari
Active Contributor
0 Kudos
119

Just before the execution of event START-OF-SELECTION the report area is refreshed.

So you will not be able to see the result of WRITE statement executed before START-OF-SELECTION.

Try the execution of you program in debug mode...

Former Member
0 Kudos
119

Hi,

The WRITE is written in screen 1000 by default. So try giving them inside START-OF-SELECTION.

Hope this helps.

Regards,

Deepthi.