Skip to Content
avatar image
Former Member

How to get the fields Sales Org. / Customer / TAXM2 during Sales Order?

Hi,

I'm trying to get the fields Sales Org. / Customer / TAXM2 during Sales Order creation. Those fields will be used in another part of the logic. I've been in troubles to get it correctly.

This is the part of the code that's getting those fields:

44 ...

45 * Select the sales orgs

46 SELECT vkorg kunnr

47 FROM komk

48 into corresponding fields of ls_komk

49 where kunnr = komk-kunnr

50 and VKORG = komk-vkorg.

51 ...

When I activated the formula, the line 47 Result in an ABAP Dump, saying the "KOMK" is not defined in ABAP Dictionary as a table, projection view, or database view.

How can I get those fields during the Sales Order Creation and use in a Pricing Formula?

Thanks a lot.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 26 at 07:42 AM

    KOMK is a structure, so wont be accessed from database but from memory of a program, also during the creation of the Sales Order I hope you didn't expect to find information on this order already in database?

    You could look for 'user exit sales order SD' in SAP on line documentation and/or ask an Abaper to look for text 'KOMK' and other pricing structures in Include MV45AFZZ and then read carrefully the forms descriptions. (NB: There are also already many discussions/threads/documents on this in the forum)

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 25 at 08:31 PM

    Hi Arturo,

    "When I activated the formula, the line 47 Result in an ABAP Dump, saying the "KOMK" is not defined in ABAP Dictionary as a table, projection view, or database view."
    

    In error itself, it is clear that KOMK is not a table.

    "How can I get those fields during the Sales Order Creation and use in a Pricing Formula?"

    If you are writing the code sales order creation exit, you can read the values from the structure(ex: XVBAK/XVBAP) or internal table(XKOMP[]).

    Regards

    Rajkumar Narasimman

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 29 at 11:49 AM

    Can you explain what is the Business requirement for which, you were trying this ?

    Add comment
    10|10000 characters needed characters exceeded