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_CREATE, standard field missing. How to fill it?

andrea_galluccio2
Contributor
0 Kudos

Hi to all guys,

this is my quest.

I have to populate a standard field called 'MFRGR' (in EKPO table) with BAPI_PO_CREATE.

BAPI doesn't have this field in any standard input structure of the bapi (in PO_ITEMS and PO_ITEM_ADD_DATA the field is missing).

How can i do that without modify the standard?

May i use the extensionin structure to do that?

If yes, please post practical examples (only standard field - no custom fields): are very appreciated and also the step to follow (example, If I need to modify strucutures on db).

Points will be surely rewards.

Thx a lot

Andrea

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello, you can obtain VBAP value in the same way.

l_vbeln = '(your program)vbap-vbeln'.

l_vbeln = '(your program)vbap-posnr'.

i dont think you should have problems with unicode, because the caracters are in the regular alfabet. (you dont have ñ or ò)

If you are in ECC you could check the new enhacement framework.

http://help.sap.com/saphelp_erp2005/helpdata/en/94/9cdc40132a8531e10000000a1550b0/frameset.htm

10 REPLIES 10

Former Member
0 Kudos

Hi,

As the bapi doesn't contain MFRGR field in any of the used tables. It is better to make a copy of this bapi and then include that field. As far as I know, this is also the solution which helps.

0 Kudos

Hi,

thx a lot for your answer, but i don't like this way to proceed.

Before make a copy of the whole f.m. (and all the includes that i should modify), i'd like to know if there is another way to proceed.

Thank You

Andrea

Former Member
0 Kudos

Hello,

i think that this couldnt be done in the BAPi, because the MFRGR is an attribute of the material and plant (MARC table), so in the creation of the PO, depending of the material the systems take the value of this table.

If you want to alter this value you should use an exit in the generation of the PO.

check include LXM06UXX for see the exits.

hope it helps.

0 Kudos

Hi Alejo,

i cannot do that.

The request is that field (EKPO-MFRGR) must be filled by the same value of the original sales order document field (VBAP-MFRGR) during the creation on the document (that means when i call BAPI_PO_CREATE).

In the LXM06UXX, there are too many. How witch i shoud use to perform this task ?

Thank you.

Andrea

Former Member
0 Kudos

Hi Andrea,

Use FM

MASS_CHANGE_PURCHASE_ORD

or

MASS_CHANGE_PURCHASE_ORD_BAPI

to change the field MFRGR (in EKPO table).

Lokesh

0 Kudos

Hi,

cannot use both.

If u see the code inside the FMs, no MFRGR field is moved, also if u have the possibility to pass the value as input parameter.

The first one, use a kind of batch-input (but the field is not moved and also the field is not on the standard trasaction). The second, the bapi, call a generated FM to mapped the input structures (like BAPI_PO_CREATE1). But this genetared FM, doesen't move the missing field.

Thank You

Andrea

Former Member
0 Kudos

Hello,

inside FM EXIT_SAPMM06E_012

you could put this code:

DATA: l_pila(30) TYPE c.

DATA: lw_ekpo TYPE bekpo.

FIELD-SYMBOLS: <lt_ekpo> TYPE STANDARD TABLE.

CLEAR l_pila.

MOVE '(SAPLMEPO)pot[]' TO l_pila.

ASSIGN (l_pila) TO <lt_ekpo>.

LOOP AT <lt_ekpo> INTO lw_ekpo.

lw_ekpo-mfrgr = vbap-mfrgr.

MODIFY <lt_ekpo> FROM lw_ekpo.

ENDLOOP.

you first have to search the value of VBAP.

hoepe it helps.

0 Kudos

Hi,

thx a lot to you Alejo but.... also this suggestion is not good for me.

I need the vbeln number (vbap-vbeln / vbap-posnr) in that exit to read the right MFRGR value from vbap.

Also i know this kind of techniqe :MOVE '(SAPLMEPO)pot[]' TO l_pila.

ASSIGN (l_pila) TO <lt_ekpo>.

Also, I don't know if it should works good also in a unicode system.

It's incredible. Seems there is no possibility to fill that value via BAPI/USER EXIT. Is it possibile that Sap doesen't provide a standard method to fill that field ? Did u ever have a case like mine.

I think i'll proceed with a work-around (after the bapi call)

Thank You.

Former Member
0 Kudos

Hello, you can obtain VBAP value in the same way.

l_vbeln = '(your program)vbap-vbeln'.

l_vbeln = '(your program)vbap-posnr'.

i dont think you should have problems with unicode, because the caracters are in the regular alfabet. (you dont have ñ or ò)

If you are in ECC you could check the new enhacement framework.

http://help.sap.com/saphelp_erp2005/helpdata/en/94/9cdc40132a8531e10000000a1550b0/frameset.htm

andrea_galluccio2
Contributor
0 Kudos

I've decided to make a work-around and make un update of the ekpo table after the BAPI-call.