cancel
Showing results for 
Search instead for 
Did you mean: 

New items creation before save

Former Member
0 Kudos

Hi,

I have a problem that is getting me in trouble, it seems I am unable of finding a solution.

I am using a user-exit (USEREXIT_SAVE_DOCUMENT_PREPARE, include MV45AFZZ). I have to use this exit to create new items in a sales document automatically and before the document is saved. It seemed very easy but I can't do it. I have searched a BAPI i could use to create the new items but I can't make it work and righ now I am trying to create the new items mysel by introducing them to the XVBAP table.

The problem with tat is that a popup window appears with an error, the sales document is incomple. The problem is that the conditions have not been espeified.

I try to put the condions in the XKOMV table but then I get an actualization error.

Maybe you can help me find and answer?

Thanks in advance,

Vicente Gómez.

P.D.: This thread is a variant of another thread of mine which doesn't seems to have a solution : (.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi again experts,

Well I have just tried anoher way of doig this using many Z BAPIs in my system hich I wasn't aware of. These BAPIS don't work in the end so I am about to try yet another thing.

I will try to use the BAPI SD_SALESDOCUMENT_CHANGE anyhow I will also try to read the note Roberto said (right now I am unable of).

This was just so easy in CRM, I hate being back n R/3. I'll keep reporting please keep answering if you can help.

Kind regards,

Vicente.

rmazzali
Active Contributor
0 Kudos

Hi Vincent,

I think you have to manage the UPDKZ flag also in XKOMV !

try it, and let me know if it works fine.

also remember to update the fields KNUMV, KPOSN, STUNR, ZAEHK, KAPPL accordingly

Roberto

Former Member
0 Kudos

(Claps at Roberto)

Right! That was it. I can't believe I didn't thought of it, in fact I even created the new entrances on XKOMV but I didn't thought of the update flag.

I still have a minor problem as the new item has many fields with no input (painted in grey) such as 'order quantity', 'first date'. But I think that's beacuse of the EPMEH flag ("Do multiple schedule lines exist?").

I'll work on this a little bit more.

Thanks a lot Roberto, and everyone :). This was getting me mad.

10 point OTW.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If you are talking about the pricing condition types which is causing the incomplition,then maintain the condition record for that condition type in VK11(Create condition master).This will solve your incompletion log problem.

Reward points if useful

Regards,

Amrish Purohit

Former Member
0 Kudos

Sorry, seems like I haven't explained myself quite well.

Yes, the problem are the pricing conditions but I have fullfilled that info in the XKOMV table, the pricing conditions are ok and so is the condition record.

When I put the pricing conditions in table XKOMV I can save the sales document but after that I get a message from the system, the update has been canceled. The problem seems that the status of the new item is missing.

I keep working with this problem.

BTW thanks and please keep trying.

Former Member
0 Kudos

Hi,

So does this mean that if you input sales order number in VBAP,you are unable to see the items.In other way it is not updating table ?

Regards,

Amrish Purohit

rmazzali
Active Contributor
0 Kudos

have you set the UPDKZ flag to 'I' for all the new stuff created ?

follow th guidelines in note 0381348 Using user exit, customer exit, VOFM in SD to solve this problem.

Roberto

Former Member
0 Kudos

Hi,

In fact I found another thread with this same problem and I found this same answer you gave to another guy Roberto : ).

Unfortunately I have tried to do de same at it didn't worked. I can't find where the problem is, I have a sales document with an item (10) I am copying that item into a new item (20) and making the UPDKZ flag to 'I'.

It doesn't work, in fact if I create the new item but I don't give it a number the item is created with numer 0000. This breaks the sales document.

Right now I have found that in the system there are several Z BAPIs that I didn't knew of. I'll be trying to use these.

Anyhow I have a dummy report that I am using for the tests, if anyone answers I will try the proposed answer and reward points.

Former Member
0 Kudos

If I input sales order number in VBAP? I didn't tried that, let's see...

OK f I try to create an item and I provide a position number the item is NOT created, remember that for this test I am copying an exisiting item and only changing the item number.

If I don't provide a number for the new item then an item with number 0000 is created and this isn't good because I can't delete that item.

As I said before I am trying another way but please keep asnwering if you have other suggesions. I'll try them and reward points (righ now I REALLY want to know why this happens).

Best regars,

Vicent.