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: 

changing PSTYV in sales order with BAPI_SALESORDER_CREATEFROMDAT2

former_member322289
Participant
0 Kudos

hi all,

I'm having this trouble...

we are creating a Sales Order from PI calling directly the BAPI_SALESORDER_CREATEFROMDAT2...

but, theres a field than I have to change... the PSTYV must be TANN when the VBAP-NETWR is 0.

I've used the MV45AFZZ program for the exit... but no in the move_field_to_vbap ('cause it doesn't work form me), I used this one:

FORM USEREXIT_SAVE_DOCUMENT_PREPARE.
data: l_tabix type i VALUE 0.

if xvbak-AUART = 'ZCO'.
  loop at xvbap.
    add 1 to l_tabix.
    if xvbap-netwr EQ 0.
      xvbap-PSTYV = 'TANN'.
      modify xvbap index l_tabix TRANSPORTING pstyv .
    endif.
  endloop.
endif.

ENDFORM.

and with this, when the sales order is created, my PSTYV field if NETWR = 0, now is TANN.... but this is NOT the solution 'cause I can't make an Invoice... I have an incompletion LOG....

but, if I change the field manually appears a message: New pricing carried out ( Message no. V1209 ).

and with this... I fix the problem.... but, you can see than I need it automatically....

so I think, than with my exit, I'm only changing the PSTYV value, but no all the changes than this need...

thanks in advance...

Regards..

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

U should run the exit USEREXIT_NEW_PRICING_VBAP (include MV45AFZB) in order to force a new pricing

Max

5 REPLIES 5

Former Member
0 Kudos

Hi

U should run the exit USEREXIT_NEW_PRICING_VBAP (include MV45AFZB) in order to force a new pricing

Max

0 Kudos

OK, let me try!...

0 Kudos

Apart from that and also


ORDER_ITEMS_IN-ITEM_CATEG =  " Value here
ORDER_ITEMS_INX-ITEM_CATEG =  " Value here

0 Kudos

just try: apart from above, also check about setting of UPDATION flags, like UPDKZ = 'U'.

thanq

0 Kudos

thanks All...

the solution was implements the User Exit : USEREXIT_NEW_PRICING_VBAP ...

again, Thanks a LOT!!!