01-16-2008 2:24 PM
HI,
I need help on BAPI's , can anyone provide me with the way of programming bapi's (complete).
Thanks.
Regards,
Harun.
01-16-2008 3:15 PM
Hi,
Please check this,
SAPGenie.COM -> SAP Technical -> ABAP -> BAPI ->BAPI Step by Step Example
BAPI Programming guide: -
http://help.sap.com/saphelp_nw04/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm
BAPI user guide: -
http://help.sap.com/saphelp_46c/helpdata/en/7e/5e115e4a1611d1894c0000e829fbbd/frameset.htm
BAPI STEP BY STEP PROCEDURE: -
http://www.sap-img.com/abap/bapi-step-by-step-guidance.htm
Example:-
http://www.erpgenie.com/abap/bapi/example.htm
PDF download: -
Reward points for helpful answers.
Regards,
Keerthi
01-16-2008 2:51 PM
Hi,
Check this simple BAPI program.
REPORT zbapi
MESSAGE-ID aq LINE-SIZE 255 NO STANDARD PAGE HEADING.
PARAMETERS : p_vbeln LIKE vbak-vbeln DEFAULT '6001099',
p_updflg(1) default 'D'.
DATA :
logic_switch LIKE bapisdls,
order_header_in LIKE bapisdh1,
order_header_inx LIKE bapisdh1x,
order_item_inx LIKE bapisditmx OCCURS 0 WITH HEADER LINE,
order_item_in LIKE bapisditm OCCURS 0 WITH HEADER LINE,
return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
t_schdlx LIKE bapischdlx OCCURS 0 WITH HEADER LINE,
t_condx LIKE bapicondx OCCURS 0 WITH HEADER LINE.
*
REFRESH : order_item_inx,order_item_in.
REFRESH : t_schdlx,t_condx.
t_schdlx-updateflag = 'D'.
APPEND t_schdlx.
t_condx-updateflag = 'D'.
APPEND t_condx.
*
CLEAR order_header_inx.
CLEAR order_header_in.
order_header_inx-updateflag = 'U'.
IF p_updflg = 'U'.
**************************************
sub item with wbs
CLEAR : order_item_inx,
order_item_in.
order_item_in-itm_number = '020100'.
APPEND order_item_in.
*
order_item_inx-itm_number = '020100'.
order_item_inx-wbs_elem = 'X'. " clear
order_item_inx-updateflag = 'U'. " delete
APPEND order_item_inx.
***************************************
************************
header item with wbs
CLEAR order_item_in.
order_item_in-reason_rej = 'Y6'.
order_item_in-itm_number = '020000'.
APPEND order_item_in.
*-
CLEAR order_item_inx.
order_item_inx-itm_number = '020000'.
order_item_inx-reason_rej = 'X'.
order_item_inx-wbs_elem = 'X'. " clear
order_item_inx-profit_ctr = 'X'. " clear
order_item_inx-updateflag = 'U'. " delete
APPEND order_item_inx.
ELSE.
header item with wbs
CLEAR order_item_in.
order_item_in-itm_number = '020000'.
CLEAR order_item_inx.
order_item_inx-itm_number = '020000'.
order_item_inx-updateflag = 'D'. " delete
APPEND order_item_inx.
ENDIF.
REFRESH return.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_in = order_header_in
order_header_inx = order_header_inx
logic_switch = logic_switch
TABLES
return = return
order_item_in = order_item_in
order_item_inx = order_item_inx.
*
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ULINE:/.
LOOP AT return.
WRITE:/
sy-vline,
return-type,
(04) return-id,
return-number,
sy-vline,
(100) return-message ,AT sy-linsz sy-vline.
ENDLOOP.
ULINE:/.
Regards,
Subbu
01-16-2008 3:15 PM
Hi,
Please check this,
SAPGenie.COM -> SAP Technical -> ABAP -> BAPI ->BAPI Step by Step Example
BAPI Programming guide: -
http://help.sap.com/saphelp_nw04/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm
BAPI user guide: -
http://help.sap.com/saphelp_46c/helpdata/en/7e/5e115e4a1611d1894c0000e829fbbd/frameset.htm
BAPI STEP BY STEP PROCEDURE: -
http://www.sap-img.com/abap/bapi-step-by-step-guidance.htm
Example:-
http://www.erpgenie.com/abap/bapi/example.htm
PDF download: -
Reward points for helpful answers.
Regards,
Keerthi