cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BP Transaction new tab under company code using BDT : Data not getting saved

shubham_banerjee
Participant
4,616

Hi Experts,

After referring to multiple blogs regarding BDT, I needed to ask this question. My requirement is as following,

Req 1: Insert a new tab in BP transaction, under Company Code, for a custom BP role: Royalty Data, in the attached picture is the new tab and added successfully.

Req 2: The new tab will contain 1 standard field from table BUT000 and 6 custom fields(append) from table LFB1: Fields added to the view and all the necessary customizings are done accordingly.

The PBO module is working fine and showing all the respective data from BUT000 and LFB1, as follows.

cvi_bdt_adapter=>data_pbo(  
EXPORTING  
i_table_name = table_name_but000  
IMPORTING  
e_data_table = lt_but000[]  ).  

READ TABLE lt_but000 INTO gs_but000 INDEX 1.

cvi_bdt_adapter=>data_pbo_with_company_code(  
EXPORTING  
i_table_name = table_name_lfb1  
IMPORTING  
e_data_table = lt_lfb1[]  ). 

READ TABLE lt_lfb1 INTO gs_lfb1 WITH KEY bukrs = <..>. 

Issue: The PAI module / Event *_DSAVE is not working at all and data inserted on the view is not being committed to database. The *_DSAVE event is coded as following,

CHECK cvi_bdt_adapter=>is_direct_input_active( ) = false.
CHECK cvi_bdt_adapter=>get_current_company_code( ) IS NOT INITIAL.

* Retrieve currently processed BP data/BUT000
CALL METHOD cvi_bdt_adapter=>get_current_bp_data
EXPORTING  
i_table_name = table_name_but000  
IMPORTING  
e_data_table = lt_but000[].

READ TABLE lt_but000 ASSIGNING FIELD-SYMBOL(<fs_but000>) INDEX 1.
<fs_but000>-<field> = gs_but000-<field>.

* Tried alternative # 1 for BUT000
  CALL METHOD cvi_bdt_adapter=>data_pai
    EXPORTING
      i_table_name = table_name_but000
      i_data_new   = lt_but000
*     i_validate   =
*     i_msg_to_store =
*     i_dynp_struc =
*     i_bdt_view   =
    RECEIVING
      r_messages   = msg .

* Tried alternative # 2 for BUT000
CALL METHOD cvi_bdt_adapter=>set_current_bp_data
  EXPORTING
    i_table_name = table_name_but000
    i_data_new   = lt_but000[]
    i_validate   = ' '
*  RECEIVING
*    r_messages   = lt_messages
 .

* Retrieve currently processed BP Company Code data/LFB1
  cvi_bdt_adapter=>get_current_bp_cc_data(
    EXPORTING
      i_table_name = table_name_lfb1
    IMPORTING
      e_data_table = lt_lfb1[]
  ).

READ TABLE lt_lfb1 ASSIGNING FIELD-SYMBOL(<fs_lfb1>) INDEX 1.
<fs_lfb1>-<field_1> = gs_lfb1-<field_1> .
<fs_lfb1>-<field_2> = gs_lfb1-<field_2> .
...

* Tried alternative # 1 for LFB1
  CALL METHOD cvi_bdt_adapter=>data_pai_with_company_code
    EXPORTING
      i_table_name = table_name_lfb1
      i_data_new   = lt_lfb1
*     i_validate   =
*     i_msg_to_store =
*     i_dynp_struc =
*     i_bdt_view   =
    RECEIVING
      r_messages   = msg .

* Tried alternative # 2 for LFB1
CALL METHOD cvi_bdt_adapter=>set_current_bp_data
  EXPORTING
    i_table_name = table_name_lfb1
    i_data_new   = lt_lfb1[]
    i_validate   = ' '
*  RECEIVING
*    r_messages   = lt_messages
 .

A kind help with finding me out the proper method name or relevant coding to get the data saved from the BP transaction to the database will be a great help and also an addition to the list of the articles/blogs available for BDT .

Thanks in advance.

Regards,

Shubham

View Entire Topic
shubham_banerjee
Participant

Dear sandra.rossi,

Request for your kind support, if you have done similar implementation prior or can introduce me to someone with similar exposure.

Thanks in advance.

Regards,

Shubham

Sandra_Rossi
Active Contributor
0 Kudos

Please use the COMMENT button for comments, questions, adding details, replying to OP comment, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.