Saturday, May 31, 2008

SAP function Module to get vendor Bank Details

SAP function Module to get vendor Bank Details

If you wish to extract the bank details of a particular vendor then you can use the following BAPI.

BAPI/Function Module  for vendor bank details extraction

BAPI_VENDOR_GETDETAIL


Please find below the code to extract vendor Bank Details.

REPORT ZEX_CUSTOMERBANK .


Parameters: p_kunnr like BAPICUSTOMER_ID-CUSTOMER,
            p_bukrs like BAPICUSTOMER_ID-COMP_CODE.

Data: ty_knbk type knbk,
      ty_custadd type BAPICUSTOMER_04,
      ty_custgendet type BAPICUSTOMER_KNA1,
      ty_custcompdet type BAPICUSTOMER_05,
      d_ret         like BAPIRET1.

Data: wa_custadd like ty_custadd,
      wa_custgendet like ty_custgendet,
      wa_custcompdet like ty_custcompdet.

Data: int_knbk like ty_knbk occurs 0.

CALL FUNCTION 'BAPI_CUSTOMER_GETDETAIL2'
  EXPORTING
    CUSTOMERNO                  = p_kunnr
   COMPANYCODE                  = p_bukrs
 IMPORTING
   CUSTOMERADDRESS              = wa_custadd
   CUSTOMERGENERALDETAIL        = wa_custgendet
   CUSTOMERCOMPANYDETAIL        = wa_custcompdet
   RETURN                       = d_ret
 TABLES
   CUSTOMERBANKDETAIL           = int_knbk      .

   if sy-subrc = 0.

   Endif.



Related Topics:

Read Vendor



No comments:

Post a Comment