cancel
Showing results for 
Search instead for 
Did you mean: 

cannot transfer cust fields to PO using badi BBP_CREATE_PO_NEW in classic

Former Member
0 Kudos

Experts,

We want to transfer the values from our Z-fields in the shopping cart header directly to the header Z-fields of the PO. We have implemented the BBP_CREATE_PO_NEW badi in classic scenario, but no values are transferred.

following coding we did:

  
DATA:  ls_po_extension       TYPE bbps_badi_extension,
         ls_bapi_po_header     TYPE ZMM_SRM_EXTENSION_PO,
         ls_bapi_po_headerx    TYPE ZMM_SRM_EXTENSION_PO2, 

  CLEAR ls_header.
  loop at is_sc_document-header into ls_header.
  Endloop.

  CLEAR: ls_po_extension, ls_bapi_po_header, ls_bapi_po_headerx.
  ls_bapi_po_header-po_number = cs_po1_document-is_poheader-po_number.
  ls_bapi_po_header-zzoutput     = ls_header-zzoutput.
  ls_bapi_po_header-ZADM_CONTACT = ls_header-ZZADM_CONTACT.
  ls_bapi_po_header-ZTEC_CONTACT = ls_header-ZZTEC_CONTACT.

ls_po_extension-structure = 'BAPI_TE_MEPOHEADER'.
  MOVE ls_bapi_po_header TO ls_po_extension-VALUEPART1+30.
  APPEND ls_po_extension TO CS_PO1_DOCUMENT-it_extensionin.

* Inform the badi interface to read the Z-fields
  ls_bapi_po_headerx-po_number  = cs_po1_document-is_poheader-po_number.
  ls_bapi_po_headerx-zzoutput   = 'X'.
  ls_bapi_po_headerx-ZADM_CONTACT = 'X'.
  ls_bapi_po_headerx-ZTEC_CONTACT = 'X'.

  ls_po_extension-structure = 'BAPI_TE_MEPOHEADERX'.
  MOVE ls_bapi_po_headerx TO ls_po_extension-VALUEPART1+30.
  APPEND ls_po_extension TO cs_po1_document-it_extensionin.
* End copy customer fields

any idea what is wrong in this code?

Regards,

Tom

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Tom,

did you resolve your issue?

We have the same one.

Many thanks and Regards,

Maria

dean_hinson2
Active Contributor
0 Kudos

Hello Tom,

I have had no experience with extensions but have you test the BAPI on the back-end first? I found sometimes that some errors are not trapped properly and not passed back to SRM. So, I had to create test data in R/3 and test the BAPI to figure out a couple of issues.

I am sorry that I could not help you futher . However, if you ever have to deal P/O Header Text, SAP commented that code out on the SRM-side. You have to modify the method, because I could not get SAP to do it.

Regards, Dean.

Former Member
0 Kudos

Dean,

The problem is that values are not transferred to the backend, so I cannot get them in the BAPI.

regards,

tom

dean_hinson2
Active Contributor
0 Kudos

So, did you debug it to the CREATE_DOCUMENT method?

Regards, Dean.