Google Search - Blog...........

SAP ABAP - Convert Dump Into An Error Message

Generally if any exception occurred it will go to dump immediately in a program, then we will process this through the tcode ST22(dump analysis).

Here I am trying to convert this dump into an error message or some text statement.
For this you need to call this statement...

RECEIVE RESULTS FROM FUNCTION 'function module'

Check this example program....

REPORT ztests.

PARAMETERS:p_file LIKE rlgrap-filename .

DATA: v_file TYPE string.

DATA: BEGIN OF itab OCCURS 0,
name(23) TYPE c,
END OF itab.

DATA: errormessage TYPE char50.

v_file = p_file.

CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_file
filetype = 'ASC'
has_field_separator = ' '
TABLES
data_tab = itab.


RECEIVE RESULTS FROM FUNCTION 'GUI_UPLOAD'
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17 .
.
CASE sy-subrc.
WHEN 0.
errormessage = 'Data Loaded'.
WHEN 1.
errormessage = 'FILE_OPEN_ERROR'.
WHEN 2.
errormessage = 'FILE_READ_ERROR'.
WHEN 3.
errormessage = 'NO_BATCH'.
WHEN 4.
errormessage = 'GUI_REFUSE_FILETRANSFER'.
WHEN 5.
errormessage = 'INVALID_TYPE'.
WHEN 6.
errormessage = 'NO_AUTHORITY'.
WHEN 7.
errormessage = 'UNKNOWN_ERROR'.
WHEN 8.
errormessage = 'BAD_DATA_FORMAT'.
WHEN 9.
errormessage = 'HEADER_NOT_ALLOWED'.
WHEN 10.
errormessage = 'SEPARATOR_NOT_ALLOWED'.
WHEN 11.
errormessage = 'HEADER_TOO_LONG'.
WHEN 12.
errormessage = 'UNKNOWN_DP_ERROR'.
WHEN 13.
errormessage = 'ACCESS_DENIED'.
WHEN 14.
errormessage = 'DP_OUT_OF_MEMORY'.
WHEN 15.
errormessage = 'DISK_FULL'.
WHEN 16.
errormessage = 'DP_TIMEOUT'.
WHEN 17.
errormessage = 'OTHERS'.
ENDCASE.

MESSAGE e000(00) WITH errormessage .


With this in the report program we will get an error message instead of a dump when the exception raised.


RETURN TO MAIN INDEX:

- Sample Programs On Uploading & Downloading Files.

- Sample Programs On HR ABAP.

- Sample Report Programs On ALV List/ Grid Display.

- Sample Programs On Selection Screen.

- Sample Programs On BDC.

.....Back To MAIN INDEX.

ABAP - Creating An HR Infotype Step By Step.

Creating Organization Management Info types

Check the non-existence of the info type

1. Check first whether they is any info type with the given number in the tables T582A and T777D. If there is no entry with the given number then you need to create the info type with this number.


2. Go to SE11 and create a data type with the prefix HRI...like HRI9334(example)

Choose create--->structure

Fill the fields of type or any that you want to add --->save and activate it.
(there may be some warnings ignore warnings if you did not follow standards for naming convention ).



3. Go to transaction code PPCI .
Enter the info type number: 9334
and name : test infotype org man
choose create---> (f5)

It will display the screen like this..

Choose create then it will ask for you to create info type with a pop up menu .

Choose YES to create, it will show an information message that the info type was created.


4. Go to transaction code SM30---> give the table name T777I.....choose--> maintain

Select the info type that you created and double click on the time constatint

Then choose new entries...fill the values like this....

1. Object type must be * to allow all the object types.
Some of the objects are given below.
O--> Organizational unit
S--> Position
P--> Person
C--> Job
I1--> Personnel subarea
I2--> Employee subgroup
I3--> Employee group
IA--> Company
IC--> Company code

2. info type 9334

3.time constraint 1( may be you can give other values from 0 to 3 )
0---> may only exist once
1---> without gaps
2---> with gaps
3---> as often as required

Save it under a transport request

Then click on the info types per object type---->new entries

1. Object type: O ( for Organization)
2. Info type :9334

Then save it .


5. Go to PO10 transaction--->Select the info type you created. Give any organization unit which is existing in the current plan. You can choose the entries from the f4 help

Choose create--->

and Save it.


6. Check whether data is available in the info type HRP9334 or not.



ALSO READ:

- Creating HR Report Category In PNP Logical Database.

- Fetching The Entry Or Joining Date For Employees.

- Fetching HR Data In Different Ways.

- Get Managers List For All The Organization Units.

- Get Employees List Working Under An Organization Unit.

.....Back To Sub-Index On HR ABAP.

.....Back To MAIN INDEX.