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: 

Updating EBAN table with custom field values by BAPI_PR_CREATE

Former Member
0 Kudos

Hi all,

My requirement is PR creation by BAPI_PR_CREATE Function Module .

for pr item level customer added 10 fields in the EBAN table append structure CI_EBANDB. .

i am creating PR by using Funcation module BAPI_PR_CREATE.

In this Function Module I have to pass the structure name and field values in the EXTENTIONIN .

what is the structure name I have to pass and how populate data in to the EBAN table.

after that i have to create PR and updating 10 two custom field values in the EBAN Table.

how to proceed for updating the customer field values in the eban table.

thanks in advance.

sri

6 REPLIES 6

Former Member
0 Kudos

Hi,

You need to pass your structure name and you you need to pass the values to the work area of that structure .

The BAPI will automatically pass the value of the corresponding field depending on the field length.

0 Kudos

Hi Das,

Thanks for the reply. For me it is not happening.

data: im_value type bapi_te_mereqitem,

im_valuex type bapi_te_mereqitemx.

im_value-item = lc_item_no.

im_value-z_id = <fs_prod>-id1.

im_value-z_pa = <fs_prod>-id2.

ls_extenin-structure = 'bapi_te_mereqitem' .

ls_extenin-valuepart1 = im_value+0(240).

ls_extenin-valuepart2 = im_value+241(227).

append ls_extenin to lt_extenin.

im_valuex-preq_item = lc_item_no.

im_valuex-z_id = 'X'..

im_valuex-z_pa = 'X'.

ls_extenin-structure = 'bapi_te_mereqitemX'.

move im_valuex to ls_extenin-valuepart1.

append ls_extenin to lt_extenin.

i am using above code to populate the value.

I am not getting.

kindly help me to proceed further.

Thanks in advance

sri

0 Kudos

Hi raymond,

thanks for the reply.

is it possible to send both the notes to my id.

sri_1050 at hotmail.com

sri.

0 Kudos

Basically these BAPI use the enjoy transaction to perform.

Note 565099 - New BAPIs for the purchase requisition object (BUS2105)

(...)

BAPI_PR_CREATE and BAPI_PR_CHANGE are made available with mySAP ERP 2005 so that you can create and change purchase requisition documents using the EnjoySAP transactions ME51N/ME52N/ME53N (imported with SAP R/3 Release 4.6C).

(...)

So the prerequisites are to be applied :

Note 638849 - ME51N: User-defined fields are not transferred

Symptom

User-defined fields are not saved in the EBAN table. The function for this works in the old purchase requisition transactions (ME5X). However, in the new transactions (ME5XN), the data is not transferred. In addition, the field contents disappear if you use the new transaction to change a purchase requisition that was created with the old transaction.

Other terms

ME51, ME52, ME53, ME52N, ME53N, append, upgrade, CI_EBANDB, CI_EBKNDB, CI_EBANDBX, BUS2105, PurchaseRequisition, CreateFromData1, Change1, PREQCR1, PREQCH1, PREQCR1.PREQCR101, PREQCH1.PREQCH101

Reason and Prerequisites

You added user-defined fields to the EBAN table (within or outside a user-defined structure). These user-defined fields are missing in the MEREQ_ITEMX structure.

Solution

1. In order to use this function in the new transactions (ME5XN), you must also add the user-defined fields to the MEREQ_ITEM and MEREQ_ITEMX structures.

2. In order to add the CI_EBANDB include to the EBAN table in the MEREQ_ITEMX structure without making any modifications, you must add the CI_EBANDBX include to this structure:

  • Start Transaction SE11 and enter MEREQ_ITEMX under data type.

  • Then choose Change.

  • Insert the following information at the end of the structure:

o Component: .Include

o Component type: CI_EBANDBX

  • Save the changes and Activate the structure.

Only continue if you have made enhancements in the CI_EBANDB include.

3. In Transaction SE11 display the definition of the MEREQ_ITEMX structure. Double-click the CI_EBANDBX include that you inserted previously.

4. Now insert your fields in this include. Make sure that the component type is BAPIUPDATE.

The field value you entered is only transferred if the field name from CI_EBANDB also exists in CI_EBANDBX and has been referenced with BAPIUPDATE.

In particular, this applies if you use the new purchase requisition APIs:

  • BAPI_PR_CREATE - for creating purchase requisitions

  • BAPI_PR_CHANGE - for changing purchase requisitions

Regards

0 Kudos

Hi Raymaond,

thanks

I checked as per note. the both structures are available.

sri

raymond_giuseppi
Active Contributor
0 Kudos

Look at [Note 565099 - New BAPIs for the purchase requisition object (BUS2105)|https://service.sap.com/sap/support/notes/565099], [Note 499627 - FAQ: BAPIs for purchase requisitions|https://service.sap.com/sap/support/notes/499627] also dont forget to look at [Note 638849 - ME51N: User-defined fields are not transferred|https://service.sap.com/sap/support/notes/638849]

Regards