2010 Aug 25 2:33 AM
Using the following code I'm trying to update a field in the sap database table LIKP. The field I'm trying to update is called vlabdata. Please note I'm using this code in a user exit within the IDOC_INPUT_DELVRY. But its not updating the value in LIKP when I try to see the table in SE16 for that delivery #. What could be the problem?
TABLES likp.
UPDATE likp SET vlabdata = delivery_head-vlabdata where vbeln = delivery_head-vbeln_VL.
Please note:
In debug mode I can see that the values in delivery_head-vlabdata & delivery_head-vbeln_VL are correct.
Thanks in advance,
Risad
Edited by: mrisad on Aug 25, 2010 3:34 AM
Edited by: mrisad on Aug 25, 2010 3:35 AM
Using the following code I'm trying to update a field in the sap database table LIKP. The field I'm trying to update is called vlabdata. Please note I'm using this code in a user exit within the IDOC_INPUT_DELVRY. But its not updating the value in LIKP when I try to see the table in SE16 for that delivery #. What could be the problem?
TABLES likp.
UPDATE likp SET vlabdata = delivery_head-vlabdata where vbeln = delivery_head-vbeln_VL.
Please note:
In debug mode I can see that the values in delivery_head-vlabdata & delivery_head-vbeln_VL are correct.
Thanks in advance,
Risad
Edited by: mrisad on Aug 25, 2010 3:34 AM
Edited by: mrisad on Aug 25, 2010 3:35 AM
2010 Aug 25 3:44 AM
Hello,
Did you use a 'commit work' statement?
Note that it is not advisable to make direct updates on standard tables.
The better option is to search for a BAPI or other function module.
2010 Aug 25 4:08 AM
I've never used a BAPI before but I'm going to look into it right now. But will BAPI's work from user exits?
2010 Aug 25 4:32 AM
I just wanted to double check: can BAPI function modules be called and performed within a user exit? I am programming within a user exit in the function module IDOC_INPUT_DELVRY.
Within a call customer function '002' within IDOC_INPUT_DELVRY.
Am I going to be successfully able to use the BAPI from that user exit?
2010 Aug 25 5:32 AM
Yes Standard BAPI will work in user exit,
try :BAPI_OUTB_DELIVERY_CHANGE
Edited by: pr@t on Aug 25, 2010 10:03 AM
2010 Aug 25 6:41 AM
DEar Risad,
Update statement for STANDARD SAP TABLE is not recommended,
Try to update that filed by using BAPI...
2010 Aug 25 7:20 AM
Guys,
Do you realise that IDOC_INPUT_DELVRY updates LIKP? I don't understand why the OP needs to use BAPI to update LIKP?
@OP: Post your exact business requirement for further inputs.
BR,
Suhas
2010 Aug 25 12:56 PM
@Suhas,
I checked the IDOC_INPUT_DELVRY and I couldn't find a location where likp-vlabdata was being updated. Basically what I need to do is once a DELVRY03 idoc comes in to the system, it needs to grab one value from a specific location from the idoc (which is done) and update likp-vlabdata with that value. When I was going through the function module I personally couldn't find a place where vlabdata was being updated.
@Sachin,
I'm new to abap and sap so I didn't realize that it was a rule of thumb not to try and update the standard tables directly, so I'm looking into BAPI's now.
Thanks,
Risad
2010 Aug 25 1:03 PM
Hello Risad,
I don't find the field VLABDATA in LIKP & LIPS. Is it a custom field added to the table ?
If you debug deep into the IB processing FM you'll find the location where the table LIKP is updated
What i want to say is that you don't have to use BAPI to update this field. In the relevant Exit / BAdI, you can write code to populate the custom fields. SAP will automatically update the table.
BR,
Suhas
2010 Aug 25 1:11 PM
suhas,
It is a custom field I believe. I'm basically working on a client system where there is code (within the IDOC_INPUT_DELVRY) to update not likp-vlabdata but a control record (someone else wrote that code not SAP). I tried to manipulate my user exit so it would be able to use that existing code but it just didn't work. My last option is to just use a BAPI and hope it works.
my question is, if it is a custom field, will bapi work?
Risad
2010 Aug 25 1:17 PM
well the dudes that modified/enhanced the table with the custom field have hopefully updated the BAPI structures as well.
then yes you can use your custom field within the BADI as well.
If not you cant, unless you update the BAPI-structures.
Note, that in some cases this works automatically since sometimes the bapi structures are including the real tables.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |