martedì 18 marzo 2008

3 easy way to add checkbox in your Sapscript

Hi abappers,

surfing on internet i have found 3 way for add a checkbox in Sapscript, now i explain you below:


1. you can do using box commands.in that you can use value 'X' for check and space for uncheck.

2. Go to the corresponding windows text editor in the change mode.Go to INSERT in the menu barChoose CharactersChoose SAP Icons.In that list you will be able see an Icon for Check box with name ICON_CHECKBOX.Once you choose that you will get <2039> in the text editor.save and activate it.You will be able to see the check box only when you print it but not in the print preview.

3. a. Upload two logos(small picture of two checkboxes), one which is checked and another which is not checked.
b. You can make use of hyper snap dx 4 software or some other to desgin your checkbox little logo.
c. Make use of 2 INCLUDE statements in your script.4. Depending on the condition call them in IF or CASE condition.In this way, no BOX command is needed and you can also see the display on print preview..

martedì 11 marzo 2008

Smartforms quick tutorial

A useful document for begin to develop a SAP Smartforms.



DOWNLOAD

venerdì 29 febbraio 2008

The UPDATE Parameter

The UPDATE Parameter

You use the UPDATE parameter to specify how updates produced by a transaction should be processed. You can select between these modes:

A Asynchronous updating. In this mode, the called transaction does not wait for any updates it produces to be completed. It simply passes the updates to the SAP update service. Asynchronous processing therefore usually results in faster execution of your data transfer program.

Asynchronous processing is NOT recommended for processing any larger amount of data. This is because the called transaction receives no completion message from the update module in asynchronous updating. The calling data transfer program, in turn, cannot determine whether a called transaction ended with a successful update of the database or not.

If you use asynchronous updating, then you will need to use the update management facility (Transaction SM12) to check whether updates have been terminated abnormally during session processing. Error analysis and recovery is less convenient than with synchronous updating.



S Synchronous updating. In this mode, the called transaction waits for any updates that it produces to be completed. Execution is slower than with asynchronous updating because called transactions wait for updating to be completed. However, the called transaction is able to return any update error message that occurs to your program. It is much easier for you to analyze and recover from errors.

L Local updating. If you update data locally, the update of the database will not be processed in a separate process, but in the process of the calling program. (See the ABAP keyword documentation on SET UPDATE TASK LOCAL for more information.)

venerdì 22 febbraio 2008

BAPI_ENTRYSHEET_CREATE

Here you can download an useful tutorial, explain how to use the Bapi for creation of Entrysheet.



DOWNLOAD

Read file in a local directory

Hi abappers,
How to read file in a local directory from sap?
Here a short example using the method DIRECTORY_LIST_FILES of class 'CL_GUI_FRONTEND_SERVICES'.
This method returns the number of file, name end properties.


DATA: wa_file_table TYPE file_info,
tab TYPE STANDARD TABLE OF file_info,
count TYPE i.

CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = 'C:\DownloadDirector'
CHANGING
file_table = tab
count = count.

giovedì 21 febbraio 2008

Report Find Exit

Hi. This is a useful report that find the SAP enhancement for transaction name:

*&---------------------------------------------------------------------*
*& Enter the transaction code that you want to search through in order
*& to find which Standard SAP User Exits exists.
*&
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Tables
*&---------------------------------------------------------------------*
TABLES : tstc, "SAP Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*&---------------------------------------------------------------------*
*& Variables
*&---------------------------------------------------------------------*

DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
*&---------------------------------------------------------------------*
*& Selection Screen Parameters
*&---------------------------------------------------------------------*

SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
*&---------------------------------------------------------------------*
*& Start of main program
*&---------------------------------------------------------------------*

START-OF-SELECTION.
* Validate Transaction Code
SELECT SINGLE * FROM tstc
WHERE tcode EQ p_tcode.
* Find Repository Objects for transaction code
IF sy-subrc EQ 0.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = tstc-pgmna.
MOVE : tadir-devclass TO v_devclass.

IF sy-subrc NE 0.
SELECT SINGLE * FROM trdir
WHERE name = tstc-pgmna.

IF trdir-subc EQ 'F'.
SELECT SINGLE * FROM tfdir
WHERE pname = tstc-pgmna.
SELECT SINGLE * FROM enlfdir
WHERE funcname = tfdir-funcname.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'FUGR'
AND obj_name = enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
* Find SAP Modifactions
SELECT * FROM tadir
INTO TABLE jtab
WHERE pgmid = 'R3TR'
AND object = 'SMOD'
AND devclass = v_devclass.
SELECT SINGLE * FROM tstct
WHERE sprsl EQ sy-langu
AND tcode EQ p_tcode.

FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
SKIP.

IF NOT jtab[] IS INITIAL.
WRITE:/(95) sy-uline.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
WRITE:/(95) sy-uline.

LOOP AT jtab.
SELECT SINGLE * FROM modsapt
WHERE sprsl = sy-langu AND
name = jtab-obj_name.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WRITE:/1 sy-vline,
2 jtab-obj_name HOTSPOT ON,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
ENDLOOP.
WRITE:/(95) sy-uline.
DESCRIBE TABLE jtab.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No of Exits:' , sy-tfill.

ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'No User Exit exists'.
ENDIF.

ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'Transaction Code Does Not Exist'.
ENDIF.
* Take the user to SMOD for the Exit that was selected.
AT LINE-SELECTION.
GET CURSOR FIELD field1.
CHECK field1(4) EQ 'JTAB'.
SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.