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: 

BAPI or FM to update Sales Order characteristics

Former Member
0 Kudos

Hello all,

I was just wondering if anyone knows of a BAPI or FM to update the values in sales order characteristics.

Thanks,

Corinne

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try BAPI_SALESORDER_CHANGE.

Brian

9 REPLIES 9

Former Member
0 Kudos

Try BAPI_SALESORDER_CHANGE.

Brian

Former Member
0 Kudos

Hi Brian,

Thanks for that. I have been trying to get this to work - but with no luck ! Have you had any success with this ? Any examples of what needs to be populated. It also mentions in the documentation

"5. If you want to change configuration data, you must fill in all the fields"

So I am concerned that I will not be able to only update a few characteristics - but will have to provide them all.

Any help would be appreciated.

Thanks,

Corinne

Former Member
0 Kudos

Hi,

You could use FM CACL_OBJECT_VALIDATION_MAINT for that.

Regards,

D. Krijger

Former Member
0 Kudos

I haven't used the bapi for changing a sales order. I have used the bapi for creating a sales order with configurable materials. Look at for an example of how to fill in some of the structures.

Brian

Former Member
0 Kudos

Hi,

Thanks for both input.

I managed to get BAPI_SALESORDER_CHANGE to update the characteristics, however as suspected it updates all characteristics. Therefore if no values provided for certain characteristics - it sets these to be blank. As I only need to update 4 characteristic values - this is not ideal.

Also any suggestions on how to populate the input for CACL_OBJECT_VALIDATION_MAINT. I am really unsure what to put in the mandatory fields:

OBJECT

OBJECT_TYPE

CLASS

CLASS_TYPE

STATUS

Any help would be grateful.

Thanks and Regards,

Corinne

0 Kudos

Hi Corinne,

You are really having some fun with Sales Orders aren't you?

As all my points have gone (I had a burst of activity when I first started some days ago and managed to accumulate quite a few - now I am back to 6 for some reason) I thought I'd jump in with this probably effective but less than elegant solution.

Have you tried batch input? The BDC interface for characteristics in the sales order is pretty clean (rather than your configured screen, a generic screen pops up which allows you to enter the characteristic name and the corresponding value). I would suspect that using this would allow you to change only 4 characteristics without clearing all the others.

If you do a POPO as the OKCODE it will allow you to always position the item you want to work with at the top of the table control (preventing the need for complex line selection logic), then you can just pop in the characteristics for that item.

BDC may not be the most sexy of technologies, but it gets the job done.

Hope that helps.

Cheers,

Brad

0 Kudos

Hi Corinne,

I am also trying to use the BAPI_SALESORDER_CHANGE to update address details.

You have mentioned that you have managed to update.

Do I need to fill up all the fields in each table? without that is it not going to work?

Thanks & Regards,

Yaseen Mahammad.

0 Kudos

Hi,

Here is how you should fill FM <b>CACL_OBJECT_VALIDATION_MAINT</b>:

  • <u>object</u> : the object you want to change (for you, the sales order number)

  • <u>object_type</u> : the table in wich your object can be found (for you, EKKO)

  • <u>class</u> : the class name

  • <u>class_type</u> : the type of your class

  • <u>object_identification</u> : one line with the object :

- FIELD : the name of the field (for you, EBELN)

- VALUE : the object number (for you, the sale order number)

*<u>validation_maint</u> : one line for each characteristic to be updated

- CHARACT : the characteristic name

- VALUE : the value of the characteristique.

However, if this is not done yet, you may first want to "allocate" (i'm not sure about the english word ) your object to the class. For this, use FM <b>CACL_OBJECT_ALLOCATION_MAINT</b>. To use this FM, fill fields

<u>object

object_type

class

class_type

object_identification</u>

just as above.

When all this is done, call <b>FM CLAP_DDB_SAVE_CLASSIFICATION</b> (no parameter requiered) to save your job.

To summarize, call, in this order :

<b>CACL_OBJECT_ALLOCATION_MAINT</b> (create allocation between object and class)

<b>CACL_OBJECT_VALIDATION_MAINT</b> (fill characteristiques)

<b>CLAP_DDB_SAVE_CLASSIFICATION</b> (save characteristiques)

All the characteristiques that you have not filled in FM <b>CACL_OBJECT_VALIDATION_MAINT</b> will keep there old values.

Hope that will help you.

Yann

Former Member
0 Kudos

Hi Brad,

Yes lots of fun and games with sales orders !

Thanks for your suggestion - BDC coding has always been at the back of my mind - though I had hoped there would be a simple FM or BAPI to do the job for me.

I agree - the BDC code should be fairly simple to code and unless I get any more suggestions before Monday I think I will take this path.

Have a good weekend,

Corinne