on 05-24-2011 2:01 PM
Hi Guru's,
Need your help and suggestion to post the G/L entries into R/3(BAPI_ACC_DOCUMENT_POST) from BPC.
Can i use the EXPORT_TD_TO_BADI package to post the G/L entries? or do i need to follow the same method mentioned in "How To... Retract data from BPC 7.5 NetWeaver to SAP ERP Cost Center Accounting, Part I"
Please suggest the better approach.
Thanks.
Dear BPC user,
BADI will be implemented in the BW system. You will be needing an expert ABAP resource to perform the above task.
Regards,
Shashank.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The BAdI for retraction is UJD_RETRACT.
Procedure
1.Log on to the SAP NetWeaver ABAP system.
2.Go to Transaction SE18 (BAdI Implementation).
3.Enter UJD_RETRACT in Enhancement Spot.
4.Choose Display.
5.Right-click on BAdI definition.
6.Choose Create BAdI Implementation.
7.Choose Create Enhancement Implementation.
8.Enter the enhancement implementation name and short text.
9.Enter the BAdI Implementation name, description, and class.
10.Implement the interface method IF_UJD_RETRACT~RETRACT.
11.Check and save the method.
Example
Example for cost center retraction
Data: ls_message type line of UJ0_T_Message.
ls_message-MSGID = 'ZDAVY'.
ls_message-MSGTY = 'E'.
ls_message-MSGNO = '000'.
ls_message-MSGV1 = 'MD Retract...'.
ls_message-MSGV2 = I_MORE_DATA.
Append ls_message to ET_message.
FIELD-SYMBOLS: <ls_data> TYPE any,
<lt_data> TYPE STANDARD TABLE,
<lv_ID> TYPE any,
<LV_SCALING> TYPE any.
data lv_ID(4) type c.
data lv_SCALING(1) type c.
data ls_MESSAGE1 TYPE BAPIRET2.
data lv_costcenter(10) type c.
ASSIGN ir_data->* to <lt_data>.
FIELD-SYMBOLS: <l_line> type string,
<l_id> type string.
DATA: lv_dummy(30) TYPE c.
.
data: l_mode type c.
DATA: BEGIN OF data_struc2,
ID(30) TYPE c,
EVDESCRIPTION(30) TYPE c,
SCALING(30) TYPE c,
PARENTH1(30) TYPE c,
END OF data_struc2.
data: BEGIN OF data_index_struc,
tabix type i,
END OF data_index_struc.
FIELD-SYMBOLS: <lt_err> TYPE STANDARD TABLE.
data data_index_table like table of data_index_struc.
Data: ls_message_err type line of UJ0_T_Message.
CREATE DATA er_error_data LIKE TABLE OF data_struc2.
ASSIGN er_error_data->* to <lt_err>.
loop at <lt_data> ASSIGNING <ls_data>.
assign COMPONENT 'LINE' of STRUCTURE <ls_data> to <L_line>.
*N,Cost Center 1001,H1,1,4321,1,,
if sy-subrc = 0.
l_mode = '1'.
split <L_line> at ',' into LV_ID lv_dummy lv_SCALING lv_dummy .
else.
l_mode = '2'.
ASSIGN COMPONENT 'ID' OF STRUCTURE <ls_data> to <lv_ID>.
ASSIGN COMPONENT 'SCALING' OF STRUCTURE <ls_data> to <lv_SCALING>.
lv_ID = <lv_id>.
endif.
clear ls_message_err-MSGV2.
clear lv_costcenter.
if lv_SCALING = 'Y'.
CALL FUNCTION 'ZDAVY_BADI_RETRACT_MD_ERP'
DESTINATION 'Q4ACLNT002'
EXPORTING
IV_COST_CENTER = lv_ID
IV_COMMIT = 'X'
IMPORTING
ES_MESSAGE = ls_MESSAGE1
EV_COSTCENTER = lv_costcenter.
if ls_MESSAGE1 is not initial.
ls_message-MSGID = ls_MESSAGE1-ID.
ls_message-MSGTY = ls_MESSAGE1-type.
ls_message-MSGNO = ls_MESSAGE1-number.
ls_message-MSGV1 = ls_MESSAGE1-message_v1.
ls_message-MSGV2 = ls_MESSAGE1-message_v2.
append ls_message to ET_message.
endif.
if lv_costcenter = '!'. "cost center already exists
ls_message_err-
MSGV2 = ' cost center ID already exists on Target System, reject!'.
else.
*success
lv_costcenter = 'Y'.
endif.
ELSE.
if lv_id = 'ID'.
ls_message_err-MSGV2 = ' header line, reject!'.
else.
ls_message_err-
MSGV2 = ' cost center ID cannot convert to number, reject!'.
endif.
ENDIF.
if lv_ID <> 'ID' and lv_costcenter <> 'Y'. "it is header line
*----
*Fill reject data
*----
data_index_struc-tabix = sy-tabix.
data_struc2-ID = lv_ID.
APPEND data_struc2 TO <lt_err>.
*----
*Fill reject error reason
*----
ls_message_err-MSGID = 'ZDAVY'.
ls_message_err-MSGTY = 'E'.
ls_message_err-MSGNO = '000'.
ls_message_err-MSGV1 = lv_ID.
ls_message_err-RECNO = data_index_struc-tabix.
Append ls_message_err to ET_error_reason.
endif.
else.
ls_message-MSGID = 'ZDAVY'.
ls_message-MSGTY = 'E'.
ls_message-MSGNO = '000'.
ls_message-MSGV1 = lv_costcenter.
*
Append ls_message to ET_message.
endif.
endloop.
Example for transaction data retraction
Data: ls_message type line of UJ0_T_Message.
ls_message-MSGID = 'ZDAVY'.
ls_message-MSGTY = 'E'.
ls_message-MSGNO = '000'.
ls_message-MSGV1 = 'Retract data TC...'.
ls_message-MSGV2 = I_MORE_DATA.
Append ls_message to ET_message.
FIELD-SYMBOLS: <ls_data> TYPE any,
<lt_data> TYPE STANDARD TABLE. .
data lv_P_acct(10) type c.
data lv_signeddata(15) type c.
data lv_curr(3) type c.
data lt_message1 type UJ0_T_Message.
FIELD-SYMBOLS: <l_line> type string.
ASSIGN ir_data->* to <lt_data>.
read table <lt_data> index 1 ASSIGNING <ls_data>.
if sy-subrc = 0.
loop at <lt_data> ASSIGNING <ls_data>.
assign COMPONENT 'LINE' of STRUCTURE <ls_data> to <L_line>.
ls_message-MSGID = 'ZDAVY'.
ls_message-MSGTY = 'E'.
ls_message-MSGNO = '000'.
ls_message-MSGV1 = ''.
ls_message-MSGV2 = ''.
ls_message-MESSAGE = <l_line>.
Append ls_message to ET_message.
endloop.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear,
Pls try with Badi UJD_RETRACT.
Thanks & regards,
Shashank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.