REPORT OUTPUT WITH OUR OWN GUI STATUS

Based on the given sales document numbers display the sales document number, document dates & customer numbers as shown in below. 


If the user click on download button then we download the selected records into presentation server. If the user click on display button then we display the sales order details through VA03 transaction. If the user click on ‘Selt all’ then select the all check boxes.

PROGRAM:

*&---------------------------------------------------------------------*
*& Report  ZR_REPORT_WITH_OUR_OWN_GUI
*&
*&---------------------------------------------------------------------*
REPORT ZR_REPORT_WITH_OUR_OWN_GUI.
dataab.
DATAV1 TYPE VBAK-VBELNV2 TYPE VBAK-AUDAT,
      V 
TYPE SYLINNO.
tables vbak.
select-options s_vbeln for vbak-vbeln.
typesbegin of ty_vbak,

       vbeln 
type vbak-vbeln,
       audat 
type vbak-audat,
       kunnr 
type vbak-kunnr,
       a 
type c,
       
end of ty_vbak.
datawa_vbak type ty_vbak,
      it_vbak 
type table of ty_vbak.
DATAWA LIKE WA_VBAK,
      IT 
LIKE TABLE OF WA.
select vbeln audat kunnr
  
from vbak
  
into table it_vbak
  
where vbeln in s_vbeln.
loop at it_vbak into wa_vbak.
 
write:/ a as checkbox,
         wa_vbak-vbeln
,
         wa_vbak-audat
,
         wa_vbak-kunnr
.
endloop.

SY-LINNO.
set pf-status 'STAT'.
AT USER-COMMAND.
 
IF SY-UCOMM 'DOWNLOAD'.
 
DO TIMES.
 
READ LINE SY-INDEX FIELD VALUE INTO B
           WA_VBAK
-VBELN INTO WA-VBELN
           WA_VBAK
-AUDAT INTO WA-AUDAT
           WA_VBAK
-KUNNR INTO WA-KUNNR.

 
IF 'X'.
 
APPEND WA TO IT.
 
CLEAR WA.
 
ENDIF.
 
ENDDO.
CALL FUNCTION 'DOWNLOAD'
 
EXPORTING
   FILETYPE                      
'DAT'
  
TABLES
    data_tab                      
IT
          
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.


 
ELSEIF SY-UCOMM 'SETALL'.
 A 
'X'.
 
LOOP AT IT_VBAK INTO WA_VBAK.
 
WRITE:/ A AS CHECKBOX,
         WA_VBAK
-VBELN,
         WA_VBAK
-AUDAT,
         WA_VBAK
-KUNNR.
 
ENDLOOP.

 
ELSEIF SY-UCOMM 'DISPLAY'.
 
DO TIMES.
 
READ LINE SY-INDEX FIELD VALUE INTO B
                  WA_VBAK
-VBELN INTO V1.
 
IF 'X'.
 
SET PARAMETER ID 'AUN' FIELD V1.
 
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
 
ENDIF.
 
ENDDO.
 
ENDIF.

OUTPUT: 
 IF THE USER CLICKS ON DOWNLOAD BUTTON
   

  
NOW THE FILE IS AS LIKE THIS


IF THE USER SELECT ANY ONE OF THE CHECKBOX AND CLICKS ON DISPLAY BUTTON THEN CALLS THE SCREEN VA03




IF THE USER CLICKS ON SELECT ALL BUTTON THEN ALL THE CHECKS WILL BE SELECTED