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: 

Changing quantity,delivery date in Me22n and creating a new output

Former Member
0 Kudos

Hi Team,

I have requirement ,here is the scenario.In T.code ME22N If the changes in the PO are the quantity(EKET-MENGE), delivery date(EKET-EINDT) and "Delivery Completed" Indicator(EKPO-ELIKZ) then a new output will be created..I have created routine in T.code VOFM.and also retrieved data from header table EKKO.But don't know how the changed data will get updated..is there any sample code..Please help me

Thanks and Regards,

Shakeer Hussain

5 REPLIES 5

eduardo_hinojosa
Active Contributor
0 Kudos

Hi,

With customizing you can try to achieve it. Check in SM30 for T166C, or in IMG / MM / MESSAGES and check the last node in the tree.

Regards,

Eduardo

Former Member
0 Kudos

Hi Shakeer

Implement below BADI ME_PROCESS_PO_CUST and use POST method to save all the changes.

Regards,

Pranav

0 Kudos

Hi,

I am writing code like this..but i need to update EKET-MENGE,EKET-EINDT and EKPO-ELIKZ.I am not able to update..is there any sample code

*TYPES: BEGIN OF lty_ekpo,

  • ebeln type ebeln, " Purchasing Document Number

  • ebelp type ebelp, " Item Number of Purchasing Document

  • werks type ewerk, " Plant

  • elikz type elikz, " Delivery Completed" Indicator

  • END OF lty_ekpo,

    • Structure for EKET:Scheduling Agreement Schedule Lines

  • BEGIN OF lty_eket,

  • ebeln type ebeln, " Purchasing Document Number

  • ebelp type ebelp, " Item Number of Purchasing Document

  • etern type eeten, " Delivery Schedule Line Counter

  • eindt type eindt, " Item Delivery Date

  • menge type etmen, " Scheduled Quantity

  • END OF lty_eket.

    • Internal table for EKPO

*DATA:lt_ekpo TYPE STANDARD TABLE OF lty_ekpo INITIAL SIZE 0,

    • Internal table for Transfer Structure Items for Purchasing Documents

  • lt_pot TYPE STANDARD TABLE OF bekpo INITIAL SIZE 0,

    • Internal table for EKET

  • lt_eket TYPE STANDARD TABLE OF lty_eket INITIAL SIZE 0.

    • Flag

*data :lv_flag TYPE sysubrc,

  • lv_ebeln type ekko-ebeln, " Local variable for ebeln.

*

    • Field symbol for ekko:Purchasing Document Header

*FIELD-SYMBOLS <lx_ekko> TYPE ekko.

    • Field symbol for ekpo:Purchasing Document Item

*FIELD-SYMBOLS <lt_ekpo> TYPE mmpur_bekpo.

    • Field symbol for eket

*FIELD-SYMBOLS <lx_eket> TYPE eket.

*

*CLEAR lv_flag.

*UNASSIGN: <lx_ekko>, <lt_ekpo>.

    • Cancel the output processing

*lv_flag = 4.

*

*ASSIGN ('(SAPLMEPO)EKKO') TO <lx_ekko>.

*ASSIGN ('(SAPLMEPO)pot[]') TO <lt_ekpo>.

*ASSIGN ('(SAPLMEPO)EKET') TO <lx_eket>.

*

*

*MOVE <lt_pot>-ebeln to lv_ebeln.

*

    • Fetch data from ekpo table.

*SELECT ebeln " Purchasing Document Number

  • ebelp " Item Number of Purchasing Document

  • werks " Plant

  • elikz " "Delivery Completed" Indicator

  • FROM ekpo

  • into table lt_ekpo

  • where ebeln eq lv_ebeln.

*

  • IF sy-subrc = 0.

  • sort lt_ekpo by ebeln ebelp.

  • ENDIF.

*

    • Fetch data from eket table

*if lt_ekpo[] is not INITIAL.

*SELECT ebeln " Purchasing Document Number

  • ebelp " Item Number of Purchasing Document

  • etenr " Delivery Schedule Line Counter

  • eindt " Item Delivery Date

  • menge " Scheduled Quantity

  • FROM eket

  • into TABLE lt_eket

  • FOR ALL ENTRIES IN lt_ekpo

  • WHERE ebeln = lv_ebeln

  • AND ebelp = lt_ekpo-ebelp.

*

  • if sy-subrc = 0.

  • sort lt_eket by ebeln ebelp etern.

  • endif.

  • endif.

0 Kudos

Hi,

You shouold get the PO number from the structure CEKKO or from variable 'MSG_OBJKY' If i am not wrong.

Regards,

Himanshu

0 Kudos

Hi

I am already using a structure BEKPO..