Skip to Content
0
Former Member
Apr 21, 2008 at 07:51 AM

Modify bseg-hkont - Sap Substitution

790 Views

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.