04-21-2008 8:51 AM
Hi Gurus,
I have a doubt about updating Bseg-hkont (i want to change the account number for a certain situation).
I have the following code:
IF sy-tcode = 'MIGO' OR
sy-tcode = 'MBST' OR
sy-tcode = 'MB01' OR
sy-tcode = 'MB1A' OR
sy-tcode = 'MB1C'.
IF ( lv_bwart = '161' OR
lv_bwart = '162' OR
lv_bwart = '123' OR
lv_bwart = '122' ) AND
bseg-hkont = '3120010000'.
bseg-hkont = '3170010000'.
IF SY-SUBRC EQ 0.
MODIFY BSEG.
IF SY-SUBRC EQ 0.
COMMIT WORK.
endif.
endif.
endif.
Is it possible / reliable to update BSEG-hkont with this code?
In another hand it's better to update this field with a bapi ? which bapi?
Full points if useful !!
Best Regards,
Mário.
04-21-2008 4:21 PM
Hello,
It looks like you are directly modifying BSEG. Where have you placed this code? If it is in Substitution rule (OBBH), you do not need to modify BSEG. You just subsititute the values based on pre-conditions and SAP will take care of the update when Accounting document is generated.
Thanks,
Venu
04-21-2008 4:21 PM
Hello,
It looks like you are directly modifying BSEG. Where have you placed this code? If it is in Substitution rule (OBBH), you do not need to modify BSEG. You just subsititute the values based on pre-conditions and SAP will take care of the update when Accounting document is generated.
Thanks,
Venu
04-22-2008 10:54 AM
Hi Venu,
Your right, it's a really bad idea to "modify" Bseg like this, i found the solution. I was not updating BSEG because in table GB01 Field HKONT was locked for updating. this solution was refered in a SAP note.
Thanks anyway for your help,
Best Regards,
Mário.
06-05-2008 1:05 PM
Hi Mario,
Can you let me know what the solution is?
I need to do this too & HKONT is locked.
Rory