Search this site

Monday, April 2, 2012

Abap query transaction

The transaction codes associated with ABAP Query are

SQ01

- ABAP Query

SQ02

- Infoset

SQ03

- User group

Sapscript example code in Abap

REPORT ZDEMO_SAPSCRIPT_PERFORM.
*----------------------------------------------------------------------
* TABLES: VBAP. TABLES: ITCPO.  " optional for setting default print parameters PARAMETERS: FORM LIKE RSSCF-TDFORM DEFAULT 'YDEMO_PERFORM'.
  START-OF-SELECTION.  
************************************************************************
 * Open the SapScript Form with the "form"                              * ************************************************************************ 
 CLEAR ITCPO .
 * itcpo-tddest     = 'ZHTM'.  
 ITCPO-TDIMMED    = 'X'.  
 ITCPO-TDDELETE   = 'X'.   
ITCPO-TDNEWID    = 'X'.    
CALL FUNCTION 'OPEN_FORM'        
 EXPORTING             FORM               = FORM        " name of form (SE71)       
       OPTIONS            = ITCPO     
      EXCEPTIONS             CANCELED           = 1  
       DEVICE             = 2 
            FORM               = 3        
     OPTIONS            = 4         
    UNCLOSED           = 5             
MAIL_OPTIONS       = 6             
OTHERS             = 7.  ************************************************************************ *
* Execute the element "HELLO" in window MAIN *  
- Nothing happens if /E HELLO is not declared in MAIN ************************************************************************
 CALL FUNCTION 'WRITE_FORM'    
  EXPORTING           ELEMENT                  = 'HELLO'  "execute element /E HELLO *                FUNCTION                 = 'SET'          
   TYPE                     = 'BODY'   "normal output
       EXCEPTIONS           ELEMENT                  = 1         
    FUNCTION                 = 2           
  TYPE                     = 3        
      UNOPENED                 = 4         
      UNSTARTED                = 5       
     WINDOW                   = 6   
     BAD_PAGEFORMAT_FOR_PRINT = 7           
OTHERS                   = 8.  ************************************************************************ 
* Close the current SapScript Form ************************************************************************
CALL FUNCTION 'CLOSE_FORM'  
    EXCEPTIONS  
         UNOPENED                 = 1    
       BAD_PAGEFORMAT_FOR_PRINT = 2 
          OTHERS                   = 3.  
FORM CALLED_FROM_SAPSCRIPT   TABLES  IN_TAB STRUCTURE ITCSY          OUT_TAB STRUCTURE ITCSY.    
DATA: TABIX LIKE SY-TABIX.
   TABLES: KNA1. 
   BREAK-POINT.  
  READ TABLE IN_TAB WITH KEY NAME = 'KUNNR'.   
KNA1-KUNNR = IN_TAB-VALUE.   
 READ TABLE OUT_TAB WITH KEY NAME = 'NAME'.   
TABIX = SY-TABIX.    
OUT_TAB-NAME  = 'NAME'.   
SELECT SINGLE * FROM KNA1 WHERE KUNNR EQ KNA1-KUNNR.   
IF SY-SUBRC EQ 0.    
   CONCATENATE KNA1-NAME1 KNA1-ORT01 INTO OUT_TAB-VALUE                                 SEPARATED BY SPACE. 
   ELSE.   
     CONCATENATE KNA1-KUNNR 'not found' INTO OUT_TAB-VALUE                               SEPARATED BY SPACE.  
 ENDIF.
   MODIFY OUT_TAB INDEX TABIX. 
ENDFORM. 


SapScript Coding
....+....1....+....2....+....3....+....4....+....5....+....6....+....7.. /E PERFORM_ABAP                                                                    /: PERFORM CALLED_FROM_SAPSCRIPT IN PROGRAM zsapscriptexits /: USING &invar1&                                      /: USING &invar2&                                      ...                                                    /: CHANGING &outvar1&                                  /: CHANGING &outvar2&                                  ...                                                    /: ENDPERFORM       
(Refer from site idocs.de)

Sunday, April 1, 2012

How to debug Sapscript ABAP

First method.
  1. Go to SE71 transaction.
  2. Click on Utilities menu -> Activate Debugger.

Sapscript tcode

SO10 - SAPscript: Standard Texts Basis - SAPscript
SE71 - SAPscript form Basis - SAPscript
SE73 - SAPscript Font Maintenance Basis - SAPscript
SE75 - SAPscript Settings Basis - SAPscript
SE72 - SAPscript Styles Basis - SAPscript
SE76 - SAPscript: Form Translation Basis - SAPscript




SE74 - SAPscript format conversion Basis - SAPscript
SE77 - SAPscript Styles Translation Basis - SAPscript
PBAT - Choose SAPscript or WinWord Personnel Mgmt - Recruitment
J2I7 - CIN: SAPScript reporting customizing FI - Localization
PM20 - Statements with SAPscript Payroll - Reuse Services for Country Development
BRFU01 - BRF: Compare SAPscript Texts Cross Application - Business Rule Framework

Sapscript command abap

Command

Use

New-page

Prints the text following this command on a new page (when a page name is specified then that page is taken as the next page)

Protect ….. Endprotect

This acts like a conditional page break. Putting the text within this command prevents the breaking of the text across multiple pages. If there is not enough space for the entire paragraph to be printed in the space remaining on the page, then the entire paragraph is printed on the next page

Box

Position

Size

The BOX command draws a box as per the specifications. The x y co-ordinates are for the upper left corner relative to the values in the position command.

POSITION command is used to set the x y co-ordinates with respect to the start position of the window.

SIZE command is used to specify the size of the box that we need to draw.

Varying these parameters also helps to draw a line instead of a box.

IF ….. END IF

This allows the conditional printing of the text on the output document. The various conditional operators that can be used are as follows

= EQ Equal to

<>

> GT Greater than

<= LE Less than or equal to

>= GE greater than or equal to

<> NE not equal to

The logical operators that can be used are as follows

NOT, AND, OR

How to create a Sapscript in abap

Please get the file :
Create a Sapscript in abap



Sapscript tutorial abap

As below show you a list of SapScript tutorial:



Module programming(user dialog programming)

1.What is module programming(dialog programming) ?
2.Module pool programming step by step



Module pool programming in abap step by step


  1. Episode 01 : Example module pool program simple for input,output and how to use event Process before output and Process after input.
  2. Episode 02: Example create GUI status in module pool programming
  3. Episode 03: Modify screen in module pool programming
  4. Episode 04: Create title of module program