SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

update FI item text(bseg) from PO item text(ekpo)



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
weelilin
Участник
Участник



Joined: 13 Jul 2009
Posts: 10

PostPosted: Mon Jul 13, 2009 10:19 am    Post subject: update FI item text(bseg) from PO item text(ekpo) Reply with quote

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.
Back to top
View user's profile Send private message
murka
Участник
Участник


Age: 41
Joined: 03 Jul 2009
Posts: 10
Location: Lithuania

PostPosted: Mon Jul 13, 2009 11:51 am    Post subject: Re: update FI item text(bseg) from PO item text(ekpo) Reply with quote

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 !

_________________
Если долго мучиться, что-нибудь получится
Back to top
View user's profile Send private message
weelilin
Участник
Участник



Joined: 13 Jul 2009
Posts: 10

PostPosted: Mon Jul 13, 2009 12:03 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
Удав
Гуру
Гуру


Age: 48
Joined: 25 Jan 2008
Posts: 580
Location: Москва

PostPosted: Tue Jul 14, 2009 8:16 am    Post subject: Reply with quote

Try to use batch input technique - transaction FB02 via LSMW.
_________________
С уважением,
Удав.
Back to top
View user's profile Send private message
weelilin
Участник
Участник



Joined: 13 Jul 2009
Posts: 10

PostPosted: Tue Jul 14, 2009 9:28 am    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
Удав
Гуру
Гуру


Age: 48
Joined: 25 Jan 2008
Posts: 580
Location: Москва

PostPosted: Tue Jul 14, 2009 1:18 pm    Post subject: Reply with quote

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. Wink

_________________
С уважением,
Удав.
Back to top
View user's profile Send private message
weelilin
Участник
Участник



Joined: 13 Jul 2009
Posts: 10

PostPosted: Wed Jul 15, 2009 6:53 am    Post subject: Reply with quote

hi thanks.....i figure out hw to update using codings...thanks =)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.