cancel
Showing results for 
Search instead for 
Did you mean: 

Logistic costs rounding issue in GTS

Former Member
0 Kudos

Hi Gurus,

I am new in GTS. I have a question on the rounding issue of logistic costs.

In ERP billing, the billing item has qty of 4 pieces and total legal net value is USD945.46. This is passed to GTS and the single item in ERP is segregated into 3 items in GTS for different country of origin:-

1) item 10 - Country of Origin YU - 2 pieces with value USD472.73.

2) item 20 - Country of Origin GU - 1 piece  with value USD236.37.

3) item 30 - Country of Origin TR - 1 piece   with value USD236.37.

Thus, the total in GTS becomes USD945.47 and causes the 1cent discrepancy in GTS and ERP.

Therefore, I would like to know how and where to check the logistic costs calculation in GTS.

- How is the item of same material to be segregated by 3 countries of origin in GTS?

- Where is the place to calculate / distribute the prices to the segregated items? Is there any configuration involved? Do you know which ABAP program / fm is involved in this calculation?

Please advise. Many thanks.

Accepted Solutions (1)

Accepted Solutions (1)

former_member215181
Active Contributor
0 Kudos

Hi Chiew Ngee Ho,

I would suspect that the splitting you describe has already occurred in the ERP system, rather than in GTS.  To be sure, set a break-point near the beginning of Function Module /SAPSLL/CD_SDOC_R3, and check the number of item entries when saving a Billing Document.

Assuming the split is coming from the ERP system, you could check & correct the pricing in BAdI /SAPSLL/IFEX_SD0C_R3 to remove the rounding errors.

If you are sure that the splitting occurs in the GTS system, please let us know.  Then we'll do more analysis...

Regards,

Dave

Former Member
0 Kudos

Hi Dave Willis,

Thank you very much for your prompt reply.


The split by country of origins is determined by the country code in serial no. in Handling Unit in ERP.

I did follow your advise to debug Function Module /SAPSLL/CD_SDOC_R3. However it still remains one line item, same with the billing, in the last line of this function module. So I think the splitting is not done here, but in GTS. Do you know any place of coding of the document posting in GTS that  I should go debug how the splitting done and cost calculateD? Thank you very much!

former_member215181
Active Contributor
0 Kudos

I checked the code in GTS.  As I expected, each billing item can only generate ONE item in the Customs Declaration.  That is perfectly logical, since there can be no basis for splitting - for example, a single billing item cannot possibly contain several Countries of Origin.

You should check the number of items right at the start of the Function Module, in table IT_ITEM_NEW.  FYI, the Net Value of each item is transferred to GTS.

Regards,

Dave

Former Member
0 Kudos

Hi Dave,

Thank you very much for your advices. It is very helpful and it led me to the correct direction.

FM /SAPSLL/CD_SD0C_R3 will send the exact number of items in ERP billing to GTS. In include program /SAPSLL/LCD_PI_R3F00, it will call RFC '/SAPSLL/API_6800_SYNCH' to pass the ERP billing info to GTS. In GTS, I found out that there is existing enhancement in FM '/SAPSLL/API_6800_SYNCH' ,that I did not aware earlier, to change the single line item to be multiple line items splitting by Serial Number ( the serial no. indicates the Country of Origin). So I can see the duty values in internal table ITM_DUC_VALUE_DATA. Because its field VALUE contains 3 decimal places, I am curious to know where and how it round up the value to be 2 decimals as shown in the Custom Declaration Document, so that I can add the round up fix. Or is there any BADI I can apply to modify the Duty Value before Custom Declaration Document creation? Please advise. Thank you again.

former_member215181
Active Contributor
0 Kudos

I'm glad you found the answer.

The standard rounding is carried out simply by moving the field to one that only has 2 decimals.

To take care of the rounding discrepancy, your developer could use the following strategy:

  1. Before the split, MOVE the item value to a new field (for example lv_value_ori) of type /SAPSLL/ACW_NET_VALUE.
  2. After the split, loop around the split items and sum up the values into a similar field lv_value_new.
  3. Compare the contents of lv_value_ori with lv_value_new.
  4. If there is a difference, then sort the values table by value (descending), and subtract the difference from the first (most expensive) item.

I hope that answers your question.

Regards,

Dave

Answers (0)