Application Development and Automation 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: 
Read only

Implement ME_PROCESS_PO_CUST-Urgently!

Former Member
0 Likes
762

Hi,

we have implement the ME_PROCESS_PO_CUST with method 'PROCESS_ITEM' AND 'PROCESS_SCHEDULE' to change some fields (append structures for EKET EKPO)for creating PO. It works well for T-Code ME21N.

But by calling BAPI to create PO, there is some error occured:

E |MEPO |001 |Purchase order item 00010 still contains faulty schedule lines

E |ME |154 |Not possible to determine any components

sepcially for calling with interface 'pocomponents' (IF the BADI NOT CHANGE ANY FIELD, IT WORKS WELL); When calling BAPI with no interface 'pocomponents' , it also works well. Why?

there is some codes:

select single * into lw_zsoh_order01

from zsoh_order01

where werks eq ls_mepoheader-reswk

and zortyp eq ls_mepoheader-bsart

  • Add by weili 20070813

and pstyp eq ls_mepoitem-pstyp.

  • End add

if sy-subrc eq 0.

ls_meposchedule-z_lifsp = lw_zsoh_order01-lifsp.

l_flag = 'X'.

endif.

if l_flag eq 'X'.

call method im_schedule->set_data

EXPORTING

im_data = ls_meposchedule.

endif.

Thanks!

Hi,

we have implement the ME_PROCESS_PO_CUST with method 'PROCESS_ITEM' AND 'PROCESS_SCHEDULE' to change some fields (append structures for EKET EKPO)for creating PO. It works well for T-Code ME21N.

But by calling BAPI to create PO, there is some error occured:

E |MEPO |001 |Purchase order item 00010 still contains faulty schedule lines

E |ME |154 |Not possible to determine any components

sepcially for calling with interface 'pocomponents' (IF the BADI NOT CHANGE ANY FIELD, IT WORKS WELL); When calling BAPI with no interface 'pocomponents' , it also works well. Why?

there is some codes:

select single * into lw_zsoh_order01

from zsoh_order01

where werks eq ls_mepoheader-reswk

and zortyp eq ls_mepoheader-bsart

  • Add by weili 20070813

and pstyp eq ls_mepoitem-pstyp.

  • End add

if sy-subrc eq 0.

ls_meposchedule-z_lifsp = lw_zsoh_order01-lifsp.

l_flag = 'X'.

endif.

if l_flag eq 'X'.

call method im_schedule->set_data

EXPORTING

im_data = ls_meposchedule.

endif.

Thanks!

2 REPLIES 2
Read only

Former Member
0 Likes
562

Hi,

If you dont want to execute the code when BAPI to create PO is called, then simply put the following validation.

if sy-tcode = 'ME21N'.

...

..

endif.

If your requirement is to execute BADI alwayz, then put a break-point in the BADI & debug when BAPI is called. Certainly there is problem in the data.

Best regards,

Prashant

Read only

Former Member
0 Likes
562

Hi,

ignore if the problem got resolved.

When the custom fields are added to EKPO we got to create to structurtes CI_EKPODB/CI_EKPODBX with the custom fields.

Populate the table "EXTENSIONIN" STRUCTURE BAPIPAREX.

Populate the values for your custome fields in the "BAPI_TE_MEPOITEM" strucutre. Move all these values into field BAPIPAREX-VALUEPART1.

You should fill in the details for the strucutre = "BAPI_TE_MEPOITEM".

Do the same for "BAPI_TE_MEPOITEMX",populate all 'X' .

Append EXTENSIONIN table with these values...

Hope this works.

Ramana Malladi