Tuesday, June 23, 2009

How to Debug any screen on SAP

its very simple just put this code on a text file and save it with what even name you want e.g debug

[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand



when ever you want to debug you dont have to use /h but just drag and drop this on the SAP screen this enables you to debug on popup screens

Hope this will be useful

nafran

Wednesday, June 10, 2009

how to get the first day and last day SAP

Most of the time when we need the first day and the last day of a given month we always run to get a function. why use a function when its so easy to code it

*get first and last date of month and year
CONCATENATE s_bdatj-low s_mnr-low '01' INTO gv_date1.

gv_month = s_mnr-low .
gv_month = gv_month + 01.

CONCATENATE s_bdatj-low gv_month '01' INTO gv_date2.

gv_date2 = gv_date2 - 1.

Monday, June 8, 2009

only way of parallel or Multi Threading on SAP

Sometimes you get programs where you might have done almost all the programming best practices and Indexing and other stuff but still the program will run very slow.On a time like this sometimes we might wonder is there anyway to do parallel processing or something like multi treading on SAP.
Hmm.... there is only one way that I can think about in SAP and we can get all most all features on Parallel processing from this way.


CALL FUNCTION 'Fetch_Data'
STARTING NEW TASK 'Fetch'
performing RETURN_FROM_WAIT ON END OF TASK
     EXPORTING
input            = input
TABLES
output             = output
EXCEPTIONS
COMMUNICATION_FAILURE = 1
SYSTEM_FAILURE        = 2.





Important : you cant use any import parameters on the function no this
method the only option is to using the RETURN_FROM_WAIT which is a
perform.


For Eg when you want to fetch data parallel do it using 2 functions and using the perform
you can have  a flag to make sure that fetching is completed.
  
This is just a over view I got this document from Daniel Perecky
Multi Threading

this has lots of information no how to program this way.
I would love to see some comments about this :)
Google