cancel
Showing results for 
Search instead for 
Did you mean: 

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

dearmas_arturo
Explorer
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Lakshmipathi
Active Contributor
0 Kudos

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

raymond_giuseppi
Active Contributor
0 Kudos

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)

rajkumarnarasimman
Active Contributor
0 Kudos

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