Logic in ABAP HR
Hi folks,
Actually my requirement is, i have some data in an internal table. I have to check the particular record in in that itab is there in infotype 9003 by checking some condtions. if the record is not found in the 9003 i need to display a error message. I am new to ABAP HR. Please help me regarding the logic of comparing ITAB and an infotype in my requirement here.
Thanks,
Ram.
Create a program
In program attributes
Put PNP for the Logical Database field
Save it
You will have PNP's standard selection screen
If you dont want selection screen from PNP,
In program attributes Choose HR REPORT CATEGORY
Create one with no fields for selection
tables: pernr
infotypes: 0000, 0001, 0002, 0006, 9003
start-of-selection.
get pernr.
loop at table p9003.
endloop.
all values of 9003 will be in internal table p9003
If you have Personnel number in your internal table itab then the easier code without PNP Logical database is
loop at itab.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
* TCLAS = 'A'
pernr = itab-pernr
infty = 9003
BEGDA = '18000101'
ENDDA = '99991231'
IMPORTING
SUBRC = subrc
tables
infty_tab = it9003
EXCEPTIONS
INFTY_NOT_FOUND = 1
OTHERS = 2
IF sy-subrc = 0.
** Do the processing you want to do
ENDIF.
endloop.
Reward points if helpful
Similar Messages
-
MD5sum Checksum Logic in ABAP interface
Hi All..
I am Pavan, ABAP Consultant from Bangalore, India....
How to incorporate MD5sum checksum logic in ABAP interface...???
FYI, MD5sum is a checksum tool available in the web. This tool will generate a unique No' for each flatfile downloaded from SAP via extracts..
When i send the same flat file to my client, they will validate the checksum again.. Once it is validated, then it will be confirmed that data is not tampered... Otherwise, client will reject the file..
This is a mandatory process for my client, since they are working as per SOXa standards... (Sarbanes - Oxley Controls & Process)
Please help me, if any one of you have the information regarding this ..
Thanks in Advance......
Regards
Pavan Sanganal
Bangalore, India
Email : [email protected]Hi,
assuming you have the content in the well known table
sdokcntbins, the following snippet may became useful:
DATA:
input_length TYPE i,
hash TYPE hash160,
data TYPE xstring.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = input_length
IMPORTING
buffer = data
TABLES
binary_tab = p_file_content_binary.
CALL FUNCTION 'CALCULATE_HASH_FOR_RAW'
EXPORTING
alg = 'MD5'
data = data
IMPORTING
hash = hash.
Best regards,
Stefan -
Hello,
I want to convert following logic in ABAP.
if i_out-belnr is between 90000000 and 99999999.
endif.You can do this...
data: r_belnr type range of belnr,
wa_belnr like line of r_belnr.
data: belnr type belnr.
wa_belnr-low = '90000000'.
wa_belnr-high = '99999999'.
wa_belnr-sign = 'I'.
wa_belnr-option = 'BT'.
append wa_belnr to r_belnr.
if i_out-belnr in r_belnr.
endif. -
Logical difference ABAP InputScript
Hi,
What is the logical difference between a "Call transaction using..." in ABAP and an InputScript?
Thanks,
Govindappa.Hi,
There are 2 main differences between ABAP call transaction and InputScript:
- The InputScript remains active while you process the transaction.
In particular, you can read all screen values and make decisions based on these values.
When you implement a Call Transaction in ABAP, you have to deliver all input data in advance.
- GuiXT offers a number of built-in features. For example, GuiXT will automatically display those popup screens that you do not handle in your InputScript, so that the user can continue, even in a situation that you did not anticipate.
Reward Points if found helpfull..
Cheers,
Chandra Sekhar. -
Hi,
am very new to abap , i have the logic of Prime number in c language , i want to do it in ABAP ,
so kindly help me .
thanks,
SudhakarREPORT ztest1 .
PARAMETERS: p_from TYPE i,
p_to TYPE i.
DATA: v_from TYPE i,
v_to TYPE i,
v_remainder TYPE i,
v_is_prime TYPE c,
v_divisor TYPE i.
START-OF-SELECTION.
v_from = p_from.
v_to = p_to.
DO.
IF v_from = v_to.
EXIT.
ENDIF.
CLEAR v_is_prime.
DO v_from TIMES.
v_divisor = sy-index.
v_remainder = v_from MOD v_divisor.
IF v_divisor <> 1 AND
v_divisor <> v_from AND
v_remainder = 0.
*-- not a prime
v_is_prime = 'N'.
EXIT.
ENDIF.
ENDDO.
IF v_is_prime IS INITIAL.
*-- the number is prime
WRITE:/ v_from, 'is a prime number'.
ENDIF.
v_from = v_from + 1.
ENDDO. -
Help in writing logic to abaper for printing contact details from partnr fn
Hi friends,
I have to give the logic to the abaper to print the contact details of one partner which is manually entered in the quotation at header level.
i have a partner z1 with partner type PE which is manually entered in the partner fn field at the header level. this z1 partner fn is an employee. The name and contact details of this employee needs to be printed in the header of the output.
What is the logic i need to give to abaper for this.
Regards,
AnandHi Anand,
In case you do not find an ADRNR for the respective partner funtion in VBPA table, then, it means that the employee number derived from customer master is correct. Then, I think you can take KUNNR number for the employee partner function thro' VBPA and put the same in KNA1 table to get the right ADRNR. (As explained by me in the first post).
My question now is, are you maintaining the employee in XD01 (customer) or in VPE1 (Sales Rep)?
You can try with tables PA0002 Personal Data and PA0006 Addresses only if you maintain employees thro' VPE1 Tcode. PA0006 has PERNR field. But, what you have to make sure is that the table is getting updated. Else, you may not find the data here as well.
Hope this helps...
Thanks
Mukund S -
HR - Supress Error messages at end of PNP Logical dB ABAP
It appears from the code for logical dB PNP that you can turn off the error messages that automatically print at the end of the program, but I don't see how to do it. Here's the SAP code in include DBPNPI01:
FORM end-processing.
CHECK sw_supress_write EQ no.
Can anyone tell me how to 'change' sw_supress_write?Try this code:
DATA:
BEGIN OF t_empty OCCURS 50,
pernr LIKE pernr-pernr,
END OF t_empty.
DATA:
temp1 TYPE i,
temp2 TYPE i,
temp3 TYPE i.
NODES: pernr.
START-OF-SELECTION.
PERFORM pnp_skipped_pernr(sapdbpnp)
TABLES t_empty
USING 'Y'
CHANGING temp1 temp2 temp3.
GET pernr.
* Do something here.
*FORM pnp_skipped_pernr
* TABLES locked_pernr_tab LIKE locked[] "out
* USING supress_reject_info LIKE sw_supress_write"in
* CHANGING auth_skipped_count LIKE auth-skip-count "out
* locked_skipped_count LIKE locked_pernr_count"out
* locked_occurs_param LIKE locked_ocp. "out
* locked_pernr_tab[] = locked[].
* sw_supress_write = supress_reject_info.
* auth_skipped_count = auth-skip-count.
* locked_skipped_count = locked_pernr_count.
* locked_occurs_param = locked_ocp.
*ENDFORM. "pnp_skipped_pern
Let us know how it goes. -
Hi
I have a requirement that employee can display,edit,view and confirm his personel data i.e first name,last name.dob etc.
Requirement is:
need 4 tabs :1 for display data,1 for edit, 1 for review and 1 for confirm.
here using bapis for getting data and to change data.
Need help that what's the infotypes,tables involved here and what's the exact logic.
Points are assured for correct answers.
Regards,
SreeHi Sreeram,
Employee personal data is held in infotype number 0002.
The database table @ the back end is PA0002.
However in HR you do not update infotypes via direct DB update, rather we have function modules for the same:
Display Data (extracting personal data from infotype 0002) use function module HR_READ_INFOTYPE
Update Data into infotype 0002 for a employee use function module HR_INFOTYPE_OPERATION.
Cheers,
Aditya -
Please help me think about logic in abap program
Hello every one.
i have question.
my selection of program is
company code
brand from: to:
fiscal year
period from: to:
example.
company code 0145
brand from:AAA to: ZZZ
fiscal year 2011
period from: 4 to: 6
and desired output report is
brand AAA April May June
sale 700 600 700
COG 300 250 350
Net sale 400 350 250
brand BBB April May June
sale 1000 500 800
COG 500 250 400
Net sale 500 250 400
sum of all brand April May June
sale 1700 1100 1500
COG 800 500 750
Net sale 900 600 650
pleae help me to think about logic.
now i just have idea that i have to
loop at internal_table_brand.
Moderator Message: Do not dump your spec in the forum.
Edited by: Suhas Saha on Jun 16, 2011 4:16 PMHi,
This works now. You just need to create your methods and link them in with your case statement as flounder showed you.
import java.util.Scanner;
public class CarConfiguration
public static void main(String[] args)
int choise = Menu();
processSelector(choise);
private static int Menu()
System.out.println("\nWELCOME TO CAR CONFIGURATION APPLICATION PROGRAM");
System.out.println("======================================");
System.out.println(" Enter _1_ to Chasis Type");
System.out.println(" Enter _2_ to Engine Type");
System.out.println(" Enter _3_ to Transmission");
System.out.println(" Enter _4_ to Options ");
System.out.println(" Enter _5_ to Finish ");
System.out.println("======================================");
System.out.print("Select Your Choise: ");
Scanner input=new Scanner(System.in);
int choise=input.nextInt();
return(choise);
private static void processSelector(int choise)
switch(choise)
case 1: //enter mehtods here and for all other empty cases
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
default:
System.out.println("Invalid selection");
break;
} -
hi all
i hav internal table call it_itab1 so there has som several equal record. so i want to get yhe som of all equal item. i can shaw u to so example.
it_itab1 table
code item value
001 4k 120
001 4k 100
001 4k 80
002 5h 200
002 5h 100
003 6y 500
003 6y 400
i ant to get som of each equl feild
code item value
001 4k 300
002 5h 300
003 6y 900
i think u can understand wot me want.. i want to sum of each equal feild value...(001 4k =(12010080) ... this is my requrement so how should i write the code. if u can please help me...
regard
nawaHi
U can do it using COLLECT
Basic form
COLLECT [wa INTO] itab.
Addition: ... SORTED BY f
In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Short forms of line operations not allowed.
Effect
COLLECT allows you to create unique or summarized datasets. The system first tries to find a table entry corresponding to the table key (see Key definition for internal tables ). The key values are taken either from the header line of the internal table itab, or from the explicitly-specified work area wa. itab must have a flat structure, that is, it may not contain other internal tables. All components that are not part of the key must be have numeric types (see ABAP numeric types).
If the system finds an entry, the numeric fields that are not part of the table key (see ABAP number types) are added to the sum total of the existing entries. If it does not find an entry, the system creates a new entry instead.
The way in which the system finds the entries depends on the type of the internal table:
STANDARD TABLE:
The system creates a temporary hash administration for the table to find the entries. This means that the runtime required to find them does not depend on the number of table entries. The administration is temporary, since it is invalidated by operations like DELETE, INSERT, MODIFY, or SORT. A subsequent COLLECT is then no longer independent of the table size, because the system has to use a linear search to find entries. For this reason, you should only use COLLECT to fill standard tables.
SORTED TABLE:
The system uses a binary search to find the entries. There is a logarithmic relationship between the number of table entries and the search time.
HASHED TABLE:
The system uses the internal hash administration of the table to find records. Since (unlike standard tables), this remains intact even after table modification operations, the search time is always independent of the number of table entries.
For standard tables and SORTED TABLEs, the system field SY-TABIX contains the number of the existing or newly-added table entry after the APPEND. With HASHED TABLEs, SY-TABIX is set to 0.
Notes
COLLECT allows you to create a unique or summarized dataset, and you should only use it when this is necessary. If neither of these characteristics are required, or where the nature of the table in the application means that it is impossible for duplicate entries to occur, you should use INSERT [wa INTO] TABLE itab instead of COLLECT. If you do need the table to be unique or summarized, COLLECT is the most efficient way to achieve it.
If you use COLLECT with a work area, the work area must be compatible with the line type of the internal table.
If you edit a standard table using COLLECT, you should only use the COLLECT or MODIFY ... TRANSPORTING f1 f2 ... statements (where none of f1, f2, ... may be in the key) enthalten sein). Only then can you be sure that:
-The internal table actually is unique or summarized
-COLLECT runs efficiently. The check whether the dataset
already contains an entry with the same key has a constant
search time (hash procedure).
If you use any other table modification statements, the check for entries in the dataset with the same key can only run using a linear search (and will accordingly take longer). You can use the function module ABL_TABLE_HASH_STATE to test whether the COLLECT has a constant or linear search time for a given standard table.
Example
Summarized sales figures by company:
TYPES: BEGIN OF COMPANY,
NAME(20) TYPE C,
SALES TYPE I,
END OF COMPANY.
DATA: COMP TYPE COMPANY,
COMPTAB TYPE HASHED TABLE OF COMPANY
WITH UNIQUE KEY NAME.
COMP-NAME = 'Duck'. COMP-SALES = 10. COLLECT COMP INTO COMPTAB.
COMP-NAME = 'Tiger'. COMP-SALES = 20. COLLECT COMP INTO COMPTAB.
COMP-NAME = 'Duck'. COMP-SALES = 30. COLLECT COMP INTO COMPTAB.
Table COMPTAB now has the following contents:
NAME | SALES
Duck | 40
Tiger | 20
Addition
... SORTED BY f
Effect
COLLECT ... SORTED BY f is obsolete, and should no longer be used. It only applies to standard tables, and has the same function as APPEND ... SORTED BY f, which you should use instead. (See also obsolete statements.)
Note
Performance:
Avoid unnecessary assignments to the header line when using internal tables with a header line. Whenever possible, use statements that have an explicit work area.
For example, "APPEND wa TO itab." is approximately twice as fast as "itab = wa. APPEND itab.". The same applies to COLLECT and INSERT.
The runtime of a COLLECT increases with the width of the table key and the number of numeric fields whose contents are summated.
Note
Runtime errors:
COLLECT_OVERFLOW: Overflow in an integer field during addition
COLLECT_OVERFLOW_TYPE_P: Overflow in a type P field during addition.
TABLE_COLLECT_CHAR_IN_FUNCTION: COLLECT on a non-numeric field.
Regards,
Prasanth
Reward all helpful answers -
Steps to create LOGICAL DATABASE in sap
hi guys,
i have gone through many documents about LDB. But, i didnt get the steps to create a LDB.
plz provide me with the steps to be followed to create a LDB.
thnx,
shivaa.Hi Shiva,
This might help you!
Logical database structures
There are three defining entities in an SAP logical database. You must be clear on all three in order to create and use one.
Table structure: Your logical database includes data from specified tables in SAP. There is a hierarchy among these tables defined by their foreign keys (all known to SAP), and you are going to define a customized relationship between select tables. This structure is unique and must be defined and saved.
Data selection: You may not want or need every item in the referenced tables that contributes to your customized database. There is a selection screen that permits you to pick and choose.
Database access programming: Once youu2019ve defined your logical database, SAP will generate the access subroutines needed to pull the data in the way you want it pulled.
Creating your own logical database
ABAP/4 (Advanced Business Application Programming language, version 4) is the language created by SAP for implementation and customization of its R/3 system. ABAP/4 comes loaded with many predefined logical databases that can construct and table just about any conventional business objects you might need in any canned SAP application. However, you can also create your own logical databases to construct any custom objects you care to define, as your application requires in ABAP/4. Hereu2019s a step-by-step guide:
1. Call up transaction SLDB (or transaction SE36). The path you want is Tools | ABAP Workbench | Development | Programming Environment | Logical Databases. This screen is called Logical Database Builder.
2. Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.
3. Youu2019ll be prompted for a short text description of your new logical database. Enter one. Youu2019ll then be prompted to specify a development class.
4. Now comes the fun part! You must specify a root node, or a parent table, as the basis of your logical database structure. You can now place subsequent tables under the root table as needed to assemble the data object you want. You can access this tree from this point forward, to add additional tables, by selecting that root node and following the path Edit | Node | Create. Once youu2019ve saved the structure you define in this step, the system will generate the programming necessary to access your logical database. The best part is you donu2019t have to write a single line of code.
Watch out!
The use of very large tables will degrade the performance of a logical database, so be aware of that trade-off. Remember that some tables in SAP are very complex, so they will be problematic in any user-defined logical database.
Declaring a logical database
Hereu2019s another surprising feature of logical databases: You do not assign them in your ABAP/4 Code. Instead, the system requires that you specify logical databases as attributes. So when you are creating a report, have your logical database identifier (the name you gave it) on hand when you are defining its attributes on the Program Attributes screen. The Attributes section of the screen (the lower half) will include a Logical database field, where you can declare your logical database.
Logical databases for increasing efficiency
Why else would you want to create a logical database? Consider that the logical databases already available to you begin with a root node and proceed downward from there. If the data object you wish to construct consists of items that are all below the root node, you can use an existing logical database program to extract the data, then trim away what you donu2019t want using SELECT statementsu2014or you can increase the speed of the logical database program considerably by redefining the logical database for your object and starting with a table down in the chain. Either way, youu2019ll eliminate a great deal of overhead.
Reward if useful.
Thankyou,
Regards. -
Regarding Logical database and select statement..
Hi
Experts.
i would like to know the diff b/w logical data base & select statement while using report.
wt is the use of logical databases in R/3. is there any advantage used in the reports.
Thanks & Regards..
Spandana.Dear Spandana,
Go through the below description of LDB. I hope you wil get a fair amount of idea.
SAP comes loaded with all the extras. Among the extras that are most helpful to IT managers are all the access routines needed to pull any business object that managers can think of out of SAP databases. However, SAP has not thought of everything where your particular applications are concerned. SAP organizes its standard database tables to service business units based on conventional business applications. Itu2019s likely your business requires something new, perhaps even something exotic. In that case, you will need to create a new database, using information from different places. Basically, you need a logical database. You need to create a virtual business data object repository consisting of a new kind of record or table that suits your purposes. In addition, the repository should be composed of information that is actually stored in a number of different locations, none of them necessarily logically associated with one another. Letu2019s take a closer look at creating logical databases.
A case for a logical database
Suppose my company manufactures widgets of the most obscure variety, and they are components of other widgets. I sell my widgets as raw material for the more sophisticated widgets built by others, but in some cases I actually partner with other manufacturers in creating yet another class of widget. Now, in my world, I consequently have customers who are also partners. I sell to them and I partner with them in manufacturing and distribution. Also, I need an application that uses both of these dual-use relationships.
Essentially, I have a customer database and a partner database. Neither contains records that are structured to contain the identifying particulars of the other. Thus, I need a hybrid database that gives me tables detailing these hybrid relationships. What can I do? I can go the long way around and write a new database, pulling information from both and creating new objects with a customized program that I write by hand. However, this process is cumbersome and contains maintenance issues. On the other hand, I can use SAPu2019s logical database facility, create my logical database in a couple of minutes, and have no maintenance issues at all.
Logical database structures
There are three defining entities in an SAP logical database. You must be clear on all three in order to create and use one.
u2022 Table structure: Your logical database includes data from specified tables in SAP. There is a hierarchy among these tables defined by their foreign keys (all known to SAP), and you are going to define a customized relationship between select tables. This structure is unique and must be defined and saved.
u2022 Data selection: You may not want or need every item in the referenced tables that contributes to your customized database. There is a selection screen that permits you to pick and choose.
u2022 Database access programming: Once youu2019ve defined your logical database, SAP will generate the access subroutines needed to pull the data in the way you want it pulled.
Creating your own logical database
ABAP/4 (Advanced Business Application Programming language, version 4) is the language created by SAP for implementation and customization of its R/3 system. ABAP/4 comes loaded with many predefined logical databases that can construct and table just about any conventional business objects you might need in any canned SAP application. However, you can also create your own logical databases to construct any custom objects you care to define, as your application requires in ABAP/4. Hereu2019s a step-by-step guide:
1. Call up transaction SLDB (or transaction SE36). The path you want is Tools | ABAP Workbench | Development | Programming Environment | Logical Databases. This screen is called Logical Database Builder.
2. Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.
3. Youu2019ll be prompted for a short text description of your new logical database. Enter one. Youu2019ll then be prompted to specify a development class.
4. Now comes the fun part! You must specify a root node, or a parent table, as the basis of your logical database structure. You can now place subsequent tables under the root table as needed to assemble the data object you want. You can access this tree from this point forward, to add additional tables, by selecting that root node and following the path Edit | Node | Create. Once youu2019ve saved the structure you define in this step, the system will generate the programming necessary to access your logical database. The best part is you donu2019t have to write a single line of code.
Watch out!
The use of very large tables will degrade the performance of a logical database, so be aware of that trade-off. Remember that some tables in SAP are very complex, so they will be problematic in any user-defined logical database.
Declaring a logical database
Hereu2019s another surprising feature of logical databases: You do not assign them in your ABAP/4 Code. Instead, the system requires that you specify logical databases as attributes. So when you are creating a report, have your logical database identifier (the name you gave it) on hand when you are defining its attributes on the Program Attributes screen. The Attributes section of the screen (the lower half) will include a Logical database field, where you can declare your logical database.
Logical databases for increasing efficiency
Why else would you want to create a logical database? Consider that the logical databases already available to you begin with a root node and proceed downward from there. If the data object you wish to construct consists of items that are all below the root node, you can use an existing logical database program to extract the data, then trim away what you donu2019t want using SELECT statementsu2014or you can increase the speed of the logical database program considerably by redefining the logical database for your object and starting with a table down in the chain. Either way, youu2019ll eliminate a great deal of overhead.
Regards
Arindam -
Display HTML code in WebDynpro for ABAP
Hi, I would like to display a html page in a WebDynpro View, ie: I have the html code in a "string" variable and would now display this string now not with the html tags visible, but as a "real" html page.
I found a thread in WebDynpro for ABAP but I am a little bit lost in converting the logic to ABAP world.
Thanks>I found a thread in WebDynpro for ABAP but I am a little bit lost in converting the logic to ABAP world.
I'm a little bit confused by this statement. Do you mean you found a thread in Web Dynpro Java, perhaps?
Regardless the approach is possible using the iFrame UI. The warning about the iFrame is that it is deprecated in NetWeaver 7.0 and 7.01 and my not be usable depending upon your support package level. However in NetWeaver 7.02 the iFrame returns to fully supported status.
If you have the HTML content in a string, you can simply place it into the ICM cache. This will provide a temporary URL for the content (you supply the lifetime of the URL) that can be referenced via the iFrame URL or even the LinkToURL if you want to open in a new window.
Here is the code for placing the string into the ICM Cache:
****Create the cached response object that we will insert our content into
data: cached_response type ref to if_http_response.
create object cached_response
type
cl_http_response
exporting
add_c_msg = 1.
try. " ignore, if compression can not be switched on
call method cached_response->set_compression
exporting
options = cached_response->co_compress_based_on_mime_type
exceptions
others = 1.
catch cx_root.
endtry.
****set the data and the headers
data: l_app_type type string.
cached_response->set_cdata( lv_html_text ).
l_app_type = 'text/html'.
cached_response->set_header_field( name = if_http_header_fields=>content_type
value = l_app_type ).
cached_response->set_status( code = 200 reason = 'OK' ).
cached_response->server_cache_expire_rel( expires_rel = 60 ).
data: guid type guid_32.
call function 'GUID_CREATE'
importing
ev_guid_32 = guid.
concatenate '/sap/public' '/' guid '.' 'html' into lv_iframe_url.
****Cache the URL
cl_http_server=>server_cache_upload( url = lv_iframe_url
response = cached_response ).
wd_context->get_element( )->set_attribute(
name = `IFRAME_URL`
value = lv_iframe_url ). -
Throw statement equivalent in ABAP Objects
Hi All,
I am trying to raise an exception and use a throw statement after catch inside try endtry in ABAP objects. Later i understood that there is no throw statement defined in ABAP objects. Could anyone help me out to understand the equivalent throw statement in ABAP and how to use in raise exception. I am pasting my code below for reference.
try.
CATCH Zxx_EXCEPTION into err.
write:/ err->local_text.
message err->LOCAL_TEXT type 'I'.
if err->local_text = ZIF_XXXX~BUSOBJLOCKED.
throw CX_AI_APPLICATION_FAULT.
endtry.
Thanks
DenoHello Deno
The TRY/CATCH logic of ABAP-OO is pretty much the same like in Java. Instead of throwing exception we have to raise them.
Method execute somewhere raise an exception of class zcx_myexception.
method execute.
if ( condition = abap_true ).
else.
RAISE EXCEPTION TYPE zcx_myexception
EXPORTING
textid = ...
<parameter> = ...
endif.
endmethod.
TRY.
call method go->execute( ).
CATCH zcx_myexception INTO lo_error.
* Do error handling
ENDTRY.
If the method that calls go->execute does not surround the method call by TRY/CATCH then it must define the exception class in its interface and, thereby, propagate the exception to the next higher level calling method.
Regards
Uwe -
Urgent: ABAP Custom Process Types
Hi Gurus,
I have created a Custom Process Type for ABAP program which returns status (Success or Failure).
I followed the below procedure to create a custom ABAP process type.
In RSPC, I went to Settings -> Maintain process types
I selected the ABAP process type and then selected the EDIT -> COPY AS and then in the process chain configuration screen, I gave a new name to the process type, changed the POSSIBLE EVENTS settings to "2 process ends "successful" or "failure" and saved the settings to confirm changes.
Now I can see the new process type for ABAP program which returns the success or failure for the successors.
Now, my question is, where do i write the logic for ABAP program ? how does the ABAP program returns the success or failure. Do I have to change the code in the method IF_RSPC_EXECUTE~EXECUTE to return success or failure. Please make me clear where I can write the code? For example in my ABAP program, I am searching a table to find a specific value. If the value is not found, then the ABAP process type should return failure, if found should return success. How can I do this?
Thanks in advance,
Regards,
aarthi
[email protected]To trigger a process chain from an external program you can use the function:
RSPC_API_CHAIN_START
you need only to know the Chain ID and pass it in import parameter.
Here an example:
select-options v_time for sy-uzeit.
parameter: chain type RSPC_CHAIN.
check sy-uzeit in v_time.
CALL FUNCTION 'RSPC_API_CHAIN_START'
EXPORTING
i_chain = chain
I_T_VARIABLES =
I_SYNCHRONOUS =
I_SIMULATE =
I_NOPLAN =
IMPORTING
E_LOGID =
EXCEPTIONS
FAILED = 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.
Regards,
Sergio
Maybe you are looking for
-
White lines around PNGs when exported to PDF
I am having the problem that imported images frequently have white bars around the outside of the image when the document is exported as a PDF. Looking at the two images currently affected I notice they are both PNG images. I fixed the image that was
-
Libumem : invalid or corrupted buffer
Hello all, when the libumem is enabled, and the application is run the process is coring with the following statement : free(2c0a008): invalid or corrupted buffer stack trace: libumem.so.1'?? (0xff3799b4) libCrun.so.1'__1c2k6Fpv_v_+0x4 libhlri_hdm_lo
-
Hello Everyone, I have scheduled a job for alert generation in RAR periodically every 1 day and after the job is completed successfully. I want to get the report for Action Usage for Users it is giving me data upto September 2010, and nothing after t
-
Continual problems with lack of Mac compatability.
I am a true Mac lover and really have no desire to ever go back to a windows based system but I have problems accessing some websites using safari as my browser. Are there other web browsers that are mac compatibile that might offer me more luck. Spe
-
Aligning data blocks relative to disk sectors
Hi I Have a huge 20GB file that stores a lot of small data structures typically between 200 bytes and 20 kb. There are many millions of these small data blocks that are all stored together in a single file. I can read each data structure from a file