Skip to Content
author's profile photo Former Member
Former Member

DESTINATION_APP writes on source app but not at destination app

Hi experts.

I'm having a trouble with a custom logic BADI-calling to write data from one application (CONS) to another one (ADQU).

I'm working in the following environment:

Komponente Release SP-Level Support Package SPP-Level Support Package Patch SAP_BW 740 0005 SAPKW74005 0000 - SAP Business Warehouse CPMBPC 801 0006 SAPK-80106INCPMBPC 0000 - CPM Business Planning and Consolidation

I have the following code at Script-Logic:

*DESTINATION_APP = ADQU

*SKIP_DIM = C_GROUPS

*RENAME_DIM C_ACCOUNT = A_ACCOUNT

*RENAME_DIM C_CATEGORY = A_CATEGORY

*RENAME_DIM C_ENTITY = A_ENTITY

*RENAME_DIM C_INTERCO = A_INTERCO

*RENAME_DIM C_DATASRC = P_DATASRC

*RENAME_DIM C_FLOW = P_FLOW

*RENAME_DIM C_CURRENCY = P_INPUTCURRENCY

*RENAME_DIM C_TIME = P_TIME

*START_BADI ZFCON_T_AD

PERIOD=2013.APR

LOGICA=T_AD

ENTITY=0175

QUERY = ON

WRITE = ON

*END_BADI

*COMMIT

When I test this code with UJKT tx. the new data are written in the source APP (CONS) instead of "ADQU", the target app.

When I debug the BADI and I can verify that just before exit it the CT_DATA table has the correct data, but they are written at "CONS" APP as i mentioned before.

Please, anyone can help with this issue.

I would be very grateful.

Thanks in advance.

Raúl Rozalén

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 11, 2014 at 06:01 PM

    Hi All, Hi Andrea...

    Sorry for reply so much time after my last post.

    Only a few lines to comment about the solution which was achieved using the tips that Andrea linked in his last answer.

    We use CUSTOM_LOGIC BAdI that must be called from Script Logic with parameters WRITE=OFF and QUERY=ON... After data transformation we have a CT_DATA table with the data that we want to write at ADQU model and then:

    * lt_write_back_adq is defined as an structured type with the same fields tha ADQU model

    create data wb_data type standard table of lt_write_back_adq with non-unique default key.

    assign wb_data->* to <td_write_back>.

    create data wb_errors type standard table of lt_write_back_adq with non-unique default key.

    assign wb_errors->* to <td_write_back_err>.

    * we pass data from CONS model structure to ADQU model structure

    loop at ct_data assigning <ls_ct_data>.

    assign_component: lf_c_account <lv_c_account>, lf_c_time <lv_c_time>, ...

    ...

    clear ll_write_back_adq.

    ll_write_back_adq-a_account = <lv_c_account>.

    ll_write_back_adq-p_time = <lv_c_time>.

    ...

    assign ll_write_back_adq to <ld_write_back>.

    insert <ld_write_back> into table <td_write_back>.

    endloop.

    * lo_ujo_write_back type ref to cl_ujo_write_back

    create object lo_ujo_write_back.

    move appset_id to l_appset_id.

    move appl_id to l_appl_id.

    try.

    call method lo_ujo_write_back->if_ujo_write_back~write_back

    exporting

    i_appset_id = l_appset_id

    i_appl_id = l_appl_id

    it_records = <td_write_back>

    importing

    et_error_records = <td_write_back_err>

    et_message = lt_message

    ef_success = lf_success

    et_message_df = lt_message_df.

    catch cx_ujo_write_back .

    catch cx_uj_static_check .

    endtry.

    * Here we have a block in which we check the content of importing parameters and the content

    * of <td_write_back> in order to fill in the message table that is returned to script logic

    * at the end of the BAdI process to display this info in the log of the logic after its execution

    ...

    ...

    ...


    I hope this can be usefull for other collegues.

    Thanks a lot.

    Raul R.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 30, 2014 at 02:42 PM

    Hi Raul,

    I think that the BADI doesn't recognise the command DESTINATION_APP.

    Please take a look at this link *DESTINATION_APP - SAP Business Planning and Consolidation, version for SAP NetWeaver - SAP Library

    It explains you how the command works.

    Otherwise you can replicate the same functionality in your BADI

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e04b5d24-085f-2c10-d5a2-c1153a9f9346?QuickLink=index&…

    Hope this can solve your issue

    Regards

    Andrea

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Andrea.

      As you mentioned, with our last approach we write data at Source APP with datasrc = BADI, and after returning from BADI processing, the script logic writes data in the Target APP when datasrc = BADI.

      We want to avoid the first "write" in the Source Model.

      We have been reviewing the links that you pass in your second reply and we think that maybe the use of write_back method could help us, but here we have another question.

      We have implemented our CUSTOM_LOGIC BADI and the question is if we have to call write_back method in the BADI code (just before ending BADI processing) or if we have to replicate the code that we have at CUSTOM_LOGIC in another BADI for CL_UJR_WRITE_BACK.

      What we need to do is take data from Source Model and write them into Target Model after some calculations that are made if some conditions match.

      Regards.

      Raúl Rozalén.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.