08-12-2015 3:24 PM
Hello ABAPers,
When I was trying to record BDC for VA42 Unit Costing update I ended up getting the following error. (I have used BAPI_CONTRACT_CREATEFROMDATA to create a service contract. However, to update costing, I found that BDC was the only method)
Can anyone suggest on how this can be resolved ?
Following is the program that was generated.
include bdcrecx1.
start-of-selection.
perform open_group.
perform bdc_dynpro using 'SAPMV45A' '0102'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-VBELN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-VBELN'
'71001901'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=PKAL'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSNR(01)'.
perform bdc_field using 'RV45A-VBAP_SELKZ(01)'
'X'.
perform bdc_dynpro using 'SAPLSPO2' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=OPT1'. "Unit Costing
perform bdc_dynpro using 'SAPLKKEA' '1600'.
perform bdc_field using 'BDC_CURSOR'
'RK70_KKEA-KLVAR'.
perform bdc_field using 'BDC_OKCODE'
'=GOON'.
perform bdc_field using 'RK70_KKEA-KLVAR'
'YPC1'. "Costing Variant
perform bdc_dynpro using 'SAPLKKDI' '1301'.
perform bdc_field using 'BDC_CURSOR'
'RK70L-HERK2(01)'.
perform bdc_field using 'BDC_OKCODE'
'=PSEL'.
perform bdc_field using 'RK70E-LST_SETNR'
' 1'.
perform bdc_dynpro using 'SAPLKKDI' '1950'.
perform bdc_field using 'BDC_CURSOR'
'RK70L-TYPPS'.
perform bdc_field using 'BDC_OKCODE'
'=TYPP'.
perform bdc_field using 'RK70L-TYPPS'
'V'.
perform bdc_dynpro using 'SAPLKKDI' '1950'.
perform bdc_field using 'BDC_CURSOR'
'RK70L-KSTAR'.
perform bdc_field using 'BDC_OKCODE'
'=BKDT'.
perform bdc_field using 'RK70L-TYPPS'
'V'.
perform bdc_field using 'RK70L-MENGE'
' 1'.
perform bdc_field using 'RK70L-KSTAR'
'9060200000'.
perform bdc_dynpro using 'SAPLKKDI' '1301'.
perform bdc_field using 'BDC_CURSOR'
'RK70L-TYPPS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=EBCK'.
perform bdc_field using 'RK70E-LST_SETNR'
' 1'.
perform bdc_dynpro using 'SAPLSPO1' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_transaction using 'VA42'.
perform close_group.
Thanks and regards,
Kiran
08-12-2015 3:28 PM
There can be several reason for this. Check it has generated a corresponding dump also from ST22 and check the log of update termination via SM13 and then get back to us with more details.
R
08-12-2015 3:42 PM
Hi Rudra,
Thanks for the reply.
I didn't see any dump in ST22. However, in SM13, I had the following.
Thanks and Regards,
Kiran.
08-12-2015 4:00 PM
When you doubleclick in SM13 on the line do you see any message. Or else switch on the update debugging and debug as Luis Becker has suggested.
R
08-13-2015 6:36 AM
Hi Luis/Rudra,
I tried the update debugger. I noticed that UPDATE CKHS statement in K_UNITCOSTING_POST returns subrc value as 4. This error I am getting even when I'm not using BDC and when I try updating it through VA42 too. This is really strange.
Also if I create a new item and create costing for that item I see that, the item itself wont get saved on the item stack.
Do you know the reason ?
Regards,
Kiran.
08-13-2015 9:40 AM
There may be n number of reasons. It seems it is trying to update CKHS when the key is not present yet in CKHS. Unfortunately you have to debug more to find it out.
08-12-2015 3:38 PM
It seems to be a error in the update function module "K_UNITCOSTING_POST".
You can use external debugger and set an external breakpoint at the beginning of the function, so you can analyse what is going wrong in the update module, after calling the BDC.
Regards
Luis Becker
08-12-2015 3:50 PM
Hi Luis,
I did put the External Breakpoint at the beginning of the FM, but it did not reach there.
Regards,
Kiran
08-12-2015 3:58 PM
Hi Kiran
I think you also need to activate the "Update debugging" option. Please take a look at the following tutorial:
Debugging Update Task and Background Task
Regards
Luis Becker
08-13-2015 10:08 AM
It seems there is some issue related to costing and did you check with FICO Consultant before posting here? If not, check with them and try to find out the root cause of the issue. Meanwhile, you can also have a look at the following notes:-
G. Lakshmipathi
08-14-2015 9:35 AM
Hi Lakshmipathi,
Do you know any methods/FMs/BAPIs that I can use for updating Costing data instead of going for BDC ?
Regards,
Kiran