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: 

HOW TO CLOSE A WINDOW?

Former Member
0 Kudos
268

hi guys.....

happy new year to all.....

pls help me out on this....

could u pls give me a command to kill or close a window?

i tried the function module graph_dialog but it is not working.

thanks in advance...

1 ACCEPTED SOLUTION

Former Member
0 Kudos
141

How did you invoke the "window"? - if it is a dialog window e.g. call like


  call screen 9999
    starting at 004 003
    ending   at 072 011.

then you use a "leave to screen 0" in the PBO (or leave to a transaction, specific screen, submit a report or whatever your next process is.

Jonathan

4 REPLIES 4

Former Member
0 Kudos
142

How did you invoke the "window"? - if it is a dialog window e.g. call like


  call screen 9999
    starting at 004 003
    ending   at 072 011.

then you use a "leave to screen 0" in the PBO (or leave to a transaction, specific screen, submit a report or whatever your next process is.

Jonathan

0 Kudos
141

thank you for ur reply,

but i hav created a window in interactive reports in the primary list. when i return from the secondary list to the primary list i would like to kill the window. wat command should i use?

0 Kudos
141

OK.. then I think you will just need to adjust the "sy-lsind" after you show the popup... here's a simple example you could try:


report zlocal_jc_sdn_report_window.

at user-command.
  perform user_command.

start-of-selection.
  perform main_report.

*&---------------------------------------------------------------------*
*&      Form  user_command
*&---------------------------------------------------------------------*
form user_command.

  case sy-ucomm.
    when 'ZSEL'.  "Selection from main list
      perform window_list.
    when others.
      break-point.  "for testing only!
      sy-lsind = 0.
  endcase.

endform.                    "user_command

*&---------------------------------------------------------------------*
*&      Form  main_report
*&---------------------------------------------------------------------*
form main_report.
  set pf-status 'LIST0001'.  "standard + ZSEL defined for F2
  write: / 'Hello world'.
endform.                    "main_report

*&---------------------------------------------------------------------*
*&      Form  window_list
*&---------------------------------------------------------------------*
form window_list.
  set pf-status 'LIST0002'.  "Dialog PF -> Cancel & Continue defined
  window starting at 5 5 ending at 95 15.
  write: / 'Window list'.
endform.                    "window_list

Jonathan

Former Member
0 Kudos
141

TABLES : zcust_master1.

&----


*& INTERNAL TABLE

&----


DATA : wi_zcust1 LIKE zcust_master1 OCCURS 0 WITH HEADER LINE.

DATA : wi_zcust2 LIKE zcust_master1 OCCURS 0 WITH HEADER LINE.

DATA: l_custid(5) TYPE c.

&----


*& DATA

&----


DATA: col TYPE i,

lin TYPE i,

ln TYPE i,

cb TYPE c,

var1(30) TYPE c VALUE 'customer name',

var2(40) TYPE c VALUE 'address',

var3(15) TYPE c VALUE 'city',

var4(15) TYPE c VALUE 'state',

var5(15) TYPE c VALUE 'COUNTRY',

var6(15) TYPE c VALUE 'PHONE',

var7(15) TYPE c VALUE 'EMAIL',

var8(15) TYPE c VALUE 'FAX',

var9(15) TYPE c VALUE 'staTUS'.

DATA : a TYPE i.

a = sy-lilli .

&----


*& TOP-OF-PAGE

&----


TOP-OF-PAGE.

ULINE.

WRITE : 'CUSTOMER REPORTS'.

ULINE.

&----


*& START-OF-SELECTION

&----


START-OF-SELECTION.

SELECT * FROM zcust_master1 INTO CORRESPONDING FIELDS OF TABLE wi_zcust1.

WRITE: / 'CLICK ON THE CUSTOMER ID TO GET DETAILS' INTENSIFIED COLOR 5.

ULINE.

LOOP AT wi_zcust1.

WRITE:/ wi_zcust1-customerid HOTSPOT ON.

ENDLOOP.

END-OF-SELECTION.

&----


*& AT-LINE-SELECTION

&----


AT LINE-SELECTION.

SET PF-STATUS 'ZBANKST1_CUS'.

GET CURSOR VALUE l_custid.

SELECT * FROM zcust_master1 INTO CORRESPONDING FIELDS OF TABLE wi_zcust2 WHERE customerid = l_custid.

col = sy-cucol + 50.

lin = sy-curow + 8.

WINDOW STARTING AT sy-cucol sy-curow

ENDING AT col lin.

WRITE : / cb AS CHECKBOX ,var1.

WRITE : / cb AS CHECKBOX ,var2.

WRITE : / cb AS CHECKBOX ,var3.

WRITE : / cb AS CHECKBOX ,var4.

WRITE : / cb AS CHECKBOX ,var5.

WRITE : / cb AS CHECKBOX ,var6.

WRITE : / cb AS CHECKBOX ,var7.

WRITE : / cb AS CHECKBOX ,var8.

WRITE : / cb AS CHECKBOX ,var9.

&----


*& AT USER-COMMAND.

&----


AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'SUBMIT'.

WRITE: / 'CUSTOMER DETAILS' INTENSIFIED COLOR 5.

ULINE.

WRITE 😕 'CUSTOMER ID' INTENSIFIED COLOR 4 , l_custid.

DO syst-srows TIMES.

READ LINE sy-index FIELD VALUE cb var1.

IF cb = 'X'.

IF sy-index = 1.

LOOP AT wi_zcust2.

WRITE 😕 'NAME:' INTENSIFIED COLOR 4 , wi_zcust2-customername.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE cb var2.

IF sy-index = 2.

LOOP AT wi_zcust2.

WRITE 😕 'ADDRESS:' INTENSIFIED COLOR 4 , wi_zcust2-address.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE cb var3.

IF sy-index = 3.

LOOP AT wi_zcust2.

WRITE 😕 'CITY:' INTENSIFIED COLOR 4 , wi_zcust2-city.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE cb var4.

IF sy-index = 4.

LOOP AT wi_zcust2.

WRITE 😕 'STATE:' INTENSIFIED COLOR 4 , wi_zcust2-state.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE cb var5.

IF sy-index = 5.

LOOP AT wi_zcust2.

WRITE 😕 'COUNTRY:' INTENSIFIED COLOR 4 , wi_zcust2-country.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE cb var6.

IF sy-index = 6.

LOOP AT wi_zcust2.

WRITE 😕 'PHONE NO:' INTENSIFIED COLOR 4 , wi_zcust2-phoneno.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE cb var7.

IF sy-index = 7.

LOOP AT wi_zcust2.

WRITE 😕 'EMAIL:' INTENSIFIED COLOR 4, wi_zcust2-email.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE cb var8.

IF sy-index = 8.

LOOP AT wi_zcust2.

WRITE :/'FAX:' INTENSIFIED COLOR 4 , wi_zcust2-fax.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE cb var9.

IF sy-index = 9.

LOOP AT wi_zcust2.

WRITE 😕 'STATUS:' INTENSIFIED COLOR 4 , wi_zcust2-status.

ENDLOOP.

ENDIF.

ENDIF.

ENDDO.

ENDCASE.

this is my program. knidly tel me where to use that command.