7/6/2023 0 Comments Delete itab![]() ![]() * Call FM in update task to avoid confustion between creation of two accounting documents * Append newly generated error in exisitng RETURN parameterĬ_return = VALUE #( BASE c_return ( LINES OF lt_return ) ( type = lc_msgtyp_e IF ( line_exists( lt_return ) OR line_exists( lt_return ) ). Iv_billto_cntry = ls_billing_header-billto_cntry * It removes the existing record and updates with the new details, which further create an error for Normal accounting postingĭATA(ls_acchd) = CORRESPONDING acchd( c_acchd ).ĭATA(lt_accit) = CORRESPONDING accit_tab( c_accit ).ĭATA(lt_acccr) = CORRESPONDING acccr_tab( c_acccr ).ĭATA(lt_accwt) = CORRESPONDING accwt_tab( c_accwt ).ĭATA(lt_acctx) = CORRESPONDING acctx_tab( c_acctx ).ĭATA(lt_accfi) = CORRESPONDING accfi_t( c_accfi ). * Internally below FM would check and call ACCOUNTING DOCUMENT creation logic * Store all the changing paramter locally before calling below FM, * which would prevent execution of logic in case if method gets triggered againĭELETE c_extension2 WHERE structure EQ lc_billh_struct * Delete Extension fields after collecting in local internal table MODIFY lt_vbrp FROM ls_vbrp TRANSPORTING werks WHERE werks IS INITIAL.ĭATA(lt_komv) = CORRESPONDING komv_t( lt_billing_cond ). LOOP AT c_accit ASSIGNING FIELD-SYMBOL() WHERE werks IS NOT INITIAL.ĭATA(ls_vbrp) = VALUE vbrpvb( werks = -werks ). Lt_billing_cond = VALUE ty_tt_bcond( BASE lt_billing_cond ( CONV zbilling_cnd( -valuepart1 ) ) ).ĭATA(lt_vbrp) = CORRESPONDING vbrpvb_t( lt_billing_item ). Lt_billing_item = VALUE ty_tt_bitem( BASE lt_billing_item ( CONV zbilling_i( -valuepart1 ) ) ). LOOP AT c_extension2 ASSIGNING FIELD-SYMBOL().ĭATA(ls_billing_header) = CONV zbilling_h( -valuepart1 ). * Populate Billing Header, Item and conditions values from CRM * Execution would be Only for CRM invoices Lt_return TYPE STANDARD TABLE OF bapiret2. Lt_billing_cond TYPE STANDARD TABLE OF zfp0_billing_cond, Ty_tt_bcond TYPE STANDARD TABLE OF zfp0_billing_cond WITH DEFAULT KEY.ĭATA: lt_billing_item TYPE STANDARD TABLE OF zfp0_billing_item, TYPES : ty_tt_bitem TYPE STANDARD TABLE OF zfp0_billing_item WITH DEFAULT KEY, Value 1 : BEBD Comparator 1 : = (Equal) Filter : AWTYP CONSTANTS : lc_msgtyp_e TYPE bapi_mtype VALUE 'E', We have BADI BADI_ACC_DOCUMENT and method : IF_EX_ACC_DOCUMENT~CHANGE (with below filter condition) in ECC which will process further to create accounting document. Valuepart1 = CONV valuepart( ls_billing_item ) ) ). ![]() Matnr = CONV matnr( ls_crmb_bdi_pr-product_id ) Netwr = shift_left( CONV char21( ls_crmb_bdi_pr-net_value ) ) * Populate Header value and pass it to the extensionĭATA(ls_billing_header) = VALUE zbilling_h( vbeln = CONV #( || )įkimg = shift_left( CONV char17( is_item-inv_qty ) ) IF NOT line_exists( ct_bapicrmparex[ be_head_no = cs_acc_achead-be_head_no * Header item would be append only once as this method is being triggered at item level * Only populate below extension values if there is an 'ZCND' tax present at item level Valuepart1 = CONV valuepart( ls_billing_cond ) ) ). Kwert = shift_left( lt_cond_db-kwert ) ).Ĭt_bapicrmparex = VALUE #( BASE ct_bapicrmparex ( be_head_no = cs_acc_achead-be_head_no * Populate condition type in conditions and pass it to the extensionĭATA(ls_billing_cond) = VALUE zbilling_cnd( kposn = CONV kposn( is_item-be_item_no ) It_item_no = VALUE prct_item_no_t( ( is_item-be_item_guid ) )ĭATA(lt_partner_std) = CORRESPONDING bill_acc_t_partner( lt_partner ). * Get Pricing conditions values against each line item Lc_billcnd_struct TYPE te_struc VALUE 'ZBILLING_CND'. Lc_billi_struct TYPE te_struc VALUE 'ZBILLING_I', Lc_billh_struct TYPE te_struc VALUE 'ZBILLING_H', CONSTANTS : lc_kschl TYPE kschl VALUE 'ZCND', So I created three separate DDIC structures in CRM and ECC both. Please refer below code snippets to demonstrate the functionality:įor my requirement, it was required to pass Header, Item and conditions details. Let’s create one implementation and put code in method IF_EX_BILL_ACC_IF~ENRICH_ACC_DOCUMENT to populate changing parameter (extension table) CT_BAPICRMPAREX. ![]() Solution: We have middleware accounting BADI (BILL_ACC_IF) which will pass the data to ECC during accounting document creation from CRM billing. ![]() So we were left with no option and achieved same by exploring the requirement through ECC USER-EXIT/ CRM middleware BADI, automatically after the standard process gets completed. But business was very stringent due to one it’s special case and wanted to inherit this custom requirement with the standard process. There might be one question can come up why it was at all required and believe me that we had a same question. Introduction: Recently we faced a scenario where it was required to create one more accounting document ( different document type) in ECC for CRM billing scenario and for a special case. ![]()
0 Comments
Leave a Reply. |