cancel
Showing results for 
Search instead for 
Did you mean: 

SD Invoice Query error

Former Member
0 Kudos

In our company we run the same query (standard) for different Sales organization for invoice. For one specific type (liquid) material in one sales org query is picking the Net Weight and in other sales org its picking Gross weight. Any suggestion as what could be the reason.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Let us know what field you use for your query

Former Member
0 Kudos

The field used in the Query in Net Weight. The requirement is to pull the Gross weight in query and even if Net weight field is selected it gives the Gross Weight for ORG 1 (different Plants) and Net Weight for ORG 2. These are liquid products so Net Weight * Brix is equal to Gross weight. Below is the code for one of the addtional fields which doesnt contain the plants for ORG2. Can this be the reason for ORG 2 to just populate with Net weight as the code below doesnt apply to it.

  IF lips-werks = '6004' or
    lips-werks = '6005' or
    lips-werks = '6021' or
    lips-werks = '6700' or
    lips-werks = '6200'.
    g_werks = lips-werks.
ELSE.
    case lips-charg(1).
      when '4'.
        g_werks = '6004'.
      when '5'.
        g_werks = '6005'.
      when '1'.
        g_werks = '6021'.
      when '7'.
        g_werks = '6700'.
      when 'R'.
        g_werks = '6200'.
      when others.
        g_werks = '9999'.
      endcase.
ENDIF.

SELECT SINGLE RAW_SGTOT INTO RAW_SGTOT
FROM ZRAWSUGCOST
WHERE VKORG                = LIKP-VKORG
   AND MVGR5                = ATWRT
   AND WERKS                = g_werks.

if sy-subrc <> 0.
  SELECT SINGLE RAW_SGTOT INTO RAW_SGTOT
   FROM ZRAWSUGCOST
   WHERE VKORG                = LIKP-VKORG
     AND MVGR5                = ATWRT
     AND WERKS                = '9999'.
  if sy-subrc <> 0.
    clear raw_sgtot.
  endif.
endif.

Former Member
0 Kudos

I don't see the codes or how you pick netweight field.

former_member211616
Active Contributor
0 Kudos

goto se16 vbrk table and find the field ntgew (for net weight )

Jelena
Active Contributor
0 Kudos

This is all custom development and custom Z table. I'm suspecting "standard query" is also a custom query in SQ01. You need to contact an ABAP developer for your system, not sure forum can be of much help here.

But in general - yes, such hardcoding could be a reason data is displayed differently. An ABAPer should be able to address this.

Answers (3)

Answers (3)

Lakshmipathi
Active Contributor
0 Kudos

we run the same query (standard) for different Sales organization for invoice

Through which TCode, you were checking ??  May be if you can paste the screen shot showing the difference, it will be easy to propose suitable suggestion.

G. Lakshmipathi

former_member211616
Active Contributor
0 Kudos

Hi Uzma ,

There is two unit of measurment sales unit and base unit of measure from MM02

due to this you getting the different value

Regards

Ramesh

Former Member
0 Kudos

Ramesh,

That was the first thing i checked and for both sales org the materials were totally different (different aterial #'s) I couldnt find any that was common in both reports. In the infoset the field set is NET WEIGHT. I will research some more and will update this thread.

former_member184701
Active Contributor
0 Kudos

dear,

it would be a material master data.

run two sessions of MM03 for your material -

first one with "Sales: General/Plant" view for first sales org

and

second one with "Sales: General/Plant" view for second sales org

compare/ look after difference between 'Gross Weight' and 'Net Weight' fields

adjust the values if needed (use MM02)

regards,