<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BAPI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2054852#M424032</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi anup,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you know the BAPI name just call that in your program,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg: to get the list of all cost centers in a cost center group&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_COSTCENTERGROUP_GETDETAIL'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              controllingarea = 'ZZZ'&lt;/P&gt;&lt;P&gt;              groupname       = p_ccgrp&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;              return          = it_messages1&lt;/P&gt;&lt;P&gt;         TABLES&lt;/P&gt;&lt;P&gt;              hierarchynodes  = it_nodes1&lt;/P&gt;&lt;P&gt;              hierarchyvalues = it_kostl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Chandrasekhar Jagarlamudi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Mar 2007 11:33:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-06T11:33:26Z</dc:date>
    <item>
      <title>BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2054850#M424030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one tell how to use standard BAPIs provided by SAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2007 11:29:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2054850#M424030</guid>
      <dc:creator>anupam_srivastava2</dc:creator>
      <dc:date>2007-03-06T11:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2054851#M424031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Within SAp they can be used as normal function modules.&lt;/P&gt;&lt;P&gt;For example if the name of the bapi is : BAPI_PO_CREATE, then you should populate the parameters that the BAPI FM expects and then call it using &lt;/P&gt;&lt;P&gt;CALL FUNCTION Statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'BAPI_PO_CREATE'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2007 11:32:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2054851#M424031</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-06T11:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2054852#M424032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi anup,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you know the BAPI name just call that in your program,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg: to get the list of all cost centers in a cost center group&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_COSTCENTERGROUP_GETDETAIL'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              controllingarea = 'ZZZ'&lt;/P&gt;&lt;P&gt;              groupname       = p_ccgrp&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;              return          = it_messages1&lt;/P&gt;&lt;P&gt;         TABLES&lt;/P&gt;&lt;P&gt;              hierarchynodes  = it_nodes1&lt;/P&gt;&lt;P&gt;              hierarchyvalues = it_kostl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Chandrasekhar Jagarlamudi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2007 11:33:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2054852#M424032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-06T11:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2054853#M424033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;


this is the sample program using BAPI - 

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report Z_AMIT_BAPI *
*&amp;amp; *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; *
*&amp;amp; *
*&amp;amp;---------------------------------------------------------------------*

REPORT Z_AMIT_BAPI
no standard page heading line-size 255.

parameters: p_file like rlgrap-filename default 'C:tempemp.txt'.

data :begin of itab occurs 0,
pernr(8),
bdate(10),
edate(10),
mail(30) ,
end of itab.

data: begin of itab1 occurs 0,
pernr like BAPIP0105N-EMPLOYEENO,
bdate like BAPIP0105N-VALIDBEGIN,
edate like BAPIP0105N-VALIDEND,
mail like BAPIP0105N-ID,
end of itab1.
data: number like BAPIP0001-PERNR .
*data: LOCKINDICATOR like P0001-SPRPS value 'X'.

Start-of-selection.
Perform read_file.

loop at itab.
clear itab1.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = itab-bdate
IMPORTING
DATE_INTERNAL = itab1-bdate.
* EXCEPTIONS
* DATE_EXTERNAL_IS_INVALID = 1
* OTHERS = 2 .
IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = itab-edate
IMPORTING
DATE_INTERNAL = itab1-edate
* EXCEPTIONS
* DATE_EXTERNAL_IS_INVALID = 1
* OTHERS = 2
.
IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

move: itab-pernr to itab1-pernr,
itab-mail to itab1-mail.
append itab1.
number = itab1-pernr .



CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = number .
* IMPORTING
* RETURN = .

CALL FUNCTION 'BAPI_EMPLCOMM_CREATE'
EXPORTING
EMPLOYEENUMBER = itab1-pernr
SUBTYPE = '0010'
VALIDITYBEGIN = itab1-bdate
VALIDITYEND = itab1-edate
COMMUNICATIONID = itab1-mail.
* NOCOMMIT =
* IMPORTING
* RETURN =
* EMPLOYEENUMBER =
* SUBTYPE =
* OBJECTID =
* LOCKINDICATOR =
* VALIDITYBEGIN =
* VALIDITYEND =
* RECORDNUMBER = .

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = number.
* IMPORTING
* RETURN = .

endloop.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form read_file
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --&amp;gt; p1 text
* &amp;lt;-- p2 text
*----------------------------------------------------------------------*
FORM read_file .

DATA: full_file_name TYPE string.
full_file_name = p_file.

CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = full_file_name
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = itab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
.
IF SY-SUBRC &amp;lt;&amp;gt; 0.
MESSAGE e000(000) WITH 'Upload-Error; RC:' sy-subrc.
ENDIF.


ENDFORM. " read_file 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2007 11:41:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2054853#M424033</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-06T11:41:15Z</dc:date>
    </item>
  </channel>
</rss>

