Skip to Content
author's profile photo Former Member
Former Member

How to change the value of Purchasing group while saving in ME21N

Hi Guys,

I have a requirement wherein i need to check the value of purchasing group(field EKGRP) on pressing save ie creation of a purchase order. If the EKGRP value is not a specific value say 110 i have to default it to 110 on saving

That is upon saving(in Me21N) the code should check these

1 - Value of EKGRP

2 - Change the value to 110 if it's anything else.

I have gone through EXIT_SAPMM06E_013 and BAPI ME_PROCESS_PO_CUST. The problem with the EXIT_SAPMM06E_013 is that it's tables have no value of EKGRP during runtime.

The BAPI ME_PROCESS_PO_CUST method PROCESS_HEADER does not get called while saving the PO,hence it does not solve my purpose.

Could anyone help me out?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 05, 2015 at 02:34 PM

    Hi everyone,

    I have solved the requirement by means of an implicit enhancement in the include LMEGUICI5. Inside this include there is a method transport_from_dynp.All i have to do is change the value of purchasing group based on my condition inside the structure mepo1222.

    This enhancement gets triggered whenever user presses enter or save.

    Thanks everyone for your valuable help and inputs.Iam marking Raymond's answer as helpful

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 02, 2015 at 04:07 PM

    The BAPI ME_PROCESS_PO_CUST method PROCESS_HEADER does not get called while saving the PO,hence it does not solve my purpose.

    So better use a method CHECK, this one is called both when saving or when user execute a check, and allows change of data. (Method POST should not allow change of data, only execution of other updates. Just call im_header->get_data and set_data.)

    NB: But why do you want to wait until save to change the value, if you don't need some information only available at save time, you could use PROCESS_HEADER, so user would be aware of the change?

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 02, 2015 at 03:50 PM

    Hi Hari,

    If you are not able to find the internal table/structure in BADI/Exit, I hope you can try the value using field symbol concept.

    "Data Declaration

    field-symbol <f_ekgrp> like ekgrp.

    "Get the Ekgrp value using Program and Variable name

    assign ('(program_name)varible_name') to <f_ekgrp>.

    "Change the value

    if <f_ekgrp> is assigned.

    <f_ekgrp> = 'new value'.

    endif.

    Regards

    Rajkumar Narasimman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2015 at 04:34 PM

    Hi,

    use, as Raymond has mentioned, BADI ME_PROCESS_PO_CUST with

    method PROCESS_HEADER.

    In this method you have to use:

    CALL METHOD IM_HEADER->GET_DATA

    and than

    CALL METHOD IM_HEADER->SET_DATA

    Regards, Dieter

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 03, 2015 at 10:37 AM

    Hi,

    i'm a litte bit confused, there are a lot of answers which will help.

    Can you please show us what do you have tried.

    Did you tried PROCESS_HEADER? When yes show the code.

    Regards, Dieter

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.