cancel
Showing results for 
Search instead for 
Did you mean: 

Need help to create a record in EHFNDD_LOC_RESP table.

0 Kudos
395

Hello all,

Iam able to delete a record from the table person responsible EHFNDD_LOC_RESP.

however i'm unable to create a record.

below is the code im using

FOR DELETE

CALL METHOD /BOBF/CL_TRA_SERV_MGR_FACTORY=>GET_SERVICE_MANAGER
EXPORTING
IV_BO_KEY = IF_EHFND_LOC_C=>SC_BO_KEY

RECEIVING
EO_SERVICE_MANAGER = LO_SERV_MNGR.

CALL METHOD /BOBF/CL_TRA_TRANS_MGR_FACTORY=>GET_TRANSACTION_MANAGER
RECEIVING
EO_TRANSACTION_MANAGER = LO_TXN_MNGR.


LO_SERV_MNGR->QUERY(
EXPORTING

IV_QUERY_KEY =IF_EHFND_LOC_C=>SC_QUERY-RESPONSIBLE-SELECT_BY_ELEMENTS " Query

IV_FILL_DATA = ABAP_TRUE " Data element for domain
IMPORTING
ET_DATA = LT_RESP
ET_KEY = LT_KEY
).

LOOP AT GT_ALV_OUT INTO WA_LOC_ALV WHERE DB_KEY = WA_LOC_ALV-DB_KEY.

CREATE DATA LR_CREATE.
LR_CREATE->PERSON_ID = WA_LOC_ALV-PERSON_ID .
LR_CREATE->KEY = WA_LOC_ALV-DB_KEY .
APPEND INITIAL LINE TO LT_MOD ASSIGNING FIELD-SYMBOL(<LFS_CREATE>).
<LFS_CREATE>-KEY = LR_CREATE->KEY.
<LFS_CREATE>-NODE = IF_EHFND_LOC_C=>SC_NODE-RESPONSIBLE.
<LFS_CREATE>-DATA = LR_CREATE.
<LFS_CREATE>-CHANGE_MODE = 'D'.

LO_SERV_MNGR->MODIFY(
EXPORTING
IT_MODIFICATION = LT_MOD
IMPORTING
EO_CHANGE = LO_CHNG
EO_MESSAGE = LO_MSG
).

LO_TXN_MNGR->SAVE(

IMPORTING
EV_REJECTED = LV_REJ
EO_MESSAGE = LO_MSG_TXN
).
ENDLOOP.

FOR CREATE

CREATE DATA LR_CREATE1.
LR_CREATE1->PERSON_ID = WA_LOC_ALV1-PERSON_ID .

LR_CREATE1->DB_KEY = /BOBF/CL_FRW_FACTORY=>GET_NEW_KEY( ).
LR_CREATE1->PARENT_KEY = LS_LOCREV-DB_KEY .
APPEND INITIAL LINE TO LT_MOD ASSIGNING FIELD-SYMBOL(<LFS_CREATE1>).
<LFS_CREATE1>-KEY = /BOBF/CL_FRW_FACTORY=>GET_NEW_KEY( ).
<LFS_CREATE1>-NODE = IF_EHFND_LOC_C=>SC_NODE-RESPONSIBLE.
<LFS_CREATE1>-NODE = if_ehfnd_loc_c=>sc_association-revision-responsible.
<LFS_CREATE1>-DATA = LR_CREATE1.
<LFS_CREATE1>-CHANGE_MODE = /BOBF/IF_FRW_C=>SC_MODIFY_CREATE.
LO_SERV_MNGR->MODIFY(
EXPORTING
IT_MODIFICATION = LT_MOD
IMPORTING
EO_CHANGE = LO_CHNG
EO_MESSAGE = LO_MSG ).

LO_TXN_MNGR->SAVE(

IMPORTING
EV_REJECTED = LV_REJ
EO_MESSAGE = LO_MSG_TXN
).

KIND REGARDS

Lakshmi


rarunac1
Member
0 Kudos

can you check your permission level?

0 Kudos

yes i'm able to create via portal and also via BOBT transaction however via this code i'm getting dump.

The current application program has detected a situation that should

not occur. A termination with short dump has therefore been triggered

by the key word MESSAGE (type X).

raymond_giuseppi
Active Contributor
0 Kudos

What was the error raised/information provided in the dump (message type X -> ST22)

View Entire Topic
0 Kudos