2014 Mar 14 3:49 PM
Am I doing somethig wrong? Is there another way???CALL FUNCTION 'RV_INVOICE_DOCUMENT_READ'
EXPORTING
vbrk_i = vbrk
konv_read = 'X'
TABLES
xkomfk = xkomfk
xvbrk = xvbrk
xvbrp = xvbrp
xvbpa = xvbpa
xkomv = xkomv
EXCEPTIONS
error_message = 4
OTHERS = 4.
loop at lt_vbrp into ls_vbrp.
FIELD-SYMBOLS : <vbrp> type VBRPVB.
READ TABLE xvbrp ASSIGNING <vbrp> WITH KEY
vbeln = ls_vbrp-vbeln
posnr = ls_vbrp-posnr.
MOVE lv_offre TO <vbrp>-zzoffre.
move lv_sau_mdt TO <vbrp>-zzsau_mdt.
MOVE lv_sau_adh TO <vbrp>-zzsau_adh.
CALL FUNCTION 'RV_INVOICE_ITEM_MAINTAIN'
EXPORTING
VBRP_I = ls_vbrp
TABLES
XKOMFK = XKOMFK
XKOMV = XKOMV
XTHEAD = XTHEAD
XVBFS = XVBFS
XVBPA = XVBPA
XVBRK = XVBRK
XVBRP = XVBRP
XVBSS = XVBSS
ls_VBSK_I-mandt = sy-mandt.
ls_VBSK_I-ernam = ls_vbrp-ernam.
ls_VBSK_I-erdat = ls_vbrp-erdat.
ls_VBSK_I-uzeit = ls_vbrp-erzet.
CALL FUNCTION 'RV_INVOICE_DOCUMENT_ADD'
EXPORTING
VBSK_I = ls_VBSK_I
TABLES
XKOMFK = XKOMFK
XKOMV = XKOMV
XTHEAD = XTHEAD
XVBFS = XVBFS
XVBPA = XVBPA
XVBRK = XVBRK
XVBRP = XVBRP
XVBSS = XVBSS
exceptions
others = 1.
Am I doing somethig wrong? Is there another way???
2014 Mar 14 3:59 PM
See here,
you forgot something to do.
First:
Call function 'RV_INVOICE_ITEM_MAINTAIN'
then, to make changes efective:
Call function 'RV_INVOICE_DOCUMENT_ADD'
with parameters:
WITH_POSTING = 'A'
PREISFINDUNGSART = 'I'
Comes from that discussion:
SD Invoice (item) update FM/BAPI | SCN
Please use the serch first, before asking a question.
Here you can learn more about:
Regards
Florian
Am I doing somethig wrong? Is there another way???CALL FUNCTION 'RV_INVOICE_DOCUMENT_READ'
EXPORTING
vbrk_i = vbrk
konv_read = 'X'
TABLES
xkomfk = xkomfk
xvbrk = xvbrk
xvbrp = xvbrp
xvbpa = xvbpa
xkomv = xkomv
EXCEPTIONS
error_message = 4
OTHERS = 4.
loop at lt_vbrp into ls_vbrp.
FIELD-SYMBOLS : <vbrp> type VBRPVB.
READ TABLE xvbrp ASSIGNING <vbrp> WITH KEY
vbeln = ls_vbrp-vbeln
posnr = ls_vbrp-posnr.
MOVE lv_offre TO <vbrp>-zzoffre.
move lv_sau_mdt TO <vbrp>-zzsau_mdt.
MOVE lv_sau_adh TO <vbrp>-zzsau_adh.
CALL FUNCTION 'RV_INVOICE_ITEM_MAINTAIN'
EXPORTING
VBRP_I = ls_vbrp
TABLES
XKOMFK = XKOMFK
XKOMV = XKOMV
XTHEAD = XTHEAD
XVBFS = XVBFS
XVBPA = XVBPA
XVBRK = XVBRK
XVBRP = XVBRP
XVBSS = XVBSS
ls_VBSK_I-mandt = sy-mandt.
ls_VBSK_I-ernam = ls_vbrp-ernam.
ls_VBSK_I-erdat = ls_vbrp-erdat.
ls_VBSK_I-uzeit = ls_vbrp-erzet.
CALL FUNCTION 'RV_INVOICE_DOCUMENT_ADD'
EXPORTING
VBSK_I = ls_VBSK_I
TABLES
XKOMFK = XKOMFK
XKOMV = XKOMV
XTHEAD = XTHEAD
XVBFS = XVBFS
XVBPA = XVBPA
XVBRK = XVBRK
XVBRP = XVBRP
XVBSS = XVBSS
exceptions
others = 1.
Am I doing somethig wrong? Is there another way???
2014 Mar 14 3:59 PM
See here,
you forgot something to do.
First:
Call function 'RV_INVOICE_ITEM_MAINTAIN'
then, to make changes efective:
Call function 'RV_INVOICE_DOCUMENT_ADD'
with parameters:
WITH_POSTING = 'A'
PREISFINDUNGSART = 'I'
Comes from that discussion:
SD Invoice (item) update FM/BAPI | SCN
Please use the serch first, before asking a question.
Here you can learn more about:
Regards
Florian
2014 Mar 14 4:27 PM
sorry, yes i saw the discussion yesterday and i did, to make changes efective:
Call function 'RV_INVOICE_DOCUMENT_ADD'
with parameters:
WITH_POSTING = 'A'
PREISFINDUNGSART = 'I
and i fill XVBRP table too.
it doesn't work, then i tried without thoses parameters but the result is the same.
I think something else is wrong but what i dont know.
2014 Mar 14 5:24 PM
2014 Mar 17 7:32 AM
hi Florian,
Yes there is a commit work
I just found the problem, i had to update the files after the function RV_INVOICE_ITEM_MAINTAIN and not before !
That work ! than you for helping Florian