Skip to Content
0
Former Member
Nov 09, 2006 at 03:57 PM

Change PIKMG at Delivery Save

809 Views

Hi all,

I'm trying to change pikmg (batch amount - not sure about the exact english word, sorry) in User exit USEREXIT_SAVE_DOCUMENT_PREPARE or USEREXIT_SAVE_DOC_BEFORE_PREP (MV50AFZ1) for VL01N but it doesnt work, because the old value is still saved.

The SAP doc (415716 with corresponding sample code) refers to changing the values in lips (after calling lips_bearbeiten_vorbereiten(sapfv50p) and before calling lips_bearbeiten(sapfv50p).

However pikmg only seems to be present in xlips and not lips . Looking up xlips definition shows:

INCLUDE STRUCTURE LIPSVB

which in term includes lips but also other fields (including pikmg).

I have tried changing the field directly in xlips which works fine and retains my updated value, but the old value is still saved to the db somehow. I tried marking updkz as 'U' for the changes lines in xlips, which results in an error at saving (makes sense, the doc is not created so this should remain 'I').

My code looks something like this:

-

-


* XLIKP loop weil mehr als eine Lieferung vorkommen kann
loop at xlikp where updkz ne updkz_delete.
*   Loop über Lieferposten
    loop at xlips where vbeln eq likp-vbeln
                    and updkz ne updkz_delete
                    .
      if myCondition blabla
         xlips-pikmg = myNewValue.
         modify xlips.
      endif.
  endloop.
endloop.

-

-


Frankly I'm at a loss here so I thought I'd ask if someone has any ideas. I tried searching the forums and saw a few similar issues but wasnt able to draw a conclusion from those.

Any help greatly appreciated. Thanks.

Chris