Sunday, May 11, 2008

SAP ABAP program for POPUP screen

SAP ABAP program for POPUP screen

If you wish to POPUP a screen in SAP ABAP then it can be done as shown below. Do experiment with the X,Y co-ordinates for the POP-UP Screen. The following program pulls out sales orders from the sap database and displays them on the screen. When the user clicks on a particular sales order, it displays the Sales order number and the Customer number in the POP-UP Screen

REPORT ZEX_POPUPSCREEN .

*&---------------------------------------------------------------------*
*& ABAPLOVERS POPUP SCREEN
*&---------------------------------------------------------------------*

* Table Declaration
TABLES VBAK.
* Start of Selection
START-OF-SELECTION.
  SELECT * FROM VBAK.
    WRITE / VBAK-VBELN HOTSPOT ON.
  ENDSELECT.
* Display the screen
AT LINE-SELECTION.
  WINDOW STARTING AT 10 10
         ENDING   AT 40 25.
  WRITE:/ 'VBAK-VBELN, VBAK-KUNNR'.



SAP ABAP Function Module to Read Files and Directories from the Presentation Server

SAP ABAP Function Module to Read Files and Directories from the Presentation Server

The following function module reads files and directories from the presentation server and stores it in the internal table. This fucntion module can be used to read all the files and directories from the entered directory.

TMP_GUI_DIRECTORY_LIST_FILES

Please find a program that shows the parameters that need to be passed to this function module.

REPORT ZEX_GETDIRFROMPRE .


Parameters: p_dir(100) type c.

Data: d_filecount type i,
      d_dircount type i,
      int_filetab like SDOKPATH occurs 0 with header line,
      int_dirtable like SDOKPATH occurs 0 with header line.

CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
  EXPORTING
    DIRECTORY        = p_dir
   FILTER            = '*.*'
 IMPORTING
   FILE_COUNT        = d_filecount
   DIR_COUNT         = d_dircount
  TABLES
    FILE_TABLE       = int_filetab
    DIR_TABLE        = int_dirtable
 EXCEPTIONS
   CNTL_ERROR       = 1
   OTHERS           = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.