Generic Batch Number assignment via Customer exit

Hi Folks,
The client  requirement is as follows:
Once a user enters a batch number customer exit EXIT_SAPLV01Z_002 should be triggered.
Here, in this exit via custom logic, i am supposed to create a generic batch code.
If the user enters a batch code from any tcode be it MSC1N, Purchase order creation, MB11, Process order etc.
First a validation should be done. Else, if field is blank then a generic batch number is to be created.
Generic batch would be like PMFGYMDxxx- PMFG- Plant of manufacture, YMD- Date in YMD format and xxx as next.
My concern is that when user enters a batch code from above mentioned TCODES this Customer exit does not get triggered.
It only gets triggered when batch number field is left empty.
Need help!!

Moderator message - Welcome to SCN.
But please do not post your requirements and ask the forum to do your work for you - post locked
Also, Please read Please read "The Forum Rules of Engagement" before posting!  HOT NEWS!! and Please Read before Posting in the Performance and Tuning Forum and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
Rob

Similar Messages

  • Automatic external batch number assignment

    Hi gurus,
    I'm facing to an huge issue.
    I've created an subcontracting PO. Into this PO, I have inserted a external batch number to a component.
    When I make a good receipt with MB0A transaction. movement type 101 for the finished product and movement type 543/O for component. the external batch number is populated in the material document. But I don't want the MB0A transaction populates this bactch number. I want to input it manually in this transaction.
    Is it possible to disengage the automatic external batch number assignment by the MB0A transaction and insert a external batch number manually?
    Thanks for your help.
    L. YDIR

    Try this exit, its for external bacth number assignment EXIT_SAPLV01Z_003 .
    EXIT_SAPLV01Z_003. Using this exit, you can replace the proposed number range object BATCH_CLT and/or external interval 02 with a number range object and/or external interval you have defined yourself.
    You also have the option of suppressing the batch number check, for example, based on the material or plant.
    Further : EXIT_SAPLV01Z_003. Using this exit, you can replace the proposed number range object BATCH_CLT and/or external interval 02 with a number range object and/or external interval you have defined yourself.
    You also have the option of suppressing the batch number check, for example, based on the material or plant.
    Just wanted to ask : which version of SAP are u working on?  is it some old version?  coz I see u using MB* Transactions, while SA now recommends most goods movements by MIGO TCODE, aslo most new enhancements are for MIGO .

  • Enter batch number - No Automatic Batch Number assignment allowed for plant

    Hi SAP Gurus,
    Upon checking the created new Goods receipt for Purchasing Order in tcode migo_gr, checking with the Batch tab, we can't see a batch number, then clicking the classification tab showing the message Enter batch number - No Automatic Batch Number assignment allowed for plant - XXXX
    the question is there any missing configuration based for this kind of error? ive checked the availability check for the plant and it already setup. Hope for your kind responses.
    Thanks

    HI,
    Kindy check the below configuratoin
    Logistics - General>Batch Management>Creation of New Batches>Define Batch Creation for Goods Movements
    for your movement type check what is the Strategy for the new batches.
    here you should assigne only automatic.
    Also let me know what is the level of batch mgt> is it at client level, Plant level, Material level.?
    reg
    Dsk

  • Double Role for Analysis Authorization using Variable via Customer Exit

    Hi Guys I have been implementing AA using variable via customer exit and I have run into this problem, I wonder anyone have encountered this.
    Example I have a User having 2 sets of authorization Roles
    Role 1
    Personnel Area = A, B
    Personnel Sub Area = 1,
    Role 2
    Personnel Area = A
    Personnel Sub Area = 1, 2
    And what we can derive this that is the user is able to see A-1 B-1 and A-2 BUT NOT B-2 when we run all.
    But instate when we run the report it is drawing B-2 as well as because we are entering
    Personnel Area = A,B
    Personnel Sub area = 1,2
    Any idea how to solve this?
    <removed by moderator>
    Edited by: Siegfried Szameitat on Dec 3, 2008 2:41 PM

    Hello Chee Jason,
    Are you working with version 3.5 or 7.0
    How do you specify Hierarchy variable?
    Any advise you can share is very much appreciated.
    Thanks,
    Patrick

  • Batch Number assigned to Process Order

    Hi Experts,
    Which table should I use if I want to get the Batch number assigned in a process order?
    Thanks,
    Kumar

    Hi,
    If u want to get the batch number of Process Order FG then u can get it from AFPO.If u want item level then get it from MSEG table.
    Regards
    R.Brahmankar

  • Hierarchy Authorization using Variable via Customer Exit

    Hi experts,
    I am wondering if I can do Hierarchy Authorization using Variable via Customer Exit? I know it can be done on normal value authorization by putting $+(the variable name). So can we do the same for Hierarchy authorization?
    For my case I have a 0ORGUNIT and I would allow the role to access anything below its node. So do I put $VARORGUNIT in Technical Node Name and Hierarchy name as ORGEH, Type of authorization = 1 and Area of Validity = 3.
    Points will be given!
    Thanx!

    Hello Chee Jason,
    Are you working with version 3.5 or 7.0
    How do you specify Hierarchy variable?
    Any advise you can share is very much appreciated.
    Thanks,
    Patrick

  • Batch number assignment after receiving the goods

    iam receiving material from my customer say 100 units, i am giving the challan that i have received 100 units from u, and the challan number will be 1000
    After that i have to do job work, in the received 100 units,
    50 i have to issue to production for different process
    50 i have to issue to production for different process
    I need to give batch number for first 50 units issued to production as 1000A
    I need to give batch number for second 50 units issued to production as 1000B
    How to do in SAP???

    Hi
    You can assign the same material to different batches
    To assign a batch number to the material, you can do it during goods issue in MIGO or MB1C.
    In MB1C, you can give the Material , Qty and Batch No. Use movement type 561 to receive the goods in MB1C
    Hope this helps
    regards
    Anand

  • Batch number Assignment - urgent

    Hi All,
    I had implemented the screen exit (screen no 0900) with two customized fields in the enhancement CONFP007. For the same I had appended the two fields in the structure AFRUD. I can see the screen fields in the t-code CO11N.
    <b>I want to pass one of these customized field value (from screen 0900) to the user exit EXIT_SAPLV01Z_003 & EXIT_SAPLV01Z_004 (enhancement SAPLV1ZE) to get the external batch number.</b>
    The required external batch number would be (2 char customized fields from screen 0900) + (INRDP-NRLEVEL + 1)  for INRDP-NRRANGENR = '02' and Object 'BATCH_CLT'.
    But in the user exit i would not find any structure and global data to pass the value of cuctomized field from structure AFRUD to BNCOMZ structure.
    How do I proceed to update/get the customized batch number without using IMPORT & EXPORT SAP command?
    Please let me know your input on this.
    Thanks & Regards,
    Sandeep

    Hi,
    I suggest you to sit down with your abaper to create logic statement in user exit. I had the same situation last time when I need to enter batch number base on system date automatically during GR. For your case, ask abaper to take into account system date, number range and mara table.
    Thanks and best regards,
    Mahnansa

  • How to assign a Customer exit variable to Key figure

    Hi,
    I have created a Customer Exit variable to findout no. of days in the month. 
    But I dont know how to assign that variable to a Keyfigure value.  Can you please let me know how to assign it.
    Regards
    Sankar

    Hi Sankar,
    From what I could understand, you want to display the output of that key figure for some no. of days of a month (calculated in your customer exit variable)...right ???
    If that is the case then you can create a structure in columns. Create a new selection...include your key figure and that customer exit variable in it.
    That shall serve the purpose.
    Regards
    Shalabh Jain
    Edited by: Shalabh Jain on Dec 15, 2008 1:46 PM

  • GRN batch number assignment error?

    Dear All,
    We have configured that whenever we do GRN batch number should generate automatically but while doing GRN if i don't save or post the document also it is generating batch number i mean to say without saving a PO GRN one batch number is generated and if i go in to MIGO screen for same PO then new batch number getting assigned.
    so anyone tell me where have set wrong and how to check and correct it?

    Hi,
    If you are coming out of the transaction completely by using F3, then system won't create any batch, but after entering all the details if you are clicking on "Check", then system will create a batch number, this is standard behaviour only.

  • Fill BEx Variable with more than one value via Custom Exit

    Dear SDN comunity,
    I want to fill a BEx Variable via a custom exit. My problem is, I don't know how to fill this variable with more than one value.
    I try to give you some background info based on an exaple:
    <u><b>Variable-Details</b></u>
    <b>Type of Variable:</b> Characteristic Value
    <b>Variable Name:</b> ZCCD
    <b>Description:</b> Company Code Selection
    <b>Processing by:</b> Custom Exit
    <b>Characteristic:</b> Company Code
    <b>Variable Represents:</b> Multiple Single Values
    <u><b>This is the used ABAP code:</b></u>
    WHEN 'ZCCD'.
    CLEAR l_s_range.
    l_s_range-low = '2002;2004'.
    l_s_range-sign = 'I'.
    l_s_range-sign = 'EQ'.
    APPEND l_s_range TO e_t_range.
    <u><b>The system returns this message:</b></u>
    Value "2002;2004" is too long for variable ZCCD
    appreciate your help!
    //michael

    Eugene, Marcus
    it works now, thx a lot!
    Please find attached the final code:
    CLEAR l_s_range.
    l_s_range-low = '2002'.
    l_s_range-sign = 'I'.
    l_s_range-<b>opt</b> = 'EQ'.
    APPEND l_s_range TO e_t_range.
    CLEAR l_s_range.
    l_s_range-low = '2004'.
    l_s_range-sign = 'I'.
    l_s_range-<b>opt</b> = 'EQ'.
    APPEND l_s_range TO e_t_range.
    (Delta to Marcus's code is bold)

  • Batch number assignment

    Dear Gurus
    I have confirmed a production order say 100kg. Now while posting in MB31 I want to post in parts in 3 batches.But while posting the first part say 40kg system is automatically giving a batch number which is coming in deactivated mode i.e you cannot change.Again while posting the second part say 30kg system is giving the same batch number and not allowing me to post giving a message that you have posted once in that batch number- what to do ?
    Regards
    Sandip Sarkar

    Hi,
    The batch number is taken by system from Production Order. You can't change the batch number. As per standard practice with one production order only one batch can be produced. You can not produce morethan one batch using same production order.
    Hope this will help.
    Navin

  • Assigning a customer exit variable to a user entry variable

    Hello all,
    I'm creating a PCA query and would, in a certain column, like to show the year's cumulated value (key figure amount), based on documents posted up until a certain posting period (specified via a user entry). E.g. from 01.2006 to [user entry] where the "from"-year is also dependent of the user entry.
    1) Where do I do this coding (transaction code/function module etc..)?
    2) How do I do this coding?
    3) Does this kind of variables exist as standard? If yes, which one?
    Thanks!!!
    Best regards,
    Fredrik

    Hello again,
    I have now created a new input variable named 'Z_FPER' (single value)  which I want to read into the exit variable...
    I debugged the query and found out that the value of I_STEP is 1, which is wrong. It should be I_STEP = 2... However, I have definied my user exit variable as "no input" and "mandatory". What else should I do to make it a '2'?
    Thanks,
    Fredrik
    P.S. This is the code:
    *&  Include           ZXRSRU01
    DATA: L_S_RANGE TYPE RSR_S_RANGESID.
    DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
    CASE I_VNAM.
    WHEN 'Z_FISCPE'.
    IF I_STEP = 2. "after the popup
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'Z_FPER'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4)."low value, e.g.200001
    L_S_RANGE-LOW+4(3) = '001'.
    L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW. "high value = input
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    ENDIF.
    ENDCASE.

  • Batch internl number assignment

    Hello SAP gurus,
        Lets suppose i have finished product, semifinished product and raw material with me.I am managing all of them in batches.I want to use automatic creation of batch (internal number assignment) for them.Now my question is i want to use different number ranges for all of them.
            Currrently its using the same number range for all of them.Suppose if i created one production order for semifinished product than its giving it batch no. 0000001.Again if i create production order for finished material than its giving it batch no. 0000002.
        I want different number ranges for both of them by internal number ranges only.
        plz guide me in solving this problem.

    Hi
    you want to maintain the different number ranges based on Material Types (Finished/Semi-finished/Raw material).
    Please follow SPRO IMG Path
    Logistics General >> Batch Management >> Batch Number assignment >> Configure Customer Exit for Intern. Batch Number assignment.
    Going through node documentation, you need to use one of the fucntional module exist incorporated in SAP enhencement SAPLV01Z.
    Pl go through documentation in detail and incorporate required ABAP code in the respective functional module Exit.
    Thanks
    JK

  • Creation of Batch number

    Hi Experts,
    I have a probelm with the Transaction MIGO to restrict the ignore the batchnumber entered by the user.
    If the user is not enter the batch number, then i can generated the new number by using the following 2 UE's
    EXIT_SAPLV01Z_001 (ZXVBZU01)  & EXIT_SAPLV01Z_002 (ZXVBZU02) and it is working fine.
    If the user enters , then System first check that whether it is already exist in the Database . If it won't find then automatically it is considering the same number.Which needs to be stopped.
    Any body has an idea about this requirement, to ignore the user entered value.
    Actually, there are 2 more exists, EXIT_SAPLV01Z_011& EXIT_SAPLV01Z_012 there i can't change the value of the batch number.
    Any suggestion or Any alternative way or Any idea Please......?
    Warm Regards,
    Vijay

    Hi,
    I think you can restrict by using FM EXIT_SAPLV01Z_001, this i copied the FM documentation for your reference. Just read the FM documentation you will get an idea
    You can restirict by using automatic generation using number ranges
    <<Function module Documentation>>
    Functionality
    You can use this customer function call (CFC) to replace the standard number range (object, subobject, number range, and year) with one of your own. This is used subsequently to determine a new batch number.
    Number assignment is carried out using the central number assignment.
    The communication structure X_BNCOM contains the application data known up to this time. You can extend this structure in the DDIC using structure BNCOMZ.
    Using the parameter CUST_NO_INTERNAL, you can suppress the number assignment function. Then you can either generate a batch number in function module EXIT_SAPLV01Z_002 using your own criteria or suppress the entire number assignment function.
    Using the parameter MESSAGE_WHEN_AUTO, you can decide if a dialog box is to appear before a new number is assigned. This only happens during online processing.
    Example
    You can define internal batch number assignment according to your requirements via the enhancement SAPLV01Z with the exits EXIT_SAPLV01Z_001 and EXIT_SAPLV01Z_002
    SAP delivers a total of 6 examples for batch number assignment:
    1. Copying the production order number to the batch number
    2. Copying the sales order number to the batch number
    3. Material-type-dependent batch number assignment
    4. Material-number-dependent batch number assignment
    5. Including the date in the batch number
    6. Including the plant number in the batch number
    For examples 1 and 2 you have to use the exits EXIT_SAPLV01Z_001 and EXIT_SAPLV01Z_002.
    For examples 3 and 4 you have to use the exit EXIT_SAPLV01Z_001.
    For examples 5 and 6 you have to use the exitEXIT_SAPLV01Z_002.
    For a detailed description of the examples, see below.
    Prerequisites
    1. Internal batch number assignment via the customer exit is activated:
    To do this, in Customizing, choose Logistics general -> Batch management -> Batch number assignment -> Activate internal batch number assignment.
    2. Maintaining the number range object
    Two number range objects are provided for batch number assignment:
    Standard number range for batch number assignment BATCH_CLT
    Number range for material-type-dependent or material-number-dependent batch number assignment BATCH_MAT
    Activities
    1. Use the SAP enhancement SAPLV01Z:
    a) In transaction CMOD, create either a new project or use an existing project.
    b) Add the SAP enhancement SAPLV01Z to the project.
    2. Copying the example code:
    a) Choose Component.
    b) Choose Change.
    c) Choose:
    EXIT_SAPLV01Z_001 for examples 1-4
    EXIT_SAPLV01Z_002 for examples 1-2 and 5-6
    d) Choose Edit -> Copy SAP source text.
    The example code is copied to the relevant table in the function module exit.
    e) To copy the example, remove the comment symbol before the include it pertains to.
    3. Activate the project.
    When you activate the project, the enhancement with the function module exits EXIT_SAPLV01Z_001 and EXIT_SAPLV01Z_002 comes into effect.
    Examples
    Example 1
    Copying the production order number to the batch number
    When a batch is produced, the process order number or production order number is copied as the batch number. This type of assignment is only possible in connection with process orders or production orders.
    Outwith an order, a number range is determined for batch number assignment. In this example, it is the standard number range BATCH_CLT.
    If the order has not yet been saved (for example, when a number is assigned when the order is created), a temporary number is created. A message appears prompting you to save the order. The system then assigns an order number which is accepted as the batch number.
    The system checks whether a batch already exists with this number. If this is the case, the system aborts internal batch number assignment with a corresponding error message.
    Note:
    In this example, note that the include LXVBZB21 in EXIT_SAPLV01Z_002 has to be activated at the same time, as actual batch numbers are not assigned until this is activated.
    Example 2
    Copying the sales order number to the batch number
    If a batch number is assigned in connection with a sales order, the sales order number is accepted as the batch number.
    If there are no sales orders, a number range object is defined with a number range from which the batch number is taken. If a batch already exists with this sales order number, the batch number is assigned externally.
    Note:
    In this example, note that the include LXVBZB22 in EXIT_SAPLV01Z_002 has to be activated at the same time before actual number assignment can take place.
    Example 3
    Material-type-dependent batch number assignment
    In the number range object BATCH_MAT a separate sub-object is created for each material type. Note that the number range object is maintained accordingly or batch number assignment cannot take place.
    For example, if the material "flour" belongs to raw materials, it is maintained in the sub-object ROH, and the batch number is taken from the same number range as the material "eggs" which also belongs to the raw materials group.
    Example 4
    Material-number-dependent batch number assignment
    In material-number-dependent batch number assignment, materials that are handled in batches must be maintained in the table BNMAT, which specifies the assignment of the material to the number range.
    If there is no assignment in the table, the system aborts batch number assignment. An error message appears informing you that batch number assignment is not possible and specifying the table that has to be maintained.
    Each material number is assigned a number range object, a sub-object, and a number range in the table BNMAT. This is how each material receives its own batch number range.
    The number range object BATCH_MAT is an example of this. The material numbers are divided into groups via their material type that match the sub-object. Each material number is then assigned its own number range by table BATCH_MAT. The number ranges used must be maintained in the number range object.
    Examples 5 and 6
    Including the date or plant number in the batch number
    The number ranges for the batch numbers must be defined in a way that ensures that no characters are overwritten by the templates.
    Parameters
    X_BNCOM
    CUST_NO_INTERNAL
    NR_RANGE_NR
    OBJECT
    SUBOBJECT
    TOYEAR
    MESSAGE_WHEN_AUTO
    MESSAGE_DONE
    Exceptions
    CANCELLED
    Regardas
    Krishna

Maybe you are looking for