Application Development 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: 

Fill in BSEG-ZUONR with PO BEDNR field

Former Member
0 Kudos

Hi,

I have a requirement to filled in BSEG-ZUONR field with BEDNR field in PO line item through MIGO and MIRO. I'm not able to find any user exit to change the value in BSEG-ZUONR. Currently ZUONR is filled with PO # and line item.

Is there any suggestion on how to change the value ZUONR with BEDNR?

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I tried the samething in my system while doing MIGO. It is updating the BSEG-ZUONR correctly..

Not sure what you are missing...

Thanks

Naren

9 REPLIES 9

Former Member
0 Kudos

Hi,

You can use the BTE 1120 to change BSEG-ZUONR...

Check this link for how to implement BTE.

https://www.sdn.sap.com/irj/sdn/nw-development?rid=/library/uuid/207835fb-0a01-0010-34b4-fef1240ba9b...

Thanks

Naren

0 Kudos

I've implemented BTE. I set a break point in the z function module, it's triggering it. However, the zuonr field still has value of PO and line item. I don't know where the original value of zuonr came from, but it's not changing the value.

Former Member
0 Kudos

Hi,

You have to code in the BTE to change the value BSEG-ZUONR.

Try this code...

FIELD-SYMBOLS: <lwa_bsegsub> TYPE bseg_subst.
DATA: BEGIN OF lwa_po,
             ebeln TYPE ebeln,
             ebelp TYPE ebelp,
           END OF lwa_po. 
DATA: l_bednr TYPE ekpo-bednr.


LOOP AT t_bsegsub ASSIGNING <lwa_bsegsub>.

* Get PO and line item from ZUONR
  lwa_po = <lwa_bsegsub>-ZUONR.

* Get the bednr from EKPO.
  SELECT SINGLE bednr INTO l_bednr
                            FROM EKPO
                            WHERE EBELN = lwa_po-ebeln
                            and        ebelp    = lwa_po-ebelp.

* Check the return code.
   if sy-subrc = 0.
     <lwa_bsegsub>-ZUONR = l_bednr.
   endif.  

ENDLOOP.

Thanks

Naren

0 Kudos

Thanks again for the quick response.

Field ZUONR in t_bsegsub is empty when the function module is triggered at first place. Basically I put the following codes:

data: lv_bednr type bednr.

loop at t_bseg.

loop at t_bsegsub.

select single bednr into lv_bednr from ekpo where ebeln =

t_bseg-ebeln and ebelp = t_bseg-ebelp.

t_bsegsub-zuonr = lv_bednr.

modify t_bsegsub index sy-tabix.

clear lv_bednr.

endloop.

endloop.

I can see value t_bsegsub-zuonr has changed.

However, when I go to table BSEG, the value is overwrite by PO# and line item #.

Do you have any idea where that comes from?

I'm wondering if it's the configuration issue.

I

.

naimesh_patel
Active Contributor
0 Kudos

Try with the business process 00001130.

Regards,

Naimesh Patel

0 Kudos

1130 is not triggering the posting of MIGO and MIRO.

The field is not populated with the value.

Former Member
0 Kudos

Hi,

Please debug after the BTE 1120 is triggered and the BSEG-ZUONR internal table is update with BEDNR..

You can also create watch points on BSEG-ZUONR...to track where exactly the data is changing..

I will also check if this field value can be set in configuration..

Thanks

Naren

0 Kudos

Hi,

I've tried again removing the code "clear lv_bednr", and it's working!

Thanks again for your help!!

Former Member
0 Kudos

Hi,

I tried the samething in my system while doing MIGO. It is updating the BSEG-ZUONR correctly..

Not sure what you are missing...

Thanks

Naren