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: 

EXIT_SAPLV01Z_014. Changing characteristic values at Batch creation.

Former Member
0 Kudos
4,491

Hi experts,

I need to change the value of one characteristic (type CHAR) during Batch creation (transaction MSC1N).

Searching in the program, I have found that FM VB_CREATE_BATCH is called. Inside the FM, I have found also the CUSTOMER-FUNCTION '014' (EXIT_SAPLV01Z_014), which it seems to be the only exit that allows to change the values of the characteristic.

My questions are:

- does anybody know how this exit works? I mean, how I have to manipulate the TABLES to get modified the value of the characteristic that I need to change?

- does anybody know any other way to change the value of the characteristic at batch creation?

Thank you very much in advance!

1 ACCEPTED SOLUTION

Former Member
0 Kudos
852

Hi onofre,

Check the following link:

Hope this will help you...

14 REPLIES 14

Former Member
0 Kudos
853

Hi onofre,

Check the following link:

Hope this will help you...

0 Kudos
852

Hi Rajeev,

I knew this thread, but I have to modify the batch during creation, not after. That's why the BAPI_BATCH_CHANGE is not useful for me.

I need to modify the Batch during creation, neverthless the transaction, it could be with MSC1N or at production order creation, for example.

I have activated also the exit 12 of the same enhancement EXIT_SAPLV01Z_012 which is needed and passed the correct (I think) values.

During the execution, the program executes the EXIT_SAPLV01Z_014 ( I have seen it by debugging) but the characteristics remains unchanged.

I don't know what more I have to do.

Thanks,

Onofre

0 Kudos
852

Hi,

Try the Function Exit EXIT_SAPLV01Z_013 and see if it helps.

The documentation of the Function Exit says:


 EXIT_SAPLV01Z_013. You can use this exit to assign characteristic
 values to the batch master record of the new batch.

 Functionality
     You can influence the new batch master record in the structure
     BATCH_MASTER_DATA.
     In the parameter BATCH_VALUATION_TYPE, you can specify the type of batch
     valuation, if the material is valued separately.

See if this helps.

Regards,

Abhisek.

0 Kudos
852

Hi Abhisek,

Thanks for your help. I would try the 013, but we have the batches defined independently of werks, so the data is in MCH1 rather in MCHA, so the field BWTAR has no sense for us.

Regards,

Onofre

0 Kudos
852

Hi Onofre,

If this too does not help then you could search for a suitable Implicit Enhancement Point/Enhancment Point/Enhancement Section in the calling program and change the requisite field there.

Check in debug mode where the control is returned after calling EXIT_SAPLV01Z_014. Seacrh for a suitable Implicit Enhancement Point/Enhancment Point/Enhancement Section in that code and change the field value.

Or you could also use field symbols to change the field value.

For further details as to "How to use Field symbols to change values in standard code?", please refer to the link:

[https://www.sdn.sap.com/irj/scn/profile?userid=3766309]

Hope the above information helps.

Regards,

Abhisek.

0 Kudos
852

Thanks Abhisek.

I am thinking also in Implicit Enhancement Point, but I find that maybe the consistency of the characteristic would be impacted. For example, I would use the bapi_batch_change from an enhancement point, but the batch is loked and I can not modify it.

I have found several suitable enhancementes but I really don't see how to modify the values without impacting the consistency.

Regards,

Onofre

0 Kudos
852

Hi Onofre,

If you can mention the program name and section of the code in question, then I could try and suggest some that might prove helpful to you.

Regards,

Abhisek.

0 Kudos
852

Yes, in the FM VB_CREATE_BATCH, include LV01ZF04 you can find the call to the CALL CUSTOMER-FUNCTION '014', which correspond with the EXIT_SAPLV01Z_014. In that part of coding there are several enhancements, and I think that it's the correct point.

Thanks and best regards,

Onofre

0 Kudos
852

Hi Onfore,

In the Function Module VB_CREATE_BATCH, just before CALL CUSTOMER-FUNCTION '013'

there is a piece of code:


*** internal BADI
    TRY.
        GET BADI g_badi_batch_data_change_int.

        CALL BADI g_badi_batch_data_change_int->change_batch_data
          EXPORTING
            is_bncom        = x_bncom
            iv_ref_material = ref_matnr
            iv_ref_batch    = ref_charg
            iv_ref_plant    = ref_werks
          CHANGING
            cs_mcha         = ymcha.

      CATCH cx_badi_not_implemented.
    ENDTRY.
***

The above piece of code refers to Standard Implementation of BADI BADI_BATCH_DATA_CHANGE_INT. Insidethe method CHANGE_BATCH_DATA of the implementation there is an Implicit Enhancement Point at the end of the method just before the statement ENDMETHOD.

I think this is the best place to write your requisite pice of code as the changing parameter of the method contains a structure of type MCHA.

But please check in debug mode if any better suitable Enhancement Point/Section exists.

Hope the above information helps.

Regards,

Abhisek.

0 Kudos
852

Hi Abhisek,

I really appreciate your help. Anyway, the interface of the suggested BAdI doesn't contain the values of the characteristics. I need to change the characteristic value during the creation of the batch, so I am afraid that this BAdI would not be useful for me.

Thanks and best regards,

Onofre

Former Member
0 Kudos
852

Hello!

Look at this exits:

CLFM0001

CLFM0002

BADI:

BATCH_MASTER method CHECK_CLASSIF_BEFORE_SAVE

0 Kudos
852

Hi Andrey,

I'm afraid that your proposal wouldn't work also.

The BAdI you suggested it's a check BAdI, you can only check the values, but you can not change them, and I need to change the values.

The other two user exits are triggered in other process diferent from batch creation via Production Order.

Thanks anyway,

Onofre

0 Kudos
852

Hi Onofre,

have solved? I have the same problem. you would have some useful info for me?

I have to change the value of a characteristic during good movement 101 from production order

many

thanks!!!

Former Member
0 Kudos
852

Please kindly refer to this thread:

if you don't want to enter the classification buttom,please use EXIT_SAPMM07M_004.

else please use the EXIT_SAPLV01Z_014 .

While you are use the EXIT_SAPLV01Z_014 ,please active the EXIT_SAPLV01Z_012 firstly.

Thanks

Wilber