cancel
Showing results for 
Search instead for 
Did you mean: 

Forwarding agent in Sales order Pricing

Former Member
0 Kudos

Dear all,

My client want to bring the freight paid to the forwarding agent  in the sales order.

i tried creating the access seq with vendor plant and customer . but the Vendor field was in yellow ! mark. so searched the SCN and found some helpful data  which was shared

I appended a structure KOMKAZ to add a Z-FIELD "ZAGENT" of type LIFNR.

The field is now available in field catalogue. I saved the condition records as required.

I populated this field ZAGENT in USER EXIT

USEREXIT_PRICING_PREPARE_TKOMK.

DATA: ws_agent type LIFNR.

      IF VBAK IS NOT INITIAL.

         SELECT SINGLE LIFNR FROM KNVP INTO ws_agent WHERE KUNNR = VBAK-KUNNR

                                     AND  VKORG = VBAK-VKORG

                                     AND  VTWEG = VBAK-VTWEG

                                     AND  SPART = VBAK-SPART

                                     AND  PARVW = 'LF'.

         IF SY-SUBRC = 0 AND ws_agent IS NOT INITIAL.

             TKOMK-ZAGENT = ws_agent.

         ENDIF.

      ENDIF.

This is how I was able to determine condition records in Sales document.

the same followed and the price i maintained in VK11 was picked up correctly.

but if i change the vendor in the SO the Price is showing still for the same old vendor the field is not updating.

found the reason is since picking from KNVP  even if i have two forwarding agent it is considering the only same old vendor.

Any input will be helpful

Regards

Accepted Solutions (1)

Accepted Solutions (1)

jpfriends079
Active Contributor
0 Kudos

Does that mean? You are not determining your desired partner(Forwarding Agent) in respective sales doc. For sales doc relevant partner, you should pick value from Table VBPA, instead of KNVP

Please refer my following post, where you can find list of std field that automatically re-determine the pricing:

Thanks, JP

Former Member
0 Kudos

Hi,

but table VBPA dont get updated till i save the sales order . is it possible to update the price when i change the vendor.

the above user exit is used to bring the Forwarding agent to be picked for Pricing.

Regards

shashi_thakur
Contributor
0 Kudos

Hi,

Pick your Vendor value from XVBPA structure which contains the values of the Partners at run time.

Regards,

Shashi Thakur

Answers (2)

Answers (2)

Former Member
0 Kudos

If everything else is working fine for you, just use XVBPA instead of KNVP. And that is obvious, at first place only you shouldn't have used KNVP.

Former Member
0 Kudos

HI  sorry for late reply

XVBPA was the right one now its working fine

Thanks for the input

Regards

Lakshmipathi
Active Contributor
0 Kudos
and the price i maintained in VK11 was picked up correctly.

I presume, the price is nothing but freight payable to vendor in which case, the condition record should have been maintained in TK11 and not VK11

G. Lakshmipathi