星期四, 八月 12, 2010

ABAP Label for Operands

  • Structured data types or data objects (structure)
    A component comp of a structured data type or a structure struct is accessed using the label struct-comp.
  • Instances of classes (objects)
    The label ref->comp is used to access a component comp of an object. The character -> is the object component selector
  • Classes

    The label class=>comp can be used to access a static component comp of a class without an instance of the class having to be created. The character => is the class component selector.


  • Interfaces

    The label

    intf~comp

    is used to access a component comp of an interface. The character ~ is the interface component selector.

  • Escape character for names
    The character ! can be written directly before a name in order to distinguish it from an ABAP word of the same name in a statement.

星期二, 八月 10, 2010

获取当前登录用户的profile.

data:  C_PROFILE type  table of BAPIPROF    ."STANDARD TABLE OF
DATA: wa_profiles LIKE LINE OF  C_PROFILE.
data  it_prof type BAPIPROF occurs 0.
DATA: it_roles TYPE TABLE OF bapiagr,
wa_roles LIKE LINE OF it_roles.

F_USERNAME = SY-UNAME.

CALL FUNCTION 'BAPI_USER_GET_DETAIL'
  EXPORTING
    USERNAME = F_USERNAME
  IMPORTING
    ADDRESS  = S_ADDRESS
  TABLES
    RETURN   = TAB_RETURN
     profiles = C_PROFILE
     activitygroups = it_roles.

LOOP AT it_roles INTO wa_roles.
 write: /,'Roles:',wa_roles-AGR_NAME.
ENDLOOP.
LOOP AT C_PROFILE INTO wa_profiles.
 write: /,'Profile::',wa_profiles-BAPIPROF,wa_profiles-BAPIPTEXT.
ENDLOOP.

星期四, 八月 05, 2010

SAP IMG的意思

IMG is the short form for Implementation Guide
即:IMG是单词实施指南的意思