Posted: Mon Jul 13, 2009 10:19 am Post subject: update FI item text(bseg) from PO item text(ekpo)
Hi all, i am trying to update FI item text(bseg) from PO item text(ekpo).I know that bseg is a culster table therefore inner join is not allow.
I have tried the various codes that are posted within this forum but can never get anything to write:/ out.
I've manage to update the FI text field with some random words(but both seperately).What i need now is to retrieve the text from ekpo to pdate into bseg. I have attached my coding for better understanding
Any help is greatly appreciated..
Code:
TABLES:bseg, EKPO.
DATA:it_bseg LIKE bseg OCCURS 0 WITH HEADER LINE,
wait_ekpo LIKE ekpo OCCURS 0 WITH HEADER LINE.
PARAMETERS:p_belnr LIKE bseg-belnr,
p_bukrs LIKE bseg-bukrs,
p_gjahr LIKE bseg-gjahr,
s_bukrs LIKE ekpo-bukrs,
s_ebeln LIKE ekpo-ebeln,
s_ebelp LIKE ekpo-ebelp.
START-OF-SELECTION.
SELECT * FROM bseg INTO TABLE it_bseg WHERE belnr = p_belnr AND bukrs = p_bukrs AND gjahr = p_gjahr.
MOVE 'COOL' TO it_bseg-sgtxt.
MODIFY it_bseg FROM it_bseg TRANSPORTING sgtxt where belnr = p_belnr AND bukrs = p_bukrs AND gjahr = p_gjahr.
LOOP AT it_bseg.
WRITE:/3 it_bseg-belnr, it_bseg-gjahr, it_bseg-sgtxt.
ENDLOOP.
MODIFY bseg FROM TABLE it_bseg.
COMMIT WORK.
IF sy-subrc EQ 0.
WRITE:/3 'BSEG TABLE UPDATED SUCCESSFULLY WITH TEXT'.
ENDIF.
SELECT * FROM ekpo INTO TABLE wait_ekpo where bukrs = s_bukrs AND ebeln = s_ebeln.
MOVE 'DUDE' TO wait_ekpo-txz01.
MODIFY wait_ekpo FROM wait_ekpo TRANSPORTING txz01 where bukrs = s_bukrs AND ebeln = s_ebeln.
LOOP AT wait_ekpo.
WRITE:/3 wait_ekpo-bukrs, wait_ekpo-ebeln, wait_ekpo-txz01.
ENDLOOP.
MODIFY ekpo FROM TABLE wait_ekpo.
COMMIT WORK.
IF sy-subrc EQ 0.
WRITE:/3 'EKPO TABLE UPDATED SUCCESSFULLY WITH TEXT'.
ENDIF.
Posted: Mon Jul 13, 2009 11:51 am Post subject: Re: update FI item text(bseg) from PO item text(ekpo)
weelilin wrote:
Hi all, i am trying to update FI item text(bseg) from PO item text(ekpo).I know that bseg is a culster table therefore inner join is not allow.
I have tried the various codes that are posted within this forum but can never get anything to write:/ out.
I've manage to update the FI text field with some random words(but both seperately).What i need now is to retrieve the text from ekpo to pdate into bseg. I have attached my coding for better understanding
Any help is greatly appreciated..
Code:
TABLES:bseg, EKPO.
DATA:it_bseg LIKE bseg OCCURS 0 WITH HEADER LINE,
wait_ekpo LIKE ekpo OCCURS 0 WITH HEADER LINE.
PARAMETERS:p_belnr LIKE bseg-belnr,
p_bukrs LIKE bseg-bukrs,
p_gjahr LIKE bseg-gjahr,
s_bukrs LIKE ekpo-bukrs,
s_ebeln LIKE ekpo-ebeln,
s_ebelp LIKE ekpo-ebelp.
START-OF-SELECTION.
SELECT * FROM bseg INTO TABLE it_bseg WHERE belnr = p_belnr AND bukrs = p_bukrs AND gjahr = p_gjahr.
MOVE 'COOL' TO it_bseg-sgtxt.
MODIFY it_bseg FROM it_bseg TRANSPORTING sgtxt where belnr = p_belnr AND bukrs = p_bukrs AND gjahr = p_gjahr.
LOOP AT it_bseg.
WRITE:/3 it_bseg-belnr, it_bseg-gjahr, it_bseg-sgtxt.
ENDLOOP.
MODIFY bseg FROM TABLE it_bseg.
COMMIT WORK.
IF sy-subrc EQ 0.
WRITE:/3 'BSEG TABLE UPDATED SUCCESSFULLY WITH TEXT'.
ENDIF.
SELECT * FROM ekpo INTO TABLE wait_ekpo where bukrs = s_bukrs AND ebeln = s_ebeln.
MOVE 'DUDE' TO wait_ekpo-txz01.
MODIFY wait_ekpo FROM wait_ekpo TRANSPORTING txz01 where bukrs = s_bukrs AND ebeln = s_ebeln.
LOOP AT wait_ekpo.
WRITE:/3 wait_ekpo-bukrs, wait_ekpo-ebeln, wait_ekpo-txz01.
ENDLOOP.
MODIFY ekpo FROM TABLE wait_ekpo.
COMMIT WORK.
IF sy-subrc EQ 0.
WRITE:/3 'EKPO TABLE UPDATED SUCCESSFULLY WITH TEXT'.
ENDIF.
Hi,
Dont understand what do you try to achive.
But direct update of FI tables is not very good decition. First of all try to use FI substitution technique (trc. GGB0, GGB1). Or use standard FI dtabs update routine - for example FM CHANGE_DOCUMENT.
FI document DB tables have relationship with other modules DB tables - have a look at field BKPF~AWKEY.
Good luck ! _________________ Если долго мучиться, что-нибудь получится
i wun be able to use user exit and all because i am suppose to update only may and june FI line item.
My finance user would like to see the exact same text from the PO line at FI line.So they want me to do a update...
hi correct me if i am wrong..but i think according to my research lsmw and batch input can only be use for future data and it can't retrieve nor update past data...
Age: 48 Joined: 25 Jan 2008 Posts: 580 Location: Москва
Posted: Tue Jul 14, 2009 1:18 pm Post subject:
Transaction FB02 is intended for change text fields (for example BSEG-ZUONR, BSEG-SGTXT, BKPF-XBLNR, BKPF-BKTXT ) of FI documents.
Try to use it. _________________ С уважением,
Удав.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.