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: 

BAPI_PO_CREATE1 and EXTENSIONIN structure

andrea_galluccio2
Contributor
0 Kudos

Hi to all ,

i have one problem with standard BAPI_PO_CREATE1 bapi function (release 4.7).

I've enabled one enjoy field in transaction ME21N called 'ZZINVERS'. The field works good (i mean that if i valorize it and i save the order - with me21n/me22n strandard transaction - , the value is also saved in EKPO-ZZINVERS field).

The problem is: if i try to valorize the field with BAPI, this doesn't work.

For this task, i use the "extensionin" table in this way (the field, is at position level - table ekpo, include structure CI_EKPODB):


DATA:
 bapi_te_mepoitem LIKE bapi_te_mepoitem. 
 
 bapi_te_mepoitem-po_item = '00010'.
 bapi_te_mepoitem-zzinvers = 'X'.

 MOVE 'BAPI_TE_MEPOITEM' TO l_extensionin-structure.
 MOVE  bapi_te_mepoitem  TO l_extensionin-valuepart1.
 APPEND l_extensionin.

CALL FUNCTION 'BAPI_PO_CREATE1'
  EXPORTING
    poheader         = l_poheader
    poheaderx        = l_poheaderx
  IMPORTING
    exppurchaseorder = e_exppurchaseorder
  TABLES
    return           = l_return
    poitem           = l_poitem
    poitemx          = l_poitemx
    poaccount        = l_poaccount
    poaccountx       = l_poaccountx
    extensionin      = l_extensionin. "<-- here the   struture to valorize the enjoy customer field.

The order is create good, but the field EKPO-ZZINVERS is not valorize to 'X'. Where i go wrong ??

I've already searched in OSS, but i didn't find any note.

Could one of u help me ??

Thx a lot in advice.

Andrea

7 REPLIES 7

Former Member
0 Kudos

Hi Andrea,

I think you need enhancement SAPL2012 in order to supply the EKPO-ZZINVERS field.

Regards,

John.

andrea_galluccio2
Contributor
0 Kudos

Hi John,

thx for answer.

Could be more precise about it? (

I see the component has 4 exit-fuct. mods.

Do u have an example code on how to use it??

Thx a lot

Andrea

0 Kudos

Hi Andrea,

My answer was a little bit to quick; the exit will not solve your problem.

However, I think your problem might be solved anyway. Take a look a routine 'move_extensionin' of include 'L2012F23'. Did you name your extension 'BAPI_TE_MEPOITEM'? With the move-corresponding and equal names in both structures it should work.

Regards,

John.

0 Kudos

Hi John,

the answer to your question is yes.

At that point, the structure is filled correctly and the program goes on. But later (i don't know where, because then program continues calling different methods ...), the value is not trasmitted from extensionin structure to ekpo-zzinvers field.

With purchase requisitions, the extensionin structure works very well.

If u have more info, i'll appreciated it very much.

Thx a lot again

Andrea

0 Kudos

Hi to all,

i solved the problem without using any function-exit.

Here, how i solved it

1. Add ZZINVER field in CI_EKPODBX include . This include, is used by MEPOITEMX structure. This field is used to inform the bapi "check the ZZINVERS field value"

2. In the extensionin structure, i used 2 different record :


DATA:
 bapi_te_mepoitem LIKE bapi_te_mepoitem,
 bapi_te_mepoitemx LIKE bapi_te_mepoitemx.

*Load the value
 bapi_te_mepoitem-po_item = '00010'.
 bapi_te_mepoitem-zzinvers = 'X'.

 MOVE 'BAPI_TE_MEPOITEM' TO l_extensionin-structure.
 MOVE  bapi_te_mepoitem  TO l_extensionin-valuepart1.
 APPEND l_extensionin.

*Inform that the value contained in ZZINVERS MUST be read by BAPI
 bapi_te_mepoitemx-po_item = '00010'.
 bapi_te_mepoitemx-zzinvers = 'X'. "<--here the "difference"

 MOVE 'BAPI_TE_MEPOITEMX' TO l_extensionin-structure.
 MOVE bapi_te_mepoitemx TO l_extensionin-valuepart1.
 APPEND l_extensionin.

In the L2012F23 code, the first loop will pass the value of the field ('X' or blank)

The second loop, will "inform" the bapi to check the ZZINVERS field.

Hope this will help who'll have the same problem in future.

Thx a lot again John for your support

Andrea

0 Kudos

Hi Andrea Galluccio ,

Can u please provide me the total coding ,,,Im facing the same problem from 2 weeks.

Thank You in Advance.

Srii.

0 Kudos

Hi Andrea,

i believe there should be some enhancement you should do for this to achieve.

The reason for enhancement is : what so ever the field you added here in the Structure CI_EKPODB has to be some how mapped to Standard Screen fields structure as well. so for that purpose we will use the BADI/Exit. so please try to search for the Enhancement and implement the same so that i think you will get this issue resolved.

Thanks

Ram