Abap Program Check
hi all,
i need to do the following checks in any report program
1. how to check a parameter starting with p_ or not ?
2. how to check a data variable starting with v_ or not ?
3. how to giv identification to the user if he had used any comments in reports.
i. e how to check a special character ' * ' in our program.
4. how to check special symbols like empty space, ' : ' , ' ' ' ' , ' " " ' , ' . '
is there any keyword r standard program r function module r transaction to do all tasks.
thanks n regards,
suresh babu aluri.
Hi Suresh
Use the Report: <b>RPR_ABAP_SOURCE_SCAN</b>
Which will Scan a set of reports for a particular string.
In serach criteria of this report u have Find String option.
There bu giving your required strings you can achieve your requirements.
Regards,
Sreeram
Similar Messages
-
Regd using of lock object in an abap program
Hi all,
i have created an lock object but doesnot know how to use that lock object in an abap program. can anyone guide me how to use lock object in an abap program.check this sample for Production Order.
<b>* Lock request for order
call function 'ENQUEUE_ESORDER'
exporting
aufnr = p_aufnr
exceptions
foreign_lock = 1
system_failure = 2
others = 3
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.</b>
Regards
Prabhu -
How to check whether a batch input session is completed in ABAP program
I have created a ABAP program to create a batch input session (reference to RSBDCSUB). After the creation of the batch input session, I kick it to start and read the execution log. However, sometimes I cannot read anything from the execution log as the execution of the batch input is a synchronized process to the execution of my program, i.e. at the time being that I try to read the log of a particular transaction, that transaction is being processing / haven't start processing.
How can I check whether a batch input session is completed in the program?
The code that corresponding to the triggering of batch input session:
SUBMIT (SUBREPORT)
USER MTAB-USERID
VIA JOB MTAB-GROUPID
NUMBER JNUMB
WITH QUEUE_ID EQ MTAB-QID
WITH MAPPE EQ MTAB-GROUPID
WITH MODUS EQ 'N'
WITH LOGALL EQ LMODUS
Or is there any method to wait here until the process is completed before further processing?Hi gundam,
1. Or is there any method to wait here until the process is completed before further processing?
There is no such direct method to wait.
2. Immediately after submitting in background,
we cannot wait
neither can we LOOP and go on detecting
whether the b/g process has completed or not !
3. To over come such problems,
we have to use another technique.
4. we have to submit another
job which will get triggered
on event SAP_END_OF_JOB
ie. when the original job will finish,
our new job will AUTOMATICALLY get triggered,
5. This new job / program
will do the FURTHER actions !
regards,
amit m. -
Hello All,
My requirement is related to process chain 1 . I have one process chain in that i have to put abap program in middle of that chain . This program will check the status of one another process chain 2 status ( whether it was completed or it is going on). if it is completed then continue the Process chain 1 to further activity else wait to complete Process chain 2 .
Here i have to use process chain 2 as a parameter.
Kindly provide me solution .
Regards
SaurabhHi Saurabh,
You need to create ABAP program in which you check the values for required process chain in
following table
RSPCLOGCHAIN (Feilds ANALYZED_STATUS LOG_ID)
Depend on values you can trigger next process or you can wait unitil this process chain complete.you need to check status from table using ABAP.
If you are not aware about how to write ABAP program then take help from ABAP Team.
Regards,
Ganesh Bothe -
New ABAP Program to check Direct UPDATE in Database Table
Hi all,
As per customer requirement , I have to develop ONE Program which find out that in which ABAP Program , Programmer has used Open Sql command like UPDATE , DELETE , INSERT , MODIFY to direct update in Database Table.
Have a look on all Z-ABAPs, find out if there are statements with "update", "delete", "insert" or "modify" in the coding, then find out if updates to sap-Tables are done
How can I achived that ?
Please , If anybody is having idea , than please let me know..
Thanks You ,Hi
Kindly refer to the below link. This has step by step how you can achieve the checks.
[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/12659a90-0201-0010-c18b-9d014f9bed0d]
But if you want to check if any program they have used 'UPDATE' then you can do like below.
Go to SE38
Utilities---> Find in Source Code-
Find --- UPDATE
In program - Z* or ZX* if you want to search only in Exits
Regards,
Vijay V . -
Authority check in ABAP program
Hello All
I am having some trouble with authority object in ABAP programming
This is the situation.
I have a field "plant" which is a select options in the selection screen.
I have to write an authority-check for this "plant" field in the program and display the report for only the plants for which the user is authorised. There is a select statement in the program which selects all the plants entered. If it is single plant entry and the user is not authorised or the user is not authorised to none of the plants entered for multiple plant entries, an error message should be displayed saying "no authority to display plants x, y, z"
How can I incorporate this logic in the report.
This the current coding
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'C_ROUT'
ID 'ACTVT' FIELD '03'
ID 'PLNTY' FIELD 'DUMMY'
ID 'WERKS' FIELD s_werks
ID 'STATU' FIELD 'DUMMY'
ID 'VERWE' FIELD 'DUMMY'.
START-OF-SELECTION.
SELECT amatnr aplnnr aplnal awerks aplnty bstlnr b~stlal INTO TABLE t_mapl FROM mapl AS a INNER JOIN mast AS b
ON amatnr = bmatnr
AND awerks = bwerks
WHERE a~matnr IN s_matnr
AND a~plnnr IN s_plnnr
AND a~plnal IN s_plnal
AND a~werks IN s_werks
AND a~plnty IN s_plnty
AND b~stlnr IN s_stlnr
AND b~stlal IN s_stlal. "(ALT BOM)
Thanks
RickyHi Ricky,
to check each individual plant in the selection, you can not use s_plant in the authority chek, here you need to give the value..
Code like this:
DATA : BEGIN of t_werks OCCURS 0,
werks TYPE t001w-werks,
END OF t_werks.
DATA : w_text(30) TYPE c.
AT SELECTION-SCREEN.
IF NOT s_werks[] IS INITIAL.
REFRESH t_werks.
SELECT werks
FROM t001w
INTO TABLE t_werks
WHERE werks IN s_werks.
IF sy-subrc EQ 0.
LOOP AT t_werks.
AUTHORITY CHECK...
ID 'WERKS' FIELD t_werks-werks.
IF sy-subrc EQ 0.
DELETE t_werks.
ENDIF.
ENDLOOP.
IF NOT t_werks[] IS INITIAL.
LOOP AT t_werks.
CONCATENATE t_werks-werks
w_text
INTO w_text.
ENDLOOP.
MESSAGE exxx WITH 'No authorisation for '
w_text.
ENDIF.
ENDIF.
ENDIF.
Thanks and Best Regards,
Vikas Bittera.
**Reward if useful** -
Abap programe 'AUTHORIZATION-CHECK'
What is abap programe 'AUTHORIZATION-CHECK' how can i navigate there
Hi,
You can navigate to the Code this way
1)
SE93> Display>Double click in the Entry corresponding to Program-->then you enter the Source Code here select find and give the search string as
"Authority-Check" this displays you whatever entries are there in the code.
This method is useful if you know the Tcode and want to see what check statemetns are there in ABAP code corresponding to it.
2)On the other hand if you know the program then go to
SE38> enter the program name> Select Source Code> Press Display>
and from there search with the string mentioned above justlike the case mentioned above...
Hope this helps
Regards,
Manohar -
ABAP programming extended Check
Hi
Why do we do ABAP program Extended Check?
Thank Youit is necessary for Complete check of the ABAP source text for all statically recognizable errors.Programs with errors in the extended program check can be executed, but usually result in an exceeption.
http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801afd454211d189710000e8322d00/content.htm
Error situation during execution of an ABAP program. Exceptions are treatable (statements TRY, CATCH) or untreatable.
Untreated exceptions result in a runtime error. An exception is triggered either by the ABAP runtime environment due to error situations that are not foreseeable by the static program check, or by the RAISE EXCEPTION statement. -
Authentication or Security Checks for ABAP programs
Dear experts,
Please tell me where do we give the authentication or security checks to our ABAP programs and how do we do that. ( Do not allow all to execute our developed programs).
Regards,
MaanasaIf you know the authorization group u can use the following ways.
1. In the Attributes u can specify the authorization gourp name
2. AT SELECTION-SCREEN
AUTHORITY-CHECK OBJECT 'Z_TABU_DIS'
ID 'ACTVT' FIELD '03'
ID 'CUSTTYPE' FIELD v_class
ID 'TABLENAME' FIELD p_dbtble.
CASE SY-SUBRC.
WHEN 0.
WHEN OTHERS.
Error message
message I419(MO).
STOP.
ENDCASE. -
Getting errors while conversion of ABAP program into Unicode check
Hi,
I changed the one ABAP program for some requirement and try to save it, it is giving error that the program is not unicode compatible.I set the unicode checks active box under Attributes and again activate it .It is not allowing to concatenate the two variables which is declared as follows :
constants: c_tab type x value '09', "tab character
c_cr type x value '0D'. "carriage return character
I tried to use field symbols but still giving error (code after change)
constants: c_tab type x value '09', "tab character
c_cr type x value '0D'. "carriage return character
field-symbols : <f_c_tab> type any,
<f_c_cr> type any.
Assign c_tab to <f_c_tab> CASTING type c.
Assign c_cr to <f_c_cr> CASTING type c.
error :The length of "C_TAB" in bytes must be a multiple of the size of a Unicode character (regardless of the size of the Unicode character).
pls guide me so that I can cancatenate the c_tab and c_cr variablesHi,
Tab Character ----->Data: tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
Carraige Return---->Data : cr(2) type c value cl_abap_char_utilities=>cr_lf..
You will not be able to use the concatenate statement for hexadecimal variables in unciode system.
Try using the above equivalent character variables. In unicode system avoid using hexadecimal variables wherever possible
Regards,
lakshman. -
How to check frequency of ABAP program usage
Dear Experts,
How to find out the frequency of ABAP programs executed by users? the reason is because we want to do a housekeeping on all the ABAP reports that we have developed over the years, we want to deactivate those reports that are no longer executed by the user within 1 year. Anyone can give suggestion?
I already tried using SM36, but this is only for those programs scheduled in background or immediate, how about those programs running on foreground?Hello,
You can use the trxn SM20N. But bear in mind some prior config needs to be in place for the logging to be active (trxn SM19).
For further details on SM20 read this: [Security Audit Log|http://help.sap.com/SAPhelp_nw70/helpdata/en/2c/c59d37d373243de10000009b38f8cf/frameset.htm]
@Sap Fan: STAD can be used in case the audit log is not available (e.g., due to missing config) but afaik there is a limitation on the date range you can provide.
BR,
Suhas
Edited by: Suhas Saha on Sep 7, 2010 9:39 AM -
How to read a word in a abap program for syntax check
program for finding keywords:
into a given program name in selection screen.
e.g Parameters Keyword in YXABC propgram.
How to find a word in a abap program for syntax checkHi!
Read table TNAPR for the program names.
Then use the READ REPORT statement for it and load the program into an internal table.
Then loop at the table.
Regards
Tamá -
How to check if ABAP program is running in another instance?
Hey Guys,
I need to ensure that a given ABAP program is only running in one instance.
Here is what I tried so far:
1) FM TH_WPINFO
The problem with this is that the Z (custom) program calls lot of SAP function modules and when inside those, the WP_REPORT field of WPLIST table has something else and not the Z program name.
2) FM ENQUEUE_ESINDX
When I used the code below the following happened:
-The First instance runs fine
-The Second instance fails in the locking and exits the way it is supposed to but then
-If I run the program the Third time, it runs with a succesful lock - probably because the after second instance the lock was cleared???
CALL FUNCTION 'ENQUEUE_ESINDX'
EXPORTING
MODE_INDX = 'E'
MANDT = SY-MANDT
RELID = 'ZZ'
SRTFD = PROGRAM
* SRTF2 =
* X_RELID = ' '
* X_SRTFD = ' '
* X_SRTF2 = ' '
* _SCOPE = '2'
* _WAIT = ' '
* _COLLECT = ' '
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
Any other idea, how I could accomplish this?
Thanks a lot,
Viktor-----> Include this perform in Initalization or in Start-of-Selection screen event.
*& Form LOCK_CURRENT_INSTANCE
* Perform to lock the current instance of the
* program, so that only one
* instance can be runned at a given time.
FORM lock_current_instance .
*---FM to lock the current instance of the program
CALL FUNCTION 'ENQUEUE_E_TRDIR'
EXPORTING
mode_trdir = abap_true
name = sy-repid
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
IF sy-batch = abap_true.
MESSAGE e016 WITH 'Already one Instance of the Program is Running'.
ELSE.
MESSAGE s016 WITH 'Already one Instance of the Program is Running' DISPLAY LIKE 'E' .
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
ENDFORM. " LOCK_CURRENT_INSTANCE
---->and include this perform as a last perform in End-of-Selection screen event.
*& Form UNLOCK_CURRENT_INSTANCE
* This perform is used to unlock the instance of the
* running program
FORM unlock_current_instance .
*---FM to release the lock on the running program
CALL FUNCTION 'DEQUEUE_E_TRDIR'
EXPORTING
mode_trdir = abap_true
name = sy-repid.
ENDFORM. " UNLOCK_CURRENT_INSTANCE -
How to copy/download all ABAP programs in a text with a single report ?
How to copy/download all ABAP programs in a text format with a single report/TC ?
How to copy/download ABAP source code with all include programs ?....
we need to search & copy all include programs everytime....Hi,
check this link
downloading programs
Regards -
Triggering Event in BW through a ABAP Program in R/3
Hello Friends,
I am working on triggering a process chain in BW using ABAP program in R/3.
1. I have created a test process-chain in BW which sends test email upon running. This process chain is triggered by an event "Z_START_PC".
2. I created a function module "ZBW_EVENT_RAISE" which triggers this event.
( This function module is "remote enabled module")
3. I tested running the process chain, with function-module (SE37), which works fine.
( i.e. I do receive test-email after..)
4. Now I created a ABAP program "ZBW_EVENT_RAISE" in R/3.
The code of which is as follows:
REPORT ZBW_EVENT_RAISE.
parameters: rfcdest like t000-logsys.
parameters: bwevent like tbtco-eventid.
call function 'ZBW_EVENT_RAISE'
destination rfcdest
exporting
eventid = bwevent.
5. When I try to run this ABAP program in R/3 (SE38),
The process chain does not get triggered.
(a) The "<b>rfcdest</b>" i got from SM59 - RFC Destinations -
R/3 Connections - BW Development Server Client
Value is "BWDCLNT999".
How do I go about debugging this issue? I know for sure, the BW- function module -- to Trigger -- to Process-chain is working fine. Only part is R/3 to B/W function module starting.
Any help is appreciated.
I promise to award points.
Thanks
PKin ST05 there is an option for RFC trace. Not sure how much detail that will give you but you can try.
It is possible that your userid doesn't have an RFC call authorization in R/3. Do a SU53 immediately after running the program.
Also, replace the FM with any other FM that you know for sure runs (eg some BAPI FM) and run it - either in SE37 in R/3 with RFC destination for BW, or, from your code itself and see if that works (you can check return code).
Maybe you are looking for
-
Multiple Ipod users on same computer?
I have 3 children with their own IPODs. How do I create 3 separate Itunes libraries so that each child's ipod can download only their own music.
-
ITS applications do not close sessions
Hi all, we have ITS based version of ESS, as well as one BSP application, all integrated in EP 6.2. The problem is that applications do not close sessions, as it is pretty visible e.g. in transaction SM04. I checked the setting of ~disconnectOnClose=
-
Why Apex Page is not picking up parameter
Hi, I am passing a parameter from page 1 'P1_Name' to page 2 'P2_name'. However page 2 never picks up the parameter value. I checked the spelling and everything. Please help. "Set these items: " P2_NAME "With these values: "\&P1_NAME.\ Thanks.
-
Preview quits unexpectedly with "search" function
Unbelievable. Search in Preview app is permitted only if View Menu (lateral bar) is "Thumbnails" (VS "Content Only"), otherwise the app quits unexpectedly. But not with all queries :/ Uhm...is that possible?
-
I have a event with missing file errors displayed. I also have the original file but it errors on Relink Files. 'The original file and new file have no shared media range.' I am 100% sure I have a copy of the original file. I imported the 'copy' into