cancel
Showing results for 
Search instead for 
Did you mean: 

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

shubham_banerjee
Participant
3,052

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
akshay_rp
Explorer
0 Kudos

 

@shubham_banerjee 

To update Lfa1 / LFB1 entry from BP Tcode 

use below BDT adapter class method 


          cvi_bdt_adapter=>set_current_bp_cc_data(
             EXPORTING
               i_table_name =    lc_tab_lfb1              " Table Name
               i_data_new   =    lt_lfb1[]
               i_validate   'X'              " Validate Data Automatically
             RECEIVING
             r_messages   DATA(lt_message_lfb1)             " Return Table

 

Where lt_lfb1 will hold updated entry .

there are more  Set* methods in adapter class cvi_bdt_adapter to update other relivant table and can be call Custom BDT FM logic .

 

Regards ,

Akshay 

 

Lourdes_br
Participant
0 Kudos
Hello, I am facing similar issue but trying update Relationship data ( BUT050 ). I am using cvi_bdt_adapter=>SET_CURRENT_BP_DATA, but data is not updated on . Any suggestion or hint ?