cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : /SAPSRM/CL_PDO_BO_PO_ADV updating account assignment

Former Member
0 Kudos

Hello All,

I am using a z-program to update PO uisng the class /SAPSRM/CL_PDO_BO_PO_ADV.

I need to update the account assignment details of each line item of an existing PO.

Is my approach for this is correct.

Can you please suggest the way for it.

Thank you in advance.

With regards,

Sandeep Akella

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sandeep,

Your approach is correct if you are updating buffered PO, for example, in a PO CHANGE BADI, if this is correct try this:

DATA LO_PDO_PO  TYPE REF TO /SAPSRM/IF_PDO_BO_PO_ADV.

DATA LOC_PDO_PO TYPE REF TO /SAPSRM/CL_PDO_BO_PO_ADV.


CALL METHOD /SAPSRM/CL_PDO_FACTORY_PO_ADV=>GET_BUFFERED_INSTANCE
     EXPORTING
       IV_HEADER_GUID = 'PO_GUID'
     RECEIVING
       RO_INSTANCE    = LO_PDO_PO.

LOC_PDO_PO ?= LO_PDO_PO.


TRY.
   LOC_PDO_PO->/SAPSRM/IF_PDO_DO_ORGDATA~UPDATE_ORGDATA(
     EXPORTING
       IS_ORGDATA         = LS_PORG_C    " Organizational Data
     CHANGING
       CO_MESSAGE_HANDLER = LCL_MSG_HAND    " Methods for message handling
   ).
     CATCH /SAPSRM/CX_PDO_ABORT.    " Fatal error caught by PDO Layer
   ENDTRY.

Let's Keep in touch.

Regards

Emanuel

Former Member
0 Kudos

Hello Emanuel,

I am trying to change PO's using a z-program after certain point of time.

Not while creating the PO.

I have tried using the function module BBP_PD_PO_UPDATE.

I am able to update the cost center using this, but unable to update the GL account details.

So I was searching for other method.

Can you please help me in this regards.

With regards,

Sandeep Akella