Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BELEG_WRITE_DOCUMENT

Former Member
0 Likes
1,309

hi all

i'm traying to update changes from bkpf and bseg using function BELEG_WRITE_DOCUMENT

only field from bkpf are updated in cdhdr and cdpos

'U' IS ON IN BKPF AND BSEG

THANK'S

GABI R

3 REPLIES 3
Read only

Former Member
0 Likes
818

Hi

Try to use this function modules .

CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'

EXPORTING

objectclass = 'EINKBELEG'

objectid = l_objectid

username = space

TABLES

i_cdhdr = lt_cdhdr.

LOOP AT lt_cdhdr WHERE udate IN s_aedat.

CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'

EXPORTING

changenumber = lt_cdhdr-changenr

TABLES

editpos = lt_editpos.

With reference to object .

Please reward if useful.

Read only

0 Likes
818

thank's i'll try it but i wonder why BELEG_WRITE_DOCUMENT works only with

bkpf and not with bseg

Read only

0 Likes
818

CALL FUNCTION 'BELEG_WRITE_DOCUMENT' "IN UPDATE TASK

EXPORTING

objectid = l_objectid1

tcode = sy-tcode

utime = sy-uzeit

udate = sy-datum

username = sy-uname

  • PLANNED_CHANGE_NUMBER = ' '

  • OBJECT_CHANGE_INDICATOR = 'U'

  • PLANNED_OR_REAL_CHANGES = ' '

  • NO_CHANGE_POINTERS = ' '

n_bkdf = l_t_bkdf

o_bkdf = l_t_bkdf

  • upd_bkdf = ' '

n_bkpf = l_t_bkpf

o_bkpf = old_bkpf

upd_bkpf = 'U'

  • upd_bsec = 'U'

  • upd_bsed = 'U'

upd_bseg = 'U'

  • upd_bseg_add = 'U'

  • upd_bset = 'U'

TABLES

xbsec = xbsec

ybsec = ybsec

xbsed = xbsed

ybsed = ybsed

xbseg = xbseg

ybseg = ybseg " OLD

xbseg_add = l_t_xbseg_add_dummy

ybseg_add = l_t_ybseg_add_dummy

xbset = xbset

ybset = ybset

.