Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CBIH_IA30_IAL_CREATE

kanthimathikris
Employee
Employee
0 Kudos

Dear experts,

I am using the function module 'CBIH_IA30_IAL_CREATE' to create an incident report; I tried passing most possible values to create the report but the log is not getting created. Can anyone provide me an insight of how to make this happen?

Thanks,

Kanthimathi

6 REPLIES 6

kanthimathikris
Employee
Employee
0 Kudos

Hi, the function module works! I have made a mistake.

Thanks,

0 Kudos

Hi,

I've got the some problem. How do you solve this issue? Actually I got an error message completely like "Internal program error (SAPLCBIH_IA04 SAPLCBIH_IA00 CBIH_IA30_IAL_CREATE 3).

Thanks for your helping in advance.

kanthimathikris
Employee
Employee
0 Kudos

Dear Friends,

I am constantly getting queries related to this func. module and hence thought of posting my solution here.

Here it goes...

TYPE-POOLS : CIHAL.

DATA: L_CREAPI_IAL_TAB TYPE CIHAL_IAL_API_TAB_TYPE

WITH HEADER LINE,

involved_pers type cihal_invpersa_api_tab_type with header line,

INJURIES TYPE cihal_ipevinjapi_tab_type WITH HEADER LINE.

DATA : PERSONAL_DATA TYPE TABLE OF BAPIP0002B WITH HEADER LINE,

v_ia_log_entry LIKE cciht_ial-ialid.

CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'

EXPORTING

LASTNAME_M = LAST_NAME

FSTNAME_M = FIRST_NAME

TABLES

PERSONAL_DATA = PERSONAL_DATA .

READ TABLE PERSONAL_DATA INDEX 1.

CALL FUNCTION 'Z_FORMAT_DATE'

EXPORTING

I_DATE = l_date

IMPORTING

E_DATE = l_date

.

write l_date to L_CREAPI_IAL_TAB-HEAD-EVDAT.

L_CREAPI_IAL_TAB-HEAD-LINEMOD = 'I'.

L_CREAPI_IAL_TAB-HEAD-IATYPE = 'OPE'.

L_CREAPI_IAL_TAB-HEAD-IAPLANT = '1300'.

L_CREAPI_IAL_TAB-HEAD-LOGLOCKMOD = 'X'.

L_CREAPI_IAL_TAB-HEAD-EVDESC = 'ACCIDENT'.

L_CREAPI_IAL_TAB-HEAD-TPLNR = '?0100000000000003162'.

L_CREAPI_IAL_TAB-HEAD-EQUNR = 'F-500-N001'.

L_CREAPI_IAL_TAB-HEAD-MTNLANGU = 'EN'.

*L_CREAPI_IAL_TAB-HEAD-EVDAT = EVENT_DATE.

L_CREAPI_IAL_TAB-HEAD-EVTIME = SY-UZEIT.

L_CREAPI_IAL_TAB-HEAD-ACLOC = 'STAIRS'.

L_CREAPI_IAL_TAB-HEAD-ACLOCDESC = 'ACCIDENT DESC'.

L_CREAPI_IAL_TAB-HEAD-EVTIMEZONE = 'CST'.

L_CREAPI_IAL_TAB-HEAD-IAREPHDFLG = 'X'.

L_CREAPI_IAL_TAB-HEAD-IASTATUS = 'I0439'.

L_CREAPI_IAL_TAB-HEAD-valfr = '00010101'.

L_CREAPI_IAL_TAB-HEAD-VALTO = '99991231'.

L_CREAPI_IAL_TAB-HEAD-CRDAT = sy-datum.

L_CREAPI_IAL_TAB-HEAD-CRNAM = sy-uname.

L_CREAPI_IAL_TAB-HEAD-updDAT = sy-datum.

L_CREAPI_IAL_TAB-HEAD-updNAM = sy-uname.

L_CREAPI_IAL_TAB-HEAD-prodlflg = 'X'.

L_CREAPI_IAL_TAB-HEAD-RECNTWAH = '59197'.

involved_pers-HEAD-LINEMOD = 'I'.

involved_pers-HEAD-IPTYPE = 'INJ'.

involved_pers-HEAD-IPPERS = PERSONAL_DATA-PERNO.

involved_pers-HEAD-IPPERSGRP = 'A'.

involved_pers-AFFPERSDAT-HEAD-LINEMOD = 'I'.

involved_pers-AFFPERSDAT-HEAD-IALPCAT = 'WKT'.

involved_pers-AFFPERSDAT-INJURIES_TAB = INJURIES[].

append involved_pers.

INJURIES-LINEMOD = 'I'.

INJURIES-BODYPART = 'CUST-IHBP02'.

INJURIES-INJURY = 'CUST-IHINJ11'.

APPEND INJURIES.

L_CREAPI_IAL_TAB-invpersons_tab = involved_pers[].

APPEND L_CREAPI_IAL_TAB.

DATA :I_ADDINF LIKE RCGADDINF,

E_FLG_WARNING TYPE ESP1_BOOLEAN,

E_FLG_ERROR TYPE ESP1_BOOLEAN,

E_ERROR_STRUC LIKE RCGEXTERROR,

L_FLG_LOCKFAIL TYPE ESP1_BOOLEAN VALUE space.

I_ADDINF-VALDAt = SY-DATUM.

*

CALL FUNCTION 'CBIH_IA30_IAL_CREATE'

EXPORTING

I_ADDINF = I_ADDINF

I_FLG_HEADER = 'X'

I_FLG_INVPERS = 'X'

I_FLG_INVPERS_LTXT = 'X'

I_FLG_AFFPERS = 'X'

I_FLG_AFF_INTLTXT = 'X'

I_FLG_INJURIES = 'X'

IMPORTING

E_FLG_LOCKFAIL = L_FLG_LOCKFAIL

E_FLG_ERROR = E_FLG_ERROR

E_FLG_WARNING = E_FLG_WARNING

TABLES

X_API_IAL_TAB = L_CREAPI_IAL_TAB

EXCEPTIONS

NO_OBJECT_SPECIFIED = 1

PARAMETER_ERROR = 2

INTERNAL_ERROR = 3

CONVMODE_SET_FAILED = 4

OTHERS = 5.

if sy-subrc eq 0.

CALL FUNCTION 'CBIH_IA30_IAL_SAVE_TO_DB'

.

IF SY-SUBRC = 0.

read table L_CREAPI_IAL_TAB index 1.

select single IALID into v_ia_log_entry

from CCIHT_IAL

where ialid = L_CREAPI_IAL_TAB-head-ialid.

CONCATENATE

'First Report Log Entry number' v_ia_log_entry

'is created.' INTO message SEPARATED BY space .

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

endif.

Regards,

Kanthimathi

0 Kudos

Hi,

Thanks for the prompt reply.

It works, wonderful.

thanks

DS

0 Kudos

Hi Friends

I want to use these Function Modules independently?

So what parameters should I paas?

Regards.

0 Kudos

Hi,

I tried to update the data at IA_VAL_TAB through PROPDATA tab, but I am not sure why it is not working at item level. Can any one provide some inputs on this?

Thanks,

Kumar