SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

CO functional modules



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> CO
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Tue Sep 18, 2007 4:41 pm    Post subject: CO functional modules Reply with quote

K_GROUP_SELECT - Searching for cost-object groups via a pop-up window
Good for F4 (on value-request) function. Imports a field name and returns chosen
Group name for the field:
KSATR Cost element group
RACCT Account group
PRZNR Business process group
KSTRG Cost object group
KOSTL Cost center group
AUFNR Order group
LSTAR Activity type group
STAGR Statistical key figure group
SKOST Sender cost center group
SLSTA Sender activity group
PRCTR, RPRCTR Profit center group
VORNR Network activity group
POSID
Code:

constants: c_x(1) type c value 'X',
c_kstar like t800s-feld value 'KSTAR '.
parameters: p_kstar like t800s-setnr. "Cost Element Group

*--------- F4 for Cost Element Group -----------------------------------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KSTAR.
CALL FUNCTION 'K_GROUP_SELECT'
EXPORTING
FIELD_NAME = C_KSTAR
SELECT_SETS_WITHOUT_CLASS = C_X
IMPORTING
SET_NAME = P_KSTAR
EXCEPTIONS
NO_SET_PICKED = 02.
CASE SY-SUBRC.
WHEN 1. MESSAGE S003(GR).
WHEN 2. MESSAGE S004(GR).
ENDCASE.
*-----------------------------------------------------------------------


K_DOCUMENT_SELECT - CO: searches a document number according to certain criteria
also good for F4

K_F4_STANDARD_HIERARCHY_VALUE - Displays hierarchy tree for the given SETCLASS and Valuation Area
(requested in separate dialog window), returns selected value | node.
Import parameter SETCLASS: values see in GSETC type-pool.
Following standard hierarchies allowed in the FMs:
0101 - Cost Center
0106 - Profit Center
0107 - Business Process

K_F4_STANDARD_HIERARCHY_NODE
Code:

report zvv_f4_kkhi .
data it_values like rsmva occurs 0 with header line.

parameters: setclass like sethier-setclass obligatory default '0106',
p_value radiobutton group r1,
p_node radiobutton group r1.

if p_value = 'X'.
  call function 'K_F4_STANDARD_HIERARCHY_VALUE'
    exporting
      setclass = setclass
    tables
      values = it_values
    exceptions
      no_search_help_for_class = 1
      others = 2.
  if sy-subrc <> 0.
    write: / 'Return code =',sy-subrc.
  else.
    write: / 'Values:'.
    loop at it_values.
      write it_values.
    endloop.
  endif.
else.
  call function 'K_F4_STANDARD_HIERARCHY_NODE'
    exporting
      setclass = setclass
    tables
      values = it_values
    exceptions
      no_search_help_for_class = 1
      others = 2.
  if sy-subrc <> 0.
    write: / 'Return code =',sy-subrc.
  else.
    write: / 'Nodes:'.
    loop at it_values.
      write it_values.
    endloop.
  endif.
endif.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> CO All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.