Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Classification of sales order (VBAK) with CLFM_OBJECT_CLASSIFICATION

0 Kudos

Hello all,

how can I access the classification FM CLFM_OBJECT_CLASSIFICATION (transaction CL20N) from within a sales order?

I tried to execute the FM within the exit USEREXIT_CHECK_VBAK while using a button created by GuiXT. The problem is, that I can't reset the OK-Code which I have to set for the button. Therefor the system tells me via error message, that the OK-Code xxxx is not allowed.

Do you know any other possibilities to execute the classification FM through the creation/modification of a sales order?

One more thing: While creating a sales order, the order doesn't have an order number yet, so I can't execute the classifcation. This means, I have to post the order to get an order number and do the classification afterwards (VA02).

Any suggestions concerning that point?

If any of you has any suggestions, I would be quite happy.

Thanks in advance.

Harald

1 REPLY 1

JayR
Participant
0 Kudos

Hi Herald,

Instead of using the FM. This is the logic for displaying the values of variant material.

Try out this.

  • Extracting Object No for the Material

select single * from inob where objek = mara-matnr.

if sy-subrc eq 0.

select single * from kssk where objek = inob-cuobj.

if sy-subrc eq 0.

select clint posnr imerk into table i_ksml from ksml

where clint = kssk-clint.

if sy-subrc eq 0.

select objek atinn atwrt into table i_ausp

from ausp for all entries in i_ksml

where atinn = i_ksml-imerk.

endif.

endif.

endif.