Showing posts with label BAPI. Show all posts
Showing posts with label BAPI. Show all posts

Monday, May 20, 2013

BAPI for HCM Employee age calculation


CALL FUNCTION 'HR_AUPBS_AGE'
  EXPORTING
    pernr                  = p_pernr
    bsdte                  = sy-datum
*   REACTION               = ' '
 IMPORTING
   value                  = value
* EXCEPTIONS
*   RECORD_NOT_FOUND       = 1
*   OTHERS                 = 2
          .
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

Saturday, May 18, 2013

BAPI for HCM Employee information

DATA: org_assignment TYPE STANDARD TABLE OF  bapip0001b,
      personal_data TYPE STANDARD TABLE OF  bapip0002b,
      internal_control  TYPE STANDARD TABLE OF  bapip0032b,
      communication TYPE STANDARD TABLE OF  bapip0105b,
      archivelink TYPE STANDARD TABLE OF  bapitoav0,
      wa_org_assignment  LIKE  bapip0001b,
      wa_personal_data TYPE  bapip0002b,
      wa_internal_control  LIKE  bapip0032b,
      wa_communication LIKE  bapip0105b,
      wa_archivelink LIKE  bapitoav0.

CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'
 EXPORTING
   employee_id            = p_pernr    "Personnel No
*   LASTNAME_M             =
*   FSTNAME_M              =
*   FST_NAME_K             =
*   LST_NAME_K             =
*   FST_NAME_R             =
*   LST_NAME_R             =
*   ORGTXT                 =
*   JOBTXT                 =
*   POSTXT                 =
*   COSTCENTER             =
*   BLDING_NO              =
*   ROOM_NO                =
*   PHONE_NO               =
*   LIPLATE_NO             =
*   USERID                 =
   date                   = sy-datum
*   EXTENSION              =
*   READDB                 = FALSE
*   ORGTXT_LG              =
*   JOBTXT_LG              =
*   POSTXT_LG              =
*   AUTHORITY_CHECK        = 'X'
* IMPORTING
*   RETURN                 =
 TABLES
   org_assignment         =  org_assignment
   personal_data          =   personal_data
   internal_control       =   internal_control
   communication          = communication
   archivelink            =  archivelink.

Saturday, May 4, 2013

BAPI for Vendor Account Statement for a given Period

To get any vendor line items at a given period use BAPI 'BAPI_AP_ACC_GETSTATEMENT'
 
CALL FUNCTION 'BAPI_AP_ACC_GETSTATEMENT'
    EXPORTING
      companycode       = p_bukrs
      vendor            = p_lifnr            "Vendor
      date_from         = so_budat-low       "Date from
      date_to           = so_budat-high      "Date to
*   NOTEDITEMS        = ' '
* IMPORTING
*   RETURN            =
    TABLES
      lineitems         = i_bapi3008_2 .

BAPI for Vendor account balance at a key date

Use 'BAPI_AP_ACC_GETKEYDATEBALANCE' to get closing balance of a keydate.
 CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
    EXPORTING
      companycode      = p_bukrs 
      vendor           = p_lifnr
      keydate          = v_date
*   BALANCESPGLI       = ' '
*   NOTEDITEMS         = ' '
* IMPORTING
*   RETURN             =
    TABLES
      keybalance         = i_bapi3008_3 .

BAPI for Customer account statement for a given period

To get any customer line items at a given period use the BAPI. 
 CALL FUNCTION 'BAPI_AR_ACC_GETSTATEMENT'
    EXPORTING
      companycode       = p_bukrs
      customer          = p_kunnr
      date_from         = so_budat-low       "from_date
      date_to           = so_budat-high      "to_date
*   NOTEDITEMS        = ' '
* IMPORTING
*   RETURN            =
    TABLES
      lineitems         = i_bapi3007_2 .


Thursday, May 2, 2013

BAPI for Customer account balance at a key date


To get any customer account balance at any date use the BAPI. You can get opening or closing balance of any customer using this.


CALL FUNCTION 'BAPI_AR_ACC_GETKEYDATEBALANCE'
    EXPORTING
      companycode        = p_bukrs      "Company Code
      customer           = p_kunnr      "Customer Code
      keydate            = v_date       "Date
*   BALANCESPGLI       = ' '
*   NOTEDITEMS         = ' '
* IMPORTING
*   RETURN             =
    TABLES
      keybalance         = i_bapi3007_3 .

 

Sunday, April 28, 2013

BAPI for Vendor address

To get company details address call function BAPI_VENDOR_GETDETAIL.

Data:
  vendor TYPE   bapivendor_04,
  companydetail  TYPE  bapivendor_05,
  return1  TYPE  bapiret1,
  v_return LIKE TABLE OF bapiret2.

 CALL FUNCTION 'BAPI_VENDOR_GETDETAIL'
      EXPORTING
        vendorno      = wa_final_temp-lifnr
        companycode   = p_bukrs
      IMPORTING
        generaldetail = generaldetail
        companydetail = companydetail
        return        = return1
      TABLES
        bankdetail    = v_return.

Thanks

Sunday, April 21, 2013

BAPI for Company address

To get company details address call function BAPI_COMPANYCODE_GETDETAIL. It will return company  address including Telephone, Fax no.

CALL FUNCTION 'BAPI_COMPANYCODE_GETDETAIL'
  EXPORTING
    companycodeid             = p_bukrs
 IMPORTING
   COMPANYCODE_DETAIL        = wa_DETAIL
   COMPANYCODE_ADDRESS       = wa_ADDRESS
   RETURN                    = RETURN.

Thanks
Rizvi
UA-40152711-1