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: 

Customer Fields not getting poplulated in PO in R/3 (ECC 6.0) from SRM 5.0

Former Member
0 Kudos

Hi,

We Recently upgraded our R/3 System from 4.6 C to ECC 6.0.

Shopping card number is getting created in SRM side and after approval it is getting sent to R/3 Back end,We have some customer fields that need to be populated in the back end from the shopping card,Which is not happening as of now.We are using the BAPI_PO_CREATE1 for creating the PO in R/3.We tried running the BAPI_PO_CREATE1 Standalone by giving the customer fields Table EXTENSIONIN and in Structure BAPI_TE_PO_ITEMS,But the custom fields are not populating in the PO.

Pls suggest,

Thanks

Rakesh.

3 REPLIES 3

Former Member
0 Kudos

Hi Rakesh,

1. What are the values you passed in the STRUCTURE and VALUEPART1.

STRUCTURE value should be one among the below one according ur requirement.

BAPI_TE_MEPOHEADER

BAPI_TE_MEPOHEADERX(Comuncation strucutre)

BAPI_TE_MEPOITEM

BAPI_TE_MEPOITEMX(Comuncation strucutre)

BAPI_TE_MEPOACCOUNTING

BAPI_TE_MEPOACCOUNTINGX(Comuncation strucutre)

2 . what is ur target that Updating using the BAPI EXTENSIONIN paramerter . Please find the

For better checking plz go thru the doucmenation of Fun Mod BAPI_SALESORDER_CHANGE.

Hope it helps

Rgds

Sree M

0 Kudos

Hi,

Sree just to add in 4.6c the customer fields( Zfields) were populating,But in ECC 6.0 these fields are not populating.I was Earlier passing BAPI_TE_POST_ITEMS in structure and customr fields in valuepart1 and value part2.As per ur reply i am passing the structure BAPI_TE_MEPOITEM in structure and custom fields in Valuepart1 and value part2 and ran the BAPI_PO_CREATE1 standalone,Its creating the PO but the custom Fields are not getting populated.

Thanks

Rakesh.

0 Kudos

Hi Rakesh ,

1.wat is ur target table that ur custom fields were added using apped structure.

2. Have u passed the Communcation strucure also means

in ur case BAPI_TE_MEPOITEMX along with BAPI_TE_MEPOITEM .

Plz find similar code which is for sale order coding which may help u .

***Constant Declarations

Constant: C_BAPE_VBAP (9) type u2018BAPE_VBAPu2019,

C_BAPE_VBAPX (10) type u2018BAPE_VBAPXu2019

TYPES: BEGIN OF T_BAPE_VBAP,

VBELN TYPE VBELN_VA,

POSNR TYPE POSNR_VA,

ZZcontract_num type ZZcontract_num "Custom field

END OF T_BAPE_VBAP.

***Communication Fields

TYPES: BEGIN OF T_BAPE_VBAPX,

VBELN TYPE VBELN_VA,

POSNR TYPE POSNR_VA,

ZZcontract_numX type CHAR1,

END OF T_BAPE_VBAPX.

            • Declaring the Internal table and Work areas

DATA: I_EXTENSIONIN TYPE STANDARD TABLE OF BAPIPAREX. u201CInternal table for BAPI Extension Table

w_EXTENSIONIN like line of I_EXTENSIONIN, u201CWork area for BapiExtension Table

I_return type standard table of bapiret2,

W_return like line of i_return,

is_BAPE_VBAP type T_BAPE_VBAP, u201CStructure declaration

is_BAPE_VBAPX type T_BAPE_VBAPX, u201CStructure declaration

v_vbeln type BAPE_VBAP-VBELN, u201CVariable for the doc no

v_posnr type BAPE_VBAP-POSNR, u201CVariable for the itemnumber

v_zzcontract_num type BAPE_VBAP-ZZcontract_num, u201CVariable for the Contract number

Filling the BAPI table Extension Structure.

W_BAPE_VBAP-VBELN =u201D00001234u2019.

W_BAPE_VBAP-POSNR =u2019000010u2019 .

W_BAPE_VBAP-ZZcontract = 'ABC123'.

W_EXTENSIONIN-STRUCTURE = C_BAPE_VBAP.

w_EXTENSIONIN+30 =W_BAPE_VBAP.

APPEND W_EXTENSIONIN TO I_EXTENSIONIN.

CLEAR w_EXTENSIONIN..

k_BAPE_VBAP-VBELN =u201D00001234u2019.

W_BAPE_VBAP-POSNR =u2019000010u2019 .

W_BAPE_VBAP-ZZcontractx = 'X'.

*********same to pass Communication Structure.

W_EXTENSIONIN-STRUCTURE = C_BAPE_VBAPX.

w_EXTENSIONIN+30 = W_BAPE_VBAPX.

APPEND W_EXTENSIONIN TO I_EXTENSIONIN.

CLEAR w_EXTENSIONIN.

6) Then Call BAPI u2018BAPI_SALESORDER_CHANGE u2018to Update Sale Order with Contract number

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

SALESDOCUMENT = V_SALORD_NUMBER

ORDER_HEADER_IN = K_ORDER_HEADER_IN

ORDER_HEADER_INX = K_ORDER_HEADER_INX

TABLES

RETURN = I_RETURN

ORDER_ITEM_IN = I_ORDER_ITEM_IN

ORDER_ITEM_INX = I_ORDER_ITEM_INX

EXTENSIONIN = I_EXTENSIONIN.

****COMMIT WORK AND WAIT.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

Hope it may help you

Rgds

Sree